diff --git a/.dockerignore b/.dockerignore index 4fd66d5..611e348 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ vendor/ release/ .git/ wave +**/*.swp diff --git a/hack/run-test-in-minikube.sh b/hack/run-test-in-minikube.sh index 4f8aa6f..2d38685 100755 --- a/hack/run-test-in-minikube.sh +++ b/hack/run-test-in-minikube.sh @@ -13,6 +13,15 @@ kubectl --help > /dev/null 2>&1 || { exit 1 } +if [[ "$1" == "clean" ]]; then + helm uninstall wave || true + kubectl delete configmap test test-completed || true + kubectl delete role test || true + kubectl delete rolebinding test || true + kubectl delete deployment test || true + exit 0 +fi + MINIKUBE_ALREADY_RUNNING=0 kubectl get node minikube >/dev/null 2>&1 && MINIKUBE_ALREADY_RUNNING=1 @@ -88,6 +97,8 @@ metadata: name: test annotations: wave.pusher.com/update-on-config-change: "true" + wave.pusher.com/extra-configmaps: "test/test" + wave.pusher.com/extra-secrets: "test/test" spec: replicas: 1 selector: diff --git a/pkg/core/handler.go b/pkg/core/handler.go index d7bf6bf..e8b7d4a 100644 --- a/pkg/core/handler.go +++ b/pkg/core/handler.go @@ -103,9 +103,12 @@ func (h *Handler[I]) handlePodController(instance I) (reconcile.Result, error) { err = h.checkRequiredChildren(configMaps, secrets, configMapsConfig, secretsConfig) if err != nil { // We are missing children but we added watchers for all children so we are done + log.V(0).Info("Waiting for children...", "error", err) return reconcile.Result{}, nil } + log.V(0).Info("All children found", "configMaps", fmt.Sprint(configMaps), "secrets", fmt.Sprint(secrets)) + hash, err := calculateConfigHash(configMaps, secrets, configMapsConfig, secretsConfig) if err != nil { return reconcile.Result{}, fmt.Errorf("error calculating configuration hash: %v", err)