diff --git a/charts/accumulo/templates/accumulo-manager-deployment.yaml b/charts/accumulo/templates/accumulo-manager-deployment.yaml index f13ae3e7924..6964acb10f8 100644 --- a/charts/accumulo/templates/accumulo-manager-deployment.yaml +++ b/charts/accumulo/templates/accumulo-manager-deployment.yaml @@ -112,7 +112,8 @@ spec: INSTANCE_EXISTS=false # Use ListInstances to check ZooKeeper (works with Java 17) - if /opt/accumulo/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "{{ .Values.accumulo.instance.name }}"; then + # Match instance name with quotes to avoid false positives from ZooKeeper hostname + if /opt/accumulo/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "\"{{ .Values.accumulo.instance.name }}\""; then echo "✓ Accumulo instance '{{ .Values.accumulo.instance.name }}' already exists in ZooKeeper" INSTANCE_EXISTS=true diff --git a/charts/accumulo/templates/alluxio-worker-daemonset.yaml b/charts/accumulo/templates/alluxio-worker-daemonset.yaml index 7eaaea74d1a..f239381857c 100644 --- a/charts/accumulo/templates/alluxio-worker-daemonset.yaml +++ b/charts/accumulo/templates/alluxio-worker-daemonset.yaml @@ -61,26 +61,15 @@ spec: sleep 5 done - # Set worker hostname to FQDN for Kubernetes DNS resolution - WORKER_FQDN="${POD_NAME}.{{ include "accumulo.fullname" . }}-alluxio-worker.${POD_NAMESPACE}.svc.cluster.local" - echo "Setting Alluxio worker hostname to: ${WORKER_FQDN}" + # Worker hostname is set via ALLUXIO_WORKER_HOSTNAME environment variable + echo "Alluxio worker hostname: ${ALLUXIO_WORKER_HOSTNAME}" + echo "Alluxio job worker hostname: ${ALLUXIO_JOB_WORKER_HOSTNAME}" - # Export as environment variables for Alluxio to pick up - export ALLUXIO_WORKER_HOSTNAME="${WORKER_FQDN}" - export ALLUXIO_JOB_WORKER_HOSTNAME="${WORKER_FQDN}" - - # Add to alluxio-site.properties dynamically - cat >> /opt/alluxio/conf/alluxio-site.properties </dev/null | grep -q "$ACCUMULO_INSTANCE_NAME"; then + # Match instance name with quotes to avoid false positives from ZooKeeper hostname + if "$ACCUMULO_HOME"/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "\"$ACCUMULO_INSTANCE_NAME\""; then echo "Accumulo instance '$ACCUMULO_INSTANCE_NAME' already exists" else echo "Initializing Accumulo instance '$ACCUMULO_INSTANCE_NAME'..." diff --git a/scripts/validate-accumulo-init.sh b/scripts/validate-accumulo-init.sh index 6c00418a92e..ac6aa114013 100755 --- a/scripts/validate-accumulo-init.sh +++ b/scripts/validate-accumulo-init.sh @@ -195,7 +195,8 @@ check_accumulo_init() { fi # Check if instance exists in ZooKeeper - if kubectl exec -n "$NAMESPACE" "$MANAGER_POD" -- /opt/accumulo/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "$INSTANCE_NAME"; then + # Match instance name with quotes to avoid false positives from ZooKeeper hostname + if kubectl exec -n "$NAMESPACE" "$MANAGER_POD" -- /opt/accumulo/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "\"$INSTANCE_NAME\""; then validate_check "Accumulo instance '$INSTANCE_NAME' exists in ZooKeeper" "pass" else validate_check "Accumulo instance '$INSTANCE_NAME' NOT found in ZooKeeper" "fail"