Skip to content

Commit

Permalink
fix the naming of the k8ssandracluster resource (#2638)
Browse files Browse the repository at this point in the history
Signed-off-by: Batuhan Apaydin <batuhan.apaydin@chainguard.dev>
Co-authored-by: Furkan Turkal <furkan.turkal@chainguard.dev>
  • Loading branch information
developer-guy and Dentrax authored May 7, 2024
1 parent bb4531f commit 8ee9f81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions images/cassandra-medusa/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ resource "imagetest_harness_k3s" "this" {
}
]
envs = {
"NAMESPACE" = "k8s-medusa-${random_pet.suffix.id}"
"IMAGE_REGISTRY" = data.oci_string.ref.registry
"IMAGE_REPOSITORY" = split("/", data.oci_string.ref.repo)[0]
"NAME" = split("/", data.oci_string.ref.repo)[1]
"IMAGE_TAG" = data.oci_string.ref.pseudo_tag
"NAMESPACE" = "k8s-medusa-${random_pet.suffix.id}"
"IMAGE_REGISTRY" = data.oci_string.ref.registry
"IMAGE_REPOSITORY" = split("/", data.oci_string.ref.repo)[0]
"NAME" = split("/", data.oci_string.ref.repo)[1]
"K8SSANDRA_CLUSTER_NAME" = "foo-${random_pet.suffix.id}"
"IMAGE_TAG" = data.oci_string.ref.pseudo_tag
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions images/cassandra-medusa/tests/medusa-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ kubectl apply -n ${NAMESPACE} -f - <<EOF
apiVersion: k8ssandra.io/v1alpha1
kind: K8ssandraCluster
metadata:
name: ${NAME}
name: ${K8SSANDRA_CLUSTER_NAME}
namespace: ${NAMESPACE}
spec:
cassandra:
serverVersion: "4.0.1"
datacenters:
- metadata:
name: ${NAME}
name: ${K8SSANDRA_CLUSTER_NAME}
size: 1
storageConfig:
cassandraDataVolumeClaimSpec:
Expand Down Expand Up @@ -139,13 +139,13 @@ spec:
EOF

# Check readiness of the Cassandra Medusa pod
retry_command 5 15 "Cassandra Medusa pod readiness" "kubectl wait --for=condition=Ready pod -l app=${NAME}-${NAME}-medusa-standalone -n ${NAMESPACE} --timeout=2m"
retry_command 30 30 "Cassandra Medusa pod readiness" "kubectl wait --for=condition=Ready pod -l app=${K8SSANDRA_CLUSTER_NAME}-${K8SSANDRA_CLUSTER_NAME}-medusa-standalone -n ${NAMESPACE} --timeout=2m"

# Check readiness of the Cassandra stateful set
retry_command 20 30 "Cassandra stateful set readiness" "kubectl get statefulset ${NAME}-${NAME}-default-sts -n ${NAMESPACE} --no-headers -o custom-columns=READY:.status.readyReplicas | grep -q '1'"
retry_command 30 30 "Cassandra stateful set readiness" "kubectl get statefulset ${K8SSANDRA_CLUSTER_NAME}-${K8SSANDRA_CLUSTER_NAME}-default-sts -n ${NAMESPACE} --no-headers -o custom-columns=READY:.status.readyReplicas | grep -q '1'"

# Check Medusa gRPC server startup
kubectl logs -l app=${NAME}-${NAME}-medusa-standalone --tail -1 -n ${NAMESPACE} | grep "Starting server. Listening on port 50051"
kubectl logs -l app=${K8SSANDRA_CLUSTER_NAME}-${K8SSANDRA_CLUSTER_NAME}-medusa-standalone --tail -1 -n ${NAMESPACE} | grep "Starting server. Listening on port 50051"

# Create Medusa Backup
kubectl apply -n ${NAMESPACE} -f - <<EOF
Expand Down

0 comments on commit 8ee9f81

Please sign in to comment.