diff --git a/Dockerfile b/Dockerfile index c97b18c6..81f4a64c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM --platform=$BUILDPLATFORM golang:1.22.0 as builder +FROM --platform=$BUILDPLATFORM golang:1.22.5 as builder ARG TARGETOS ARG TARGETARCH diff --git a/go.mod b/go.mod index 86a77200..7506b268 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,15 @@ module github.com/sap/cf-service-operator -go 1.21 +go 1.22.5 require ( github.com/cloudfoundry-community/go-cfclient/v3 v3.0.0-alpha.5 + github.com/go-logr/logr v1.4.1 github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 github.com/onsi/ginkgo/v2 v2.15.0 github.com/onsi/gomega v1.31.1 github.com/pkg/errors v0.9.1 + github.com/prometheus/client_golang v1.18.0 k8s.io/api v0.29.0 k8s.io/apiextensions-apiserver v0.29.0 k8s.io/apimachinery v0.29.0 @@ -24,7 +26,6 @@ require ( github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.8.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/zapr v1.3.0 // indirect github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect @@ -50,7 +51,6 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect diff --git a/internal/controllers/serviceinstance_controller.go b/internal/controllers/serviceinstance_controller.go index 3b882888..23e61860 100644 --- a/internal/controllers/serviceinstance_controller.go +++ b/internal/controllers/serviceinstance_controller.go @@ -383,7 +383,7 @@ func (r *ServiceInstanceReconciler) Reconcile(ctx context.Context, req ctrl.Requ case facade.InstanceStateReady: serviceInstance.SetReadyCondition(cfv1alpha1.ConditionTrue, string(cfinstance.State), cfinstance.StateDescription) serviceInstance.Status.RetryCounter = 0 // Reset the retry counter - return getPollingInterval(serviceInstance.GetAnnotations(), "10m",cfv1alpha1.AnnotationPollingIntervalReady), nil + return getPollingInterval(serviceInstance.GetAnnotations(), "10m", cfv1alpha1.AnnotationPollingIntervalReady), nil case facade.InstanceStateCreatedFailed, facade.InstanceStateUpdateFailed, facade.InstanceStateDeleteFailed: // Check if the retry counter exceeds the maximum allowed retries. // Check if the maximum retry limit is exceeded. @@ -459,7 +459,7 @@ func (r *ServiceInstanceReconciler) HandleError(ctx context.Context, serviceInst if serviceInstance.Status.MaxRetries != serviceInstanceDefaultMaxRetries && serviceInstance.Status.RetryCounter >= serviceInstance.Status.MaxRetries { // Update the instance's status to reflect the failure due to too many retries. serviceInstance.SetReadyCondition(cfv1alpha1.ConditionFalse, "MaximumRetriesExceeded", "The service instance has failed due to too many retries.") - return getPollingInterval(serviceInstance.GetAnnotations(), "",cfv1alpha1.AnnotationPollingIntervalFail), nil // finish reconcile loop + return getPollingInterval(serviceInstance.GetAnnotations(), "", cfv1alpha1.AnnotationPollingIntervalFail), nil // finish reconcile loop } // double the requeue interval condition := serviceInstance.GetReadyCondition() diff --git a/internal/controllers/space_controller.go b/internal/controllers/space_controller.go index a8ed721c..a8e1c6f8 100644 --- a/internal/controllers/space_controller.go +++ b/internal/controllers/space_controller.go @@ -240,7 +240,7 @@ func (r *SpaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resu log.V(1).Info("healthcheck successful") space.SetReadyCondition(cfv1alpha1.ConditionTrue, spaceReadyConditionReasonSuccess, "Success") - return getPollingInterval(space.GetAnnotations(), "60s",cfv1alpha1.AnnotationPollingIntervalReady), nil + return getPollingInterval(space.GetAnnotations(), "60s", cfv1alpha1.AnnotationPollingIntervalReady), nil } else if len(serviceInstanceList.Items) > 0 { space.SetReadyCondition(cfv1alpha1.ConditionUnknown, spaceReadyConditionReasonDeletionBlocked, "Waiting for deletion of depending service instances") // TODO: apply some increasing period, depending on the age of the last update