diff --git a/api/go.mod b/api/go.mod index fb2644a6..48ef7a61 100644 --- a/api/go.mod +++ b/api/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/onsi/ginkgo/v2 v2.19.1 github.com/onsi/gomega v1.34.1 - github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808054407-ac8a151e3cca + github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808095747-579da98fa7a6 k8s.io/api v0.28.12 k8s.io/apimachinery v0.28.12 k8s.io/client-go v0.28.12 diff --git a/api/go.sum b/api/go.sum index 3e63a761..f67b3b79 100644 --- a/api/go.sum +++ b/api/go.sum @@ -68,8 +68,8 @@ github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0 github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= -github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808054407-ac8a151e3cca h1:ymNDlXtzuatPd+Oj+hL2YULEbKVsbHbytO+6HDoPwm4= -github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808054407-ac8a151e3cca/go.mod h1:hCT/Ba8kRkRB23d07YEsCzELsYcJGpD/Uw4NDh+LD6w= +github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808095747-579da98fa7a6 h1:QrqPZPnJuJoYRFXL3aE4b+onLjjEUq8b3JjuptUkOoE= +github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808095747-579da98fa7a6/go.mod h1:hCT/Ba8kRkRB23d07YEsCzELsYcJGpD/Uw4NDh+LD6w= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/controllers/barbicanapi_controller.go b/controllers/barbicanapi_controller.go index d1ee1762..d2eee7c2 100644 --- a/controllers/barbicanapi_controller.go +++ b/controllers/barbicanapi_controller.go @@ -202,16 +202,9 @@ func (r *BarbicanAPIReconciler) getSecret( expectedFields []string, envVars *map[string]env.Setter, ) (ctrl.Result, error) { + Log := r.GetLogger(ctx) hash, result, err := secret.VerifySecret(ctx, types.NamespacedName{Name: secretName, Namespace: instance.Namespace}, expectedFields, h.GetClient(), time.Second*10) if err != nil { - if k8s_errors.IsNotFound(err) { - instance.Status.Conditions.Set(condition.FalseCondition( - condition.InputReadyCondition, - condition.RequestedReason, - condition.SeverityInfo, - condition.InputReadyWaitingMessage)) - return result, fmt.Errorf("OpenStack secret %s not found", secretName) - } instance.Status.Conditions.Set(condition.FalseCondition( condition.InputReadyCondition, condition.ErrorReason, @@ -219,6 +212,14 @@ func (r *BarbicanAPIReconciler) getSecret( condition.InputReadyErrorMessage, err.Error())) return ctrl.Result{}, err + } else if (result != ctrl.Result{}) { + Log.Info(fmt.Sprintf("OpenStack secret %s not found", secretName)) + instance.Status.Conditions.Set(condition.FalseCondition( + condition.InputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + condition.InputReadyWaitingMessage)) + return result, nil } // Add a prefix to the var name to avoid accidental collision with other non-secret diff --git a/go.mod b/go.mod index 38f2d80d..7ce9ec62 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-00010101000000-000000000000 github.com/openstack-k8s-operators/infra-operator/apis v0.4.1-0.20240806064941-b443f719b8b7 github.com/openstack-k8s-operators/keystone-operator/api v0.4.1-0.20240806171358-1c577c9ef576 - github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808054407-ac8a151e3cca + github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808095747-579da98fa7a6 github.com/openstack-k8s-operators/lib-common/modules/storage v0.4.1-0.20240808054407-ac8a151e3cca github.com/openstack-k8s-operators/lib-common/modules/test v0.4.1-0.20240808054407-ac8a151e3cca github.com/openstack-k8s-operators/mariadb-operator/api v0.4.1-0.20240806091527-f02e6eab246b diff --git a/go.sum b/go.sum index 016a038b..bde19343 100644 --- a/go.sum +++ b/go.sum @@ -78,8 +78,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.4.1-0.20240806064941-b github.com/openstack-k8s-operators/infra-operator/apis v0.4.1-0.20240806064941-b443f719b8b7/go.mod h1:dobs750SWnLGGP8Z1Y6Rn4uRU/a9PkKaklKlcE7kIVA= github.com/openstack-k8s-operators/keystone-operator/api v0.4.1-0.20240806171358-1c577c9ef576 h1:9XTSwNHHfjamTID0YMgK/Mb/x6oItdUl0OFXuUqGdIk= github.com/openstack-k8s-operators/keystone-operator/api v0.4.1-0.20240806171358-1c577c9ef576/go.mod h1:nAeWBizvWIMtbHEAzmIupqADriOF92V8MOox6doWupA= -github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808054407-ac8a151e3cca h1:ymNDlXtzuatPd+Oj+hL2YULEbKVsbHbytO+6HDoPwm4= -github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808054407-ac8a151e3cca/go.mod h1:hCT/Ba8kRkRB23d07YEsCzELsYcJGpD/Uw4NDh+LD6w= +github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808095747-579da98fa7a6 h1:QrqPZPnJuJoYRFXL3aE4b+onLjjEUq8b3JjuptUkOoE= +github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240808095747-579da98fa7a6/go.mod h1:hCT/Ba8kRkRB23d07YEsCzELsYcJGpD/Uw4NDh+LD6w= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.4.1-0.20240808054407-ac8a151e3cca h1:KuNnvh3MEQ4tgG7X9k2wWC7uFVwE1lOqRBAaaJ0+WHQ= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.4.1-0.20240808054407-ac8a151e3cca/go.mod h1:Z9QhWZexP9fYcZrBRI5rrcRwTh6LSsd5XB7NWzdphaE= github.com/openstack-k8s-operators/lib-common/modules/storage v0.4.1-0.20240808054407-ac8a151e3cca h1:QCHc/473ywfiABLVSlhw5DEK6XpqH8tCdem88KRZXtA=