From 6275d9ef27b0a6ea3a1ef8d45a0b8f4d91611377 Mon Sep 17 00:00:00 2001 From: vbadrina Date: Fri, 12 Jul 2024 12:25:58 +0530 Subject: [PATCH 1/2] Update OCS-Operator API Version: - Updated OCS-Operator API import path to `github.com/red-hat-storage/ocs-operator/api/v4/v1`. - Adjusted import paths in various files: - `addons/agent_mirrorpeer_controller.go` - `addons/agent_mirrorpeer_controller_test.go` - `addons/blue_secret_controller_test.go` - `addons/green_secret_controller_test.go` - `addons/maintenance_mode_controller.go` - `addons/manager.go` - `addons/rook_secret_handler.go` - `addons/s3_controller_test.go` - `api/v1alpha1/mirrorpeer_types.go` - `api/v1alpha1/mirrorpeer_webhook.go` - `api/v1alpha1/zz_generated.deepcopy.go` - `controllers/drpolicy_controller.go` - `controllers/mirrorpeer_controller.go` - `controllers/mirrorpeer_controller_test.go` - `controllers/utils/cluster.go` - Updated `go.mod` and `go.sum` to reflect the new OCS-Operator API version. Signed-off-by: vbadrina --- addons/agent_mirrorpeer_controller.go | 2 +- addons/agent_mirrorpeer_controller_test.go | 2 +- addons/blue_secret_controller_test.go | 2 +- addons/green_secret_controller_test.go | 2 +- addons/maintenance_mode_controller.go | 2 +- addons/manager.go | 2 +- addons/rook_secret_handler.go | 2 +- addons/s3_controller_test.go | 2 +- controllers/utils/cluster.go | 3 +- go.mod | 65 ++++----- go.sum | 148 +++++++++++---------- 11 files changed, 124 insertions(+), 108 deletions(-) diff --git a/addons/agent_mirrorpeer_controller.go b/addons/agent_mirrorpeer_controller.go index ceb22457..8ff05be8 100644 --- a/addons/agent_mirrorpeer_controller.go +++ b/addons/agent_mirrorpeer_controller.go @@ -26,7 +26,7 @@ import ( "time" obv1alpha1 "github.com/kube-object-storage/lib-bucket-provisioner/pkg/apis/objectbucket.io/v1alpha1" - ocsv1 "github.com/red-hat-storage/ocs-operator/api/v1" + ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" multiclusterv1alpha1 "github.com/red-hat-storage/odf-multicluster-orchestrator/api/v1alpha1" "github.com/red-hat-storage/odf-multicluster-orchestrator/controllers/utils" rookv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" diff --git a/addons/agent_mirrorpeer_controller_test.go b/addons/agent_mirrorpeer_controller_test.go index 2b8c0095..6a4b011d 100644 --- a/addons/agent_mirrorpeer_controller_test.go +++ b/addons/agent_mirrorpeer_controller_test.go @@ -11,7 +11,7 @@ import ( "github.com/red-hat-storage/odf-multicluster-orchestrator/controllers/utils" storagev1 "k8s.io/api/storage/v1" - ocsv1 "github.com/red-hat-storage/ocs-operator/api/v1" + ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" multiclusterv1alpha1 "github.com/red-hat-storage/odf-multicluster-orchestrator/api/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/addons/blue_secret_controller_test.go b/addons/blue_secret_controller_test.go index edb11bfa..54d9e33e 100644 --- a/addons/blue_secret_controller_test.go +++ b/addons/blue_secret_controller_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - ocsv1 "github.com/red-hat-storage/ocs-operator/api/v1" + ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" "github.com/red-hat-storage/odf-multicluster-orchestrator/controllers/utils" rookv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" corev1 "k8s.io/api/core/v1" diff --git a/addons/green_secret_controller_test.go b/addons/green_secret_controller_test.go index e771eab3..578c5fb7 100644 --- a/addons/green_secret_controller_test.go +++ b/addons/green_secret_controller_test.go @@ -5,7 +5,7 @@ import ( "encoding/json" "testing" - ocsv1 "github.com/red-hat-storage/ocs-operator/api/v1" + ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" "github.com/red-hat-storage/odf-multicluster-orchestrator/addons/setup" "github.com/red-hat-storage/odf-multicluster-orchestrator/controllers/utils" corev1 "k8s.io/api/core/v1" diff --git a/addons/maintenance_mode_controller.go b/addons/maintenance_mode_controller.go index b1c363a4..a5c2c7ca 100644 --- a/addons/maintenance_mode_controller.go +++ b/addons/maintenance_mode_controller.go @@ -6,7 +6,7 @@ import ( "log/slog" ramenv1alpha1 "github.com/ramendr/ramen/api/v1alpha1" - ocsv1 "github.com/red-hat-storage/ocs-operator/api/v1" + ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" "github.com/red-hat-storage/odf-multicluster-orchestrator/controllers/utils" rookv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" appsv1 "k8s.io/api/apps/v1" diff --git a/addons/manager.go b/addons/manager.go index 678d80a3..517d327d 100644 --- a/addons/manager.go +++ b/addons/manager.go @@ -12,7 +12,7 @@ import ( obv1alpha1 "github.com/kube-object-storage/lib-bucket-provisioner/pkg/apis/objectbucket.io/v1alpha1" routev1 "github.com/openshift/api/route/v1" ramenv1alpha1 "github.com/ramendr/ramen/api/v1alpha1" - ocsv1 "github.com/red-hat-storage/ocs-operator/api/v1" + ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" "github.com/red-hat-storage/odf-multicluster-orchestrator/addons/setup" multiclusterv1alpha1 "github.com/red-hat-storage/odf-multicluster-orchestrator/api/v1alpha1" "github.com/red-hat-storage/odf-multicluster-orchestrator/controllers/utils" diff --git a/addons/rook_secret_handler.go b/addons/rook_secret_handler.go index 7b56e521..b30d672a 100644 --- a/addons/rook_secret_handler.go +++ b/addons/rook_secret_handler.go @@ -7,7 +7,7 @@ import ( "os" "strings" - ocsv1 "github.com/red-hat-storage/ocs-operator/api/v1" + ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" "github.com/red-hat-storage/odf-multicluster-orchestrator/addons/setup" "github.com/red-hat-storage/odf-multicluster-orchestrator/controllers/utils" rookv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" diff --git a/addons/s3_controller_test.go b/addons/s3_controller_test.go index 515bceeb..55d11434 100644 --- a/addons/s3_controller_test.go +++ b/addons/s3_controller_test.go @@ -6,7 +6,7 @@ import ( obv1alpha1 "github.com/kube-object-storage/lib-bucket-provisioner/pkg/apis/objectbucket.io/v1alpha1" routev1 "github.com/openshift/api/route/v1" - ocsv1 "github.com/red-hat-storage/ocs-operator/api/v1" + ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" multiclusterv1alpha1 "github.com/red-hat-storage/odf-multicluster-orchestrator/api/v1alpha1" "github.com/red-hat-storage/odf-multicluster-orchestrator/controllers/utils" rookv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" diff --git a/controllers/utils/cluster.go b/controllers/utils/cluster.go index 3e6f83a8..14aaad4d 100644 --- a/controllers/utils/cluster.go +++ b/controllers/utils/cluster.go @@ -3,7 +3,8 @@ package utils import ( "context" "fmt" - ocsv1 "github.com/red-hat-storage/ocs-operator/api/v1" + + ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" rookv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" appsv1 "k8s.io/api/apps/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/go.mod b/go.mod index 5e3026c8..10f321e2 100644 --- a/go.mod +++ b/go.mod @@ -7,21 +7,21 @@ require ( github.com/go-logr/zapr v1.3.0 github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.31.1 - github.com/openshift/api v0.0.0-20240124164020-e2ce40831f2e + github.com/onsi/gomega v1.32.0 + github.com/openshift/api v0.0.0-20240323003854-2252c7adfb79 github.com/openshift/library-go v0.0.0-20240124134907-4dfbf6bc7b11 github.com/ramendr/ramen/api v0.0.0-20240409201920-10024cae3bfd - github.com/red-hat-storage/ocs-operator v0.4.13 - github.com/rook/rook/pkg/apis v0.0.0-20231204200402-5287527732f7 + github.com/red-hat-storage/ocs-operator/api/v4 v4.0.0-20240327160100-bbe9d9d49462 + github.com/rook/rook/pkg/apis v0.0.0-20240513003450-39f88521f0fd github.com/spf13/cobra v1.8.0 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 go.uber.org/zap/exp v0.2.0 - golang.org/x/sync v0.5.0 - k8s.io/api v0.29.2 + golang.org/x/sync v0.6.0 + k8s.io/api v0.29.3 k8s.io/apiextensions-apiserver v0.29.2 - k8s.io/apimachinery v0.29.2 - k8s.io/client-go v0.29.2 + k8s.io/apimachinery v0.29.3 + k8s.io/client-go v0.29.3 k8s.io/klog/v2 v2.120.1 open-cluster-management.io/addon-framework v0.6.1 open-cluster-management.io/api v0.13.0 @@ -30,30 +30,30 @@ require ( ) require ( + github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/containernetworking/cni v1.1.2 // indirect + github.com/containernetworking/cni v1.2.0-rc1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/evanphx/json-patch v5.7.0+incompatible // indirect + github.com/emicklei/go-restful/v3 v3.12.0 // indirect + github.com/evanphx/json-patch v5.9.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.8.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 // indirect - github.com/go-jose/go-jose/v3 v3.0.3 // indirect + github.com/go-jose/go-jose/v4 v4.0.1 // indirect github.com/go-logr/logr v1.4.1 // indirect - github.com/go-openapi/jsonpointer v0.20.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3 // indirect - github.com/google/uuid v1.4.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect @@ -63,14 +63,14 @@ require ( github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect github.com/hashicorp/go-sockaddr v1.0.6 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hashicorp/vault/api v1.12.0 // indirect - github.com/hashicorp/vault/api/auth/approle v0.5.0 // indirect - github.com/hashicorp/vault/api/auth/kubernetes v0.5.0 // indirect + github.com/hashicorp/vault/api v1.13.0 // indirect + github.com/hashicorp/vault/api/auth/approle v0.6.0 // indirect + github.com/hashicorp/vault/api/auth/kubernetes v0.6.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0 // indirect + github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.0 // indirect github.com/libopenstorage/secrets v0.0.0-20231011182615-5f4b25ceede1 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect @@ -79,8 +79,9 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/noobaa/noobaa-operator/v5 v5.0.0-20231213124549-5d7b0417716d // indirect + github.com/noobaa/noobaa-operator/v5 v5.0.0-20240418141646-fcc5240f5af6 // indirect github.com/nxadm/tail v1.4.8 // indirect + github.com/onsi/ginkgo/v2 v2.17.1 // indirect github.com/openshift/custom-resource-status v1.1.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -93,17 +94,17 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stolostron/multicloud-operators-placementrule v1.2.4-1-20220311-8eedb3f.0.20230828200208-cd3c119a7fa0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/oauth2 v0.15.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/exp v0.0.0-20231127185646-65229373498e // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -111,8 +112,8 @@ require ( k8s.io/apiserver v0.29.2 // indirect k8s.io/component-base v0.29.2 // indirect k8s.io/kube-aggregator v0.29.2 // indirect - k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a // indirect - k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect + k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 // indirect + k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect diff --git a/go.sum b/go.sum index 2c9aede5..f5fccded 100644 --- a/go.sum +++ b/go.sum @@ -86,6 +86,8 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/IBM/keyprotect-go-client v0.5.1/go.mod h1:5TwDM/4FRJq1ZOlwQL1xFahLWQ3TveR88VmL1u3njyI= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -141,8 +143,8 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ= -github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= +github.com/containernetworking/cni v1.2.0-rc1 h1:AKI3+pXtgY4PDLN9+50o9IaywWVuey0Jkw3Lvzp0HCY= +github.com/containernetworking/cni v1.2.0-rc1/go.mod h1:Lt0TQcZQVDju64fYxUhDziTgXCDe3Olzi9I4zZJLWHg= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -184,8 +186,8 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/emicklei/go-restful v2.15.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= +github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -200,8 +202,8 @@ github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= -github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls= +github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1u0KQro= github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -224,8 +226,9 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= -github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= -github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= +github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= +github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U= +github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -254,9 +257,8 @@ github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwds github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= @@ -265,8 +267,8 @@ github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL9 github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= @@ -291,9 +293,8 @@ github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= @@ -302,8 +303,9 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= +github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -348,8 +350,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -405,8 +407,8 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -479,12 +481,15 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/vault/api v1.10.0/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= -github.com/hashicorp/vault/api v1.12.0 h1:meCpJSesvzQyao8FCOgk2fGdoADAnbDu2WPJN1lDLJ4= github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck= -github.com/hashicorp/vault/api/auth/approle v0.5.0 h1:a1TK6VGwYqSAfkmX4y4dJ4WBxMU5dStIZqScW4EPXR8= +github.com/hashicorp/vault/api v1.13.0 h1:RTCGpE2Rgkn9jyPcFlc7YmNocomda44k5ck8FKMH41Y= +github.com/hashicorp/vault/api v1.13.0/go.mod h1:0cb/uZUv1w2cVu9DIvuW1SMlXXC6qtATJt+LXJRx+kg= github.com/hashicorp/vault/api/auth/approle v0.5.0/go.mod h1:CHOQIA1AZACfjTzHggmyfiOZ+xCSKNRFqe48FTCzH0k= -github.com/hashicorp/vault/api/auth/kubernetes v0.5.0 h1:CXO0fD7M3iCGovP/UApeHhPcH4paDFKcu7AjEXi94rI= +github.com/hashicorp/vault/api/auth/approle v0.6.0 h1:ELfFFQlTM/e97WJKu1HvNFa7lQ3tlTwwzrR1NJE1V7Y= +github.com/hashicorp/vault/api/auth/approle v0.6.0/go.mod h1:CCoIl1xBC3lAWpd1HV+0ovk76Z8b8Mdepyk21h3pGk0= github.com/hashicorp/vault/api/auth/kubernetes v0.5.0/go.mod h1:afrElBIO9Q4sHFVuVWgNevG4uAs1bT2AZFA9aEiI608= +github.com/hashicorp/vault/api/auth/kubernetes v0.6.0 h1:K8sKGhtTAqGKfzaaYvUSIOAqTOIn3Gk1EsCEAMzZHtM= +github.com/hashicorp/vault/api/auth/kubernetes v0.6.0/go.mod h1:Htwcjez5J9PwAHaZ1EYMBlgGq3/in5ajUV4+WCPihPE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -513,8 +518,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0 h1:VzM3TYHDgqPkettiP6I6q2jOeQFL4nrJM+UcAc4f6Fs= -github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0/go.mod h1:nqCI7aelBJU61wiBeeZWJ6oi4bJy5nrjkM6lWIMA4j0= +github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.0 h1:47q2PIbDYHmOaqLxgGnvpLq96v9UKDsJfNW6j/KbfpQ= +github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.0/go.mod h1:KDX0bPKeuhMakcNzLf2sWXKPNZ30wH01bsY/KJZLxFY= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -624,8 +629,8 @@ github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8Ay github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw= github.com/onsi/ginkgo/v2 v2.6.0/go.mod h1:63DOGlLAH8+REH8jUGdL3YpCpu7JODesutUjdENfUAc= -github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= +github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= +github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -640,11 +645,11 @@ github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= -github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= -github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= +github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= +github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= github.com/openshift/api v0.0.0-20210105115604-44119421ec6b/go.mod h1:aqU5Cq+kqKKPbDMqxo9FojgDeSpNJI7iuskjXjtojDg= -github.com/openshift/api v0.0.0-20240124164020-e2ce40831f2e h1:cxgCNo/R769CO23AK5TCh45H9SMUGZ8RukiF2/Qif3o= -github.com/openshift/api v0.0.0-20240124164020-e2ce40831f2e/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4= +github.com/openshift/api v0.0.0-20240323003854-2252c7adfb79 h1:ShXEPrqDUU9rUbvoIhOmQI8D6yHQdklMUks9ZVILTNE= +github.com/openshift/api v0.0.0-20240323003854-2252c7adfb79/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4= github.com/openshift/build-machinery-go v0.0.0-20200917070002-f171684f77ab/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/client-go v0.0.0-20210112165513-ebc401615f47/go.mod h1:u7NRAjtYVAKokiI9LouzTv4mhds8P4S1TwdVAfbjKSk= github.com/openshift/custom-resource-status v1.1.2 h1:C3DL44LEbvlbItfd8mT5jWrqPfHnSOQoQf/sypqA6A4= @@ -706,18 +711,18 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/ramendr/ramen/api v0.0.0-20240409201920-10024cae3bfd h1:TsDaQqfb1BcR78JWXBmUyj6Qx4By5loUZ95CxmA/6zo= github.com/ramendr/ramen/api v0.0.0-20240409201920-10024cae3bfd/go.mod h1:PCb0ODjdi4eYuxY/nSw+/rQqmzkmBVqGNoDr2JXdlKE= -github.com/red-hat-storage/ocs-operator v0.4.13 h1:+FdRGqgewn7v22LvhQUV8iSzLm8d6k4T+zyX0Zjo7qw= -github.com/red-hat-storage/ocs-operator v0.4.13/go.mod h1:92CGJGBXykejC89+h8s0pohpb0JRwfwPE9IwUNF5+sY= +github.com/red-hat-storage/ocs-operator/api/v4 v4.0.0-20240327160100-bbe9d9d49462 h1:84M7EBnmBISt2LcoyYPWsw+A3/7BGXp6Mh3sjUH5vIg= +github.com/red-hat-storage/ocs-operator/api/v4 v4.0.0-20240327160100-bbe9d9d49462/go.mod h1:uySjux/lY0DpC+VXof4ly2SlS7QUocTm2CH4sU8ICeg= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rook/rook/pkg/apis v0.0.0-20231204200402-5287527732f7 h1:jXRUM2OJDz6hwpO4fElAgUqdTKosO3LHV3fwEB6iYJM= -github.com/rook/rook/pkg/apis v0.0.0-20231204200402-5287527732f7/go.mod h1:ZnB1JWtsxJLz2Q3ylHFS4lE/2A1lw2zIOKN0uAmhiZM= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rook/rook/pkg/apis v0.0.0-20240513003450-39f88521f0fd h1:AvYCpfHnCy7qY6zXR9lophJ7o9E7AdJV49FXKP+OV6A= +github.com/rook/rook/pkg/apis v0.0.0-20240513003450-39f88521f0fd/go.mod h1:X/tPOJyDiIcJG75MLdPIYbZ4gKK3WMOyCb6ErPWSG0k= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -771,9 +776,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -781,6 +786,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8= +github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -843,8 +850,10 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -855,8 +864,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= +golang.org/x/exp v0.0.0-20231127185646-65229373498e h1:Gvh4YaCaXNs6dKTlfgismwWZKyjVZXwOPfIyUaqU3No= +golang.org/x/exp v0.0.0-20231127185646-65229373498e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -955,8 +964,9 @@ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmL golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -977,8 +987,8 @@ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= -golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -993,8 +1003,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1091,7 +1101,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1103,8 +1114,10 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1120,6 +1133,7 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1205,8 +1219,8 @@ golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1387,8 +1401,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1444,8 +1458,8 @@ k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ= k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= -k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A= -k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0= +k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= +k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= k8s.io/apiextensions-apiserver v0.18.3/go.mod h1:TMsNGs7DYpMXd+8MOCX8KzPOCx8fnZMoIGB24m03+JE= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= @@ -1461,8 +1475,8 @@ k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRp k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.26.0/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= -k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= +k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= +k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= k8s.io/apiserver v0.18.3/go.mod h1:tHQRmthRPLUtwqsOnJJMoI8SW3lnoReZeE861lH8vUw= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.29.2 h1:+Z9S0dSNr+CjnVXQePG8TcBWHr3Q7BmAr7NraHvsMiQ= @@ -1473,8 +1487,8 @@ k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= k8s.io/client-go v0.20.0/go.mod h1:4KWh/g+Ocd8KkCwKF8vUNnmqgv+EVnQDK4MBF4oB5tY= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= -k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= -k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= +k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= +k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= k8s.io/code-generator v0.18.3/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/code-generator v0.19.0/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= k8s.io/code-generator v0.20.0/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= @@ -1512,8 +1526,8 @@ k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAG k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a h1:ZeIPbyHHqahGIbeyLJJjAUhnxCKqXaDY+n89Ms8szyA= -k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 h1:qVoMaQV5t62UUvHe16Q3eb2c5HPzLHYzsi0Tu/xLndo= +k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= @@ -1522,8 +1536,8 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY= +k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= open-cluster-management.io/addon-framework v0.6.1 h1:gnBZaCRgtiPRjCBJoaRqMivajng/XOKp0NQhJUqLd+U= open-cluster-management.io/addon-framework v0.6.1/go.mod h1:Uu4XC3Ec0ATS7U73PJtzAP4NCDfbDBVy1k5RUUwQDqY= open-cluster-management.io/api v0.13.0 h1:dlcJEZlNlE0DmSDctK2s7iWKg9l+Tgb0V78Z040nMuk= From c08f043f53adc8e0ca3040a865becf30c9d825a5 Mon Sep 17 00:00:00 2001 From: vbadrina Date: Fri, 12 Jul 2024 12:28:38 +0530 Subject: [PATCH 2/2] Refactor MirrorPeerReconciler - Introduced `MirrorPeerReconcileTask` type for modular reconciliation tasks. - Separated and modularized various reconciliation functions: - `processMirrorPeerDeletion` - `ValidateMirrorPeer` - `AddLabels` - `UpdateMirrorPeerPhase` - `processManagedClusterAddon` - `createClusterRoleBindingsForSpoke` - `processMirrorPeerSecretChanges` - `createDRClusters` - `updateMirrorPeerStatus` - Separated and modularized various reconciliations functions for agent controller and conditionally adding tasks for Async mode - `processMirrorPeerDeletion` - `createS3` - `labelCephClusters` - `enableCSIAddons` - `enableMirroring` - `labelRBDStorageClasses` - Enhanced logging for better traceability and debugging. - Improved error handling, ensuring appropriate actions on errors like conflicts and not found cases. Signed-off-by: vbadrina --- addons/agent_mirrorpeer_controller.go | 253 +++++++++++------- controllers/mirrorpeer_controller.go | 300 +++++++++++----------- controllers/mirrorpeer_controller_test.go | 35 ++- 3 files changed, 336 insertions(+), 252 deletions(-) diff --git a/addons/agent_mirrorpeer_controller.go b/addons/agent_mirrorpeer_controller.go index 8ff05be8..552b53bb 100644 --- a/addons/agent_mirrorpeer_controller.go +++ b/addons/agent_mirrorpeer_controller.go @@ -52,26 +52,10 @@ type MirrorPeerReconciler struct { Logger *slog.Logger } -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile -func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - logger := r.Logger.With("MirrorPeer", req.NamespacedName.String()) - logger.Info("Running MirrorPeer reconciler on spoke cluster") - - var mirrorPeer multiclusterv1alpha1.MirrorPeer - err := r.HubClient.Get(ctx, req.NamespacedName, &mirrorPeer) - if err != nil { - if errors.IsNotFound(err) { - logger.Info("MirrorPeer not found, ignoring since object must have been deleted") - return ctrl.Result{}, nil - } - logger.Error("Failed to retrieve MirrorPeer", "error", err) - return ctrl.Result{}, err - } +type MirrorPeerReconcileTask func(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) +func (r *MirrorPeerReconciler) processMirrorPeerDeletion(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) scr, err := utils.GetCurrentStorageClusterRef(&mirrorPeer, r.SpokeClusterName) if err != nil { logger.Error("Failed to get current storage cluster ref", "error", err) @@ -97,7 +81,7 @@ func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request) if err != nil { return result, err } - err = r.HubClient.Get(ctx, req.NamespacedName, &mirrorPeer) + err = r.HubClient.Get(ctx, types.NamespacedName{Name: mirrorPeer.Name}, &mirrorPeer) if err != nil { if errors.IsNotFound(err) { logger.Info("MirrorPeer deleted during reconciling, skipping") @@ -116,73 +100,89 @@ func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request) return ctrl.Result{}, nil } - logger.Info("Creating S3 buckets") - err = r.createS3(ctx, mirrorPeer, scr.Namespace) + return ctrl.Result{}, nil +} + +// Reconcile is part of the main kubernetes reconciliation loop which aims to +// move the current state of the cluster closer to the desired state. +// +// For more details, check Reconcile and its Result here: +// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile +func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", req.NamespacedName.String()) + logger.Info("Running MirrorPeer reconciler on spoke cluster") + + var mirrorPeer multiclusterv1alpha1.MirrorPeer + err := r.HubClient.Get(ctx, req.NamespacedName, &mirrorPeer) if err != nil { - logger.Error("Failed to create ODR S3 resources", "error", err) + if errors.IsNotFound(err) { + logger.Info("MirrorPeer not found, ignoring since object must have been deleted") + return ctrl.Result{}, nil + } + logger.Error("Failed to retrieve MirrorPeer", "error", err) return ctrl.Result{}, err } - if mirrorPeer.Spec.Type == multiclusterv1alpha1.Async { - clusterFSIDs := make(map[string]string) - logger.Info("Fetching clusterFSIDs") - err = r.fetchClusterFSIDs(ctx, &mirrorPeer, clusterFSIDs) - if err != nil { - if errors.IsNotFound(err) { - return ctrl.Result{RequeueAfter: 60 * time.Second}, nil - } - return ctrl.Result{}, fmt.Errorf("an unknown error occurred while fetching the cluster fsids, retrying again: %v", err) - } + tasks := []MirrorPeerReconcileTask{ + r.processMirrorPeerDeletion, + r.createS3, + } + if mirrorPeer.Spec.Type == multiclusterv1alpha1.Async { logger.Info("Enabling async mode dependencies") - err = r.labelCephClusters(ctx, scr, clusterFSIDs) - if err != nil { - logger.Error("Failed to label cephcluster", "error", err) - return ctrl.Result{}, err - } - err = r.enableCSIAddons(ctx, scr.Namespace) - if err != nil { - return ctrl.Result{}, fmt.Errorf("failed to start CSI Addons for rook: %v", err) - } + asyncTasks := r.getAsyncModeTasks() + tasks = append(tasks, asyncTasks...) + } - err = r.enableMirroring(ctx, scr.Name, scr.Namespace, &mirrorPeer) + mirrorPeerCopy := mirrorPeer.DeepCopy() + for _, task := range tasks { + result, err := task(ctx, *mirrorPeerCopy) if err != nil { - return ctrl.Result{}, fmt.Errorf("failed to enable mirroring the storagecluster %q in namespace %q in managed cluster: %v", scr.Name, scr.Namespace, err) + return result, err } - - logger.Info("Labeling RBD storageclasses") - errs := r.labelRBDStorageClasses(ctx, scr.Namespace, clusterFSIDs) - if len(errs) > 0 { - return ctrl.Result{}, fmt.Errorf("few failures occurred while labeling RBD StorageClasses: %v", errs) + if result.Requeue || result.RequeueAfter > 0 { + return result, nil } } + return ctrl.Result{}, nil } +func (r *MirrorPeerReconciler) getAsyncModeTasks() []MirrorPeerReconcileTask { + tasks := []MirrorPeerReconcileTask{ + r.labelCephClusters, + r.enableCSIAddons, + r.enableMirroring, + r.labelRBDStorageClasses, + } + return tasks +} + func (r *MirrorPeerReconciler) fetchClusterFSIDs(ctx context.Context, mp *multiclusterv1alpha1.MirrorPeer, clusterFSIDs map[string]string) error { + logger := r.Logger.With("MirrorPeer", mp.Name) for _, pr := range mp.Spec.Items { clusterType, err := utils.GetClusterType(pr.StorageClusterRef.Name, pr.StorageClusterRef.Namespace, r.SpokeClient) if err != nil { - r.Logger.Error("Failed to get cluster type", "clusterName", pr.StorageClusterRef.Name, "namespace", pr.StorageClusterRef.Namespace, "error", err) + logger.Error("Failed to get cluster type", "clusterName", pr.StorageClusterRef.Name, "namespace", pr.StorageClusterRef.Namespace, "error", err) return err } secretName := r.getSecretNameByType(clusterType, pr) - r.Logger.Info("Checking secret", "secretName", secretName, "mode", clusterType, "clusterName", pr.StorageClusterRef.Name, "namespace", pr.StorageClusterRef.Namespace) + logger.Info("Checking secret", "secretName", secretName, "mode", clusterType, "clusterName", pr.StorageClusterRef.Name, "namespace", pr.StorageClusterRef.Namespace) secret, err := utils.FetchSecretWithName(ctx, r.SpokeClient, types.NamespacedName{Name: secretName, Namespace: pr.StorageClusterRef.Namespace}) if err != nil { - r.Logger.Error("Failed to fetch secret", "secretName", secretName, "namespace", pr.StorageClusterRef.Namespace, "error", err) + logger.Error("Failed to fetch secret", "secretName", secretName, "namespace", pr.StorageClusterRef.Namespace, "error", err) return err } fsid, err := r.getFsidFromSecretByType(clusterType, secret) if err != nil { - r.Logger.Error("Failed to extract FSID from secret", "secretName", secretName, "namespace", pr.StorageClusterRef.Namespace, "error", err) + logger.Error("Failed to extract FSID from secret", "secretName", secretName, "namespace", pr.StorageClusterRef.Namespace, "error", err) return err } clusterFSIDs[pr.ClusterName] = fsid - r.Logger.Info("FSID fetched for cluster", "clusterName", pr.ClusterName, "FSID", fsid) + logger.Info("FSID fetched for cluster", "clusterName", pr.ClusterName, "FSID", fsid) } return nil } @@ -223,62 +223,92 @@ func (r *MirrorPeerReconciler) getSecretNameByType(clusterType utils.ClusterType return secretName } -func (r *MirrorPeerReconciler) labelRBDStorageClasses(ctx context.Context, storageClusterNamespace string, clusterFSIDs map[string]string) []error { - r.Logger.Info("Fetching cluster FSIDs", "clusterFSIDs", clusterFSIDs) +func (r *MirrorPeerReconciler) labelRBDStorageClasses(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) + logger.Info("Labeling RBD storageclasses") + scr, err := utils.GetCurrentStorageClusterRef(&mirrorPeer, r.SpokeClusterName) + if err != nil { + logger.Error("Failed to get current storage cluster ref", "error", err) + return ctrl.Result{}, err + } + + clusterFSIDs := make(map[string]string) + logger.Info("Fetching clusterFSIDs") + err = r.fetchClusterFSIDs(ctx, &mirrorPeer, clusterFSIDs) + if err != nil { + if errors.IsNotFound(err) { + return ctrl.Result{RequeueAfter: 60 * time.Second}, nil + } + return ctrl.Result{}, fmt.Errorf("an unknown error occurred while fetching the cluster fsids, retrying again: %v", err) + } + + storageClusterNamespace := scr.Namespace + + logger.Info("Fetching cluster FSIDs", "clusterFSIDs", clusterFSIDs) // Get all StorageClasses in storageClusterNamespace scs := &storagev1.StorageClassList{} - err := r.SpokeClient.List(ctx, scs) + err = r.SpokeClient.List(ctx, scs) var errs []error if err != nil { errs = append(errs, err) - r.Logger.Error("Failed to list StorageClasses", "namespace", storageClusterNamespace, "error", err) - return errs + return ctrl.Result{}, fmt.Errorf("failed to list StorageClasses %v", errs) } - r.Logger.Info("Found StorageClasses", "count", len(scs.Items), "namespace", storageClusterNamespace) + logger.Info("Found StorageClasses", "count", len(scs.Items), "namespace", storageClusterNamespace) key := r.SpokeClusterName for _, sc := range scs.Items { if fsid, ok := clusterFSIDs[key]; !ok { errMsg := fmt.Errorf("no FSID found for key: %s, unable to update StorageClass", key) errs = append(errs, errMsg) - r.Logger.Error("Missing FSID for StorageClass update", "key", key, "StorageClass", sc.Name) continue } else { if sc.Provisioner == fmt.Sprintf(RBDProvisionerTemplate, storageClusterNamespace) || sc.Provisioner == fmt.Sprintf(CephFSProvisionerTemplate, storageClusterNamespace) { - r.Logger.Info("Updating StorageClass with FSID", "StorageClass", sc.Name, "FSID", fsid) + logger.Info("Updating StorageClass with FSID", "StorageClass", sc.Name, "FSID", fsid) if sc.Labels == nil { sc.Labels = make(map[string]string) } sc.Labels[fmt.Sprintf(RamenLabelTemplate, StorageIDKey)] = fsid if err = r.SpokeClient.Update(ctx, &sc); err != nil { errs = append(errs, err) - r.Logger.Error("Failed to update StorageClass with FSID", "StorageClass", sc.Name, "FSID", fsid, "error", err) } } } } - return errs + if len(errs) > 0 { + return ctrl.Result{}, fmt.Errorf("few failures occurred while labeling RBD StorageClasses: %v", errs) + } + + return ctrl.Result{}, nil } -func (r *MirrorPeerReconciler) createS3(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer, scNamespace string) error { +func (r *MirrorPeerReconciler) createS3(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) + logger.Info("Creating S3 buckets") + scr, err := utils.GetCurrentStorageClusterRef(&mirrorPeer, r.SpokeClusterName) + if err != nil { + logger.Error("Failed to get current storage cluster ref", "error", err) + return ctrl.Result{}, err + } + + scNamespace := scr.Namespace noobaaOBC, err := r.getS3bucket(ctx, mirrorPeer, scNamespace) if err != nil { if errors.IsNotFound(err) { - r.Logger.Info("ODR ObjectBucketClaim not found, creating new one", "MirrorPeer", mirrorPeer.Name, "namespace", scNamespace) + r.Logger.Info("ODR ObjectBucketClaim not found, creating new one", "namespace", scNamespace) err = r.SpokeClient.Create(ctx, noobaaOBC) if err != nil { - r.Logger.Error("Failed to create ODR ObjectBucketClaim", "error", err, "MirrorPeer", mirrorPeer.Name, "namespace", scNamespace) - return err + r.Logger.Error("Failed to create ODR ObjectBucketClaim", "error", err, "namespace", scNamespace) + return ctrl.Result{}, err } } else { - r.Logger.Error("Failed to retrieve ODR ObjectBucketClaim", "error", err, "MirrorPeer", mirrorPeer.Name, "namespace", scNamespace) - return err + r.Logger.Error("Failed to retrieve ODR ObjectBucketClaim", "error", err, "namespace", scNamespace) + return ctrl.Result{}, err } } else { - r.Logger.Info("ODR ObjectBucketClaim already exists, no action needed", "MirrorPeer", mirrorPeer.Name, "namespace", scNamespace) + r.Logger.Info("ODR ObjectBucketClaim already exists, no action needed", "namespace", scNamespace) } - return nil + return ctrl.Result{}, nil } func (r *MirrorPeerReconciler) getS3bucket(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer, scNamespace string) (*obv1alpha1.ObjectBucketClaim, error) { @@ -318,9 +348,19 @@ func (r *MirrorPeerReconciler) getS3bucket(ctx context.Context, mirrorPeer multi } // enableMirroring is a wrapper function around toggleMirroring to enable mirroring in a storage cluster -func (r *MirrorPeerReconciler) enableMirroring(ctx context.Context, storageClusterName string, namespace string, mp *multiclusterv1alpha1.MirrorPeer) error { - r.Logger.Info("Enabling mirroring on StorageCluster", "storageClusterName", storageClusterName, "namespace", namespace) - return r.toggleMirroring(ctx, storageClusterName, namespace, true, mp) +func (r *MirrorPeerReconciler) enableMirroring(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) + scr, err := utils.GetCurrentStorageClusterRef(&mirrorPeer, r.SpokeClusterName) + if err != nil { + logger.Error("Failed to get current storage cluster ref", "error", err) + return ctrl.Result{}, err + } + + storageClusterName := scr.Name + namespace := scr.Namespace + + logger.Info("Enabling mirroring on StorageCluster", "storageClusterName", storageClusterName, "namespace", namespace) + return ctrl.Result{}, r.toggleMirroring(ctx, storageClusterName, namespace, true, &mirrorPeer) } // toggleMirroring changes the state of mirroring in the storage cluster @@ -380,14 +420,22 @@ func hasRequiredSecret(peerSecrets []string, oppositePeerRef []multiclusterv1alp } return true } -func (r *MirrorPeerReconciler) enableCSIAddons(ctx context.Context, namespace string) error { - err := r.toggleCSIAddons(ctx, namespace, true) +func (r *MirrorPeerReconciler) enableCSIAddons(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) + scr, err := utils.GetCurrentStorageClusterRef(&mirrorPeer, r.SpokeClusterName) + if err != nil { + logger.Error("Failed to get current storage cluster ref", "error", err) + return ctrl.Result{}, err + } + + namespace := scr.Namespace + err = r.toggleCSIAddons(ctx, namespace, true) if err != nil { r.Logger.Error("Failed to enable CSI addons", "namespace", namespace, "error", err) - return err + return ctrl.Result{}, err } r.Logger.Info("CSI addons enabled successfully", "namespace", namespace) - return nil + return ctrl.Result{}, nil } func (r *MirrorPeerReconciler) toggleCSIAddons(ctx context.Context, namespace string, enabled bool) error { @@ -559,16 +607,33 @@ func (r *MirrorPeerReconciler) deleteMirrorPeer(ctx context.Context, mirrorPeer return ctrl.Result{}, nil } -func (r *MirrorPeerReconciler) labelCephClusters(ctx context.Context, scr *multiclusterv1alpha1.StorageClusterRef, clusterFSIDs map[string]string) error { - r.Logger.Info("Labelling CephClusters with replication ID") +func (r *MirrorPeerReconciler) labelCephClusters(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) + logger.Info("Labelling CephClusters with replication ID") + scr, err := utils.GetCurrentStorageClusterRef(&mirrorPeer, r.SpokeClusterName) + if err != nil { + logger.Error("Failed to get current storage cluster ref", "error", err) + return ctrl.Result{}, err + } + + clusterFSIDs := make(map[string]string) + logger.Info("Fetching clusterFSIDs") + err = r.fetchClusterFSIDs(ctx, &mirrorPeer, clusterFSIDs) + if err != nil { + if errors.IsNotFound(err) { + return ctrl.Result{RequeueAfter: 60 * time.Second}, nil + } + return ctrl.Result{}, fmt.Errorf("an unknown error occurred while fetching the cluster fsids, retrying again: %v", err) + } + cephClusters, err := utils.FetchAllCephClusters(ctx, r.SpokeClient) if err != nil { - r.Logger.Error("Failed to fetch all CephClusters", "error", err) - return err + logger.Error("Failed to fetch all CephClusters", "error", err) + return ctrl.Result{}, err } if cephClusters == nil || len(cephClusters.Items) == 0 { - r.Logger.Info("No CephClusters found to label") - return nil + logger.Info("No CephClusters found to label") + return ctrl.Result{}, nil } var found rookv1.CephCluster @@ -586,8 +651,8 @@ func (r *MirrorPeerReconciler) labelCephClusters(ctx context.Context, scr *multi } } if !foundFlag { - r.Logger.Info("No CephCluster matched the StorageCluster reference", "StorageClusterRef", scr.Name) - return nil + logger.Info("No CephCluster matched the StorageCluster reference", "StorageClusterRef", scr.Name) + return ctrl.Result{}, nil } if found.Labels == nil { @@ -596,21 +661,21 @@ func (r *MirrorPeerReconciler) labelCephClusters(ctx context.Context, scr *multi replicationId, err := utils.CreateUniqueReplicationId(clusterFSIDs) if err != nil { - r.Logger.Error("Failed to create a unique replication ID", "error", err) - return err + logger.Error("Failed to create a unique replication ID", "error", err) + return ctrl.Result{}, err } if found.Labels[utils.CephClusterReplicationIdLabel] != replicationId { - r.Logger.Info("Adding label to CephCluster", "label", utils.CephClusterReplicationIdLabel, "replicationId", replicationId, "CephCluster", found.Name) + logger.Info("Adding label to CephCluster", "label", utils.CephClusterReplicationIdLabel, "replicationId", replicationId, "CephCluster", found.Name) found.Labels[utils.CephClusterReplicationIdLabel] = replicationId err = r.SpokeClient.Update(ctx, &found) if err != nil { - r.Logger.Error("Failed to update CephCluster with new label", "CephCluster", found.Name, "label", utils.CephClusterReplicationIdLabel, "error", err) - return err + logger.Error("Failed to update CephCluster with new label", "CephCluster", found.Name, "label", utils.CephClusterReplicationIdLabel, "error", err) + return ctrl.Result{}, err } } else { - r.Logger.Info("CephCluster already labeled with replication ID", "CephCluster", found.Name, "replicationId", replicationId) + logger.Info("CephCluster already labeled with replication ID", "CephCluster", found.Name, "replicationId", replicationId) } - return nil + return ctrl.Result{}, nil } diff --git a/controllers/mirrorpeer_controller.go b/controllers/mirrorpeer_controller.go index aa5a1f5f..62363ee8 100644 --- a/controllers/mirrorpeer_controller.go +++ b/controllers/mirrorpeer_controller.go @@ -18,6 +18,7 @@ package controllers import ( "context" + "fmt" "log/slog" "os" @@ -43,7 +44,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/predicate" - "sigs.k8s.io/controller-runtime/pkg/reconcile" ) // MirrorPeerReconciler reconciles a MirrorPeer object @@ -53,6 +53,8 @@ type MirrorPeerReconciler struct { Logger *slog.Logger } +type MirrorPeerReconcileTask func(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) + const mirrorPeerFinalizer = "hub.multicluster.odf.openshift.io" const spokeClusterRoleBindingName = "spoke-clusterrole-bindings" @@ -80,55 +82,21 @@ const spokeClusterRoleBindingName = "spoke-clusterrole-bindings" // // For more details, check Reconcile and its Result here: // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile -func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - logger := r.Logger.With("MirrorPeer", req.NamespacedName.String()) - logger.Info("Reconciling request") - // Fetch MirrorPeer for given Request - var mirrorPeer multiclusterv1alpha1.MirrorPeer - err := r.Get(ctx, req.NamespacedName, &mirrorPeer) - if err != nil { - if k8serrors.IsNotFound(err) { - // Request object not found, could have been deleted after reconcile request. - // Owned objects are automatically garbage collected. For additional cleanup logic use finalizers. - // Return and don't requeue - logger.Info("Could not find MirrorPeer. Ignoring since object must have been deleted") - return ctrl.Result{}, nil - } - // Error reading the object - requeue the request. - logger.Error("Failed to get MirrorPeer", "error", err) - return ctrl.Result{}, err - } - - logger.Info("Validating MirrorPeer") - // Validate MirrorPeer - // MirrorPeer.Spec must be defined - if err := undefinedMirrorPeerSpec(mirrorPeer.Spec); err != nil { - logger.Error("MirrorPeer spec is undefined", "error", err) - return ctrl.Result{Requeue: false}, err - } - // MirrorPeer.Spec.Items must be unique - if err := uniqueSpecItems(mirrorPeer.Spec); err != nil { - logger.Error("MirrorPeer spec items are not unique", "error", err) - return ctrl.Result{Requeue: false}, err - } - for i := range mirrorPeer.Spec.Items { - // MirrorPeer.Spec.Items must not have empty fields - if err := emptySpecItems(mirrorPeer.Spec.Items[i]); err != nil { - logger.Error("MirrorPeer spec items have empty fields", "error", err) - return reconcile.Result{Requeue: false}, err - } - // MirrorPeer.Spec.Items[*].ClusterName must be a valid ManagedCluster - if err := isManagedCluster(ctx, r.Client, mirrorPeer.Spec.Items[i].ClusterName); err != nil { - logger.Error("Invalid ManagedCluster", "ClusterName", mirrorPeer.Spec.Items[i].ClusterName, "error", err) - return ctrl.Result{}, err - } - } - logger.Info("All validations for MirrorPeer passed") +func (r *MirrorPeerReconciler) processMirrorPeerDeletion(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) if mirrorPeer.GetDeletionTimestamp().IsZero() { if !utils.ContainsString(mirrorPeer.GetFinalizers(), mirrorPeerFinalizer) { logger.Info("Finalizer not found on MirrorPeer. Adding Finalizer") mirrorPeer.Finalizers = append(mirrorPeer.Finalizers, mirrorPeerFinalizer) + if err := r.Client.Update(ctx, &mirrorPeer); err != nil { + if k8serrors.IsConflict(err) { + logger.Info("Failed to update MirrorPeer as object is being updated. Requeing to reconcile again") + return ctrl.Result{Requeue: true}, nil + } + logger.Error("Failed to add finalizer to MirrorPeer", "error", err) + return ctrl.Result{}, err + } } } else { logger.Info("Deleting MirrorPeer") @@ -136,45 +104,64 @@ func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request) statusErr := r.Client.Status().Update(ctx, &mirrorPeer) if statusErr != nil { logger.Error("Error occurred while updating the status of mirrorpeer", "Error", statusErr) - return ctrl.Result{Requeue: true}, nil + return ctrl.Result{}, statusErr } if utils.ContainsString(mirrorPeer.GetFinalizers(), mirrorPeerFinalizer) { if utils.ContainsSuffix(mirrorPeer.GetFinalizers(), addons.SpokeMirrorPeerFinalizer) { logger.Info("Waiting for agent to delete resources") - return reconcile.Result{Requeue: true}, err + return ctrl.Result{}, nil } if err := r.deleteSecrets(ctx, mirrorPeer); err != nil { logger.Error("Failed to delete resources", "error", err) - return reconcile.Result{Requeue: true}, err + return ctrl.Result{}, err } mirrorPeer.Finalizers = utils.RemoveString(mirrorPeer.Finalizers, mirrorPeerFinalizer) if err := r.Client.Update(ctx, &mirrorPeer); err != nil { logger.Error("Failed to remove finalizer from MirrorPeer", "error", err) - return reconcile.Result{}, err + return ctrl.Result{}, err } } - logger.Info("MirrorPeer deleted, skipping reconcilation") - return reconcile.Result{}, nil + logger.Info("MirrorPeer deleted, skipping reconciliation") + return ctrl.Result{}, nil } + return ctrl.Result{}, nil +} - mirrorPeerCopy := mirrorPeer.DeepCopy() - if mirrorPeerCopy.Labels == nil { - mirrorPeerCopy.Labels = make(map[string]string) +func (r *MirrorPeerReconciler) ValidateMirrorPeer(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) + + logger.Info("Validating MirrorPeer") + + // MirrorPeer.Spec must be defined + if err := undefinedMirrorPeerSpec(mirrorPeer.Spec); err != nil { + return ctrl.Result{}, fmt.Errorf("MirrorPeer spec is undefined: %w", err) } - if val, ok := mirrorPeerCopy.Labels[utils.HubRecoveryLabel]; !ok || val != "resource" { - logger.Info("Adding label to mirrorpeer for disaster recovery") - mirrorPeerCopy.Labels[utils.HubRecoveryLabel] = "resource" - err = r.Client.Update(ctx, mirrorPeerCopy) + // MirrorPeer.Spec.Items must be unique + if err := uniqueSpecItems(mirrorPeer.Spec); err != nil { + return ctrl.Result{}, fmt.Errorf("MirrorPeer spec items are not unique: %w", err) + } - if err != nil { - logger.Error("Failed to update mirrorpeer with disaster recovery label", "error", err) - return checkK8sUpdateErrors(err, mirrorPeerCopy, logger) + for i := range mirrorPeer.Spec.Items { + // MirrorPeer.Spec.Items must not have empty fields + if err := emptySpecItems(mirrorPeer.Spec.Items[i]); err != nil { + + return ctrl.Result{}, fmt.Errorf("MirrorPeer spec items have empty fields: %w", err) + } + + // MirrorPeer.Spec.Items[*].ClusterName must be a valid ManagedCluster + if err := isManagedCluster(ctx, r.Client, mirrorPeer.Spec.Items[i].ClusterName); err != nil { + return ctrl.Result{}, fmt.Errorf("invalid ManagedCluster: %w", err) } - logger.Info("Successfully added label to mirrorpeer for disaster recovery. Requeing request...") - return ctrl.Result{Requeue: true}, nil } + logger.Info("All validations for MirrorPeer passed") + return ctrl.Result{}, nil +} + +func (r *MirrorPeerReconciler) UpdateMirrorPeerPhase(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) + if mirrorPeer.Status.Phase == "" { if mirrorPeer.Spec.Type == multiclusterv1alpha1.Async { mirrorPeer.Status.Phase = multiclusterv1alpha1.ExchangingSecret @@ -183,69 +170,89 @@ func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request) } statusErr := r.Client.Status().Update(ctx, &mirrorPeer) if statusErr != nil { - logger.Error("Error occurred while updating the status of mirrorpeer. Requeing request...", "Error ", statusErr) + logger.Error("Error occurred while updating the status of mirrorpeer. Requeuing request...", "Error", statusErr) // Requeue, but don't throw return ctrl.Result{Requeue: true}, nil } } - if err := r.processManagedClusterAddon(ctx, mirrorPeer); err != nil { - logger.Error("Failed to process managedclusteraddon", "error", err) - return ctrl.Result{}, err - } + return ctrl.Result{}, nil +} - err = r.createClusterRoleBindingsForSpoke(ctx, mirrorPeer) - if err != nil { - logger.Error("Failed to create cluster role bindings for spoke", "error", err) - return ctrl.Result{}, err +func (r *MirrorPeerReconciler) AddLabels(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) + + if mirrorPeer.Labels == nil { + mirrorPeer.Labels = make(map[string]string) } - // update s3 profile when MirrorPeer changes - if mirrorPeer.Spec.ManageS3 { - for _, peerRef := range mirrorPeer.Spec.Items { - var s3Secret corev1.Secret - namespacedName := types.NamespacedName{ - Name: utils.GetSecretNameByPeerRef(peerRef, utils.S3ProfilePrefix), - Namespace: peerRef.ClusterName, - } - err = r.Client.Get(ctx, namespacedName, &s3Secret) - if err != nil { - if k8serrors.IsNotFound(err) { - logger.Info("S3 secret is not yet synchronised. retrying till it is available. Requeing request...", "Cluster", peerRef.ClusterName) - return ctrl.Result{Requeue: true}, nil - } - logger.Error("Error in fetching s3 internal secret", "Cluster", peerRef.ClusterName, "error", err) - return ctrl.Result{}, err - } - err = createOrUpdateSecretsFromInternalSecret(ctx, r.Client, &s3Secret, []multiclusterv1alpha1.MirrorPeer{mirrorPeer}, logger) - if err != nil { - logger.Error("Error in updating S3 profile", "Cluster", peerRef.ClusterName, "error", err) - return ctrl.Result{}, err + if val, ok := mirrorPeer.Labels[utils.HubRecoveryLabel]; !ok || val != "resource" { + logger.Info("Adding label to mirrorpeer for disaster recovery") + mirrorPeer.Labels[utils.HubRecoveryLabel] = "resource" + err := r.Client.Update(ctx, &mirrorPeer) + if err != nil { + if k8serrors.IsConflict(err) { + logger.Info("Failed to update MirrorPeer as object is being updated. Requeing to reconcile again") + return ctrl.Result{Requeue: true}, nil } + logger.Error("Failed to update MirrorPeer with disaster recovery label", "error", err) + return ctrl.Result{}, err } + logger.Info("Successfully added label to mirrorpeer for disaster recovery. Requeuing request...") + return ctrl.Result{Requeue: true}, nil } - if err = r.processMirrorPeerSecretChanges(ctx, r.Client, mirrorPeer); err != nil { - logger.Error("Error processing MirrorPeer secret changes", "error", err) - return ctrl.Result{}, err - } + return ctrl.Result{}, nil +} - err = r.createDRClusters(ctx, &mirrorPeer) +func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", req.NamespacedName.String()) + logger.Info("Reconciling request") + // Fetch MirrorPeer for given Request + var mirrorPeer multiclusterv1alpha1.MirrorPeer + err := r.Get(ctx, req.NamespacedName, &mirrorPeer) if err != nil { if k8serrors.IsNotFound(err) { - logger.Info("Secret not synchronised yet, retrying to create DRCluster", "MirrorPeer", mirrorPeer.Name) - return ctrl.Result{Requeue: true}, nil + // Request object not found, could have been deleted after reconcile request. + // Owned objects are automatically garbage collected. For additional cleanup logic use finalizers. + // Return and don't requeue + logger.Info("Could not find MirrorPeer. Ignoring since object must have been deleted") + return ctrl.Result{}, nil } - logger.Error("Failed to create DRClusters for MirrorPeer", "error", err) + // Error reading the object - requeue the request. + logger.Error("Failed to get MirrorPeer", "error", err) return ctrl.Result{}, err } - return r.updateMirrorPeerStatus(ctx, mirrorPeer) + tasks := []MirrorPeerReconcileTask{ + r.ValidateMirrorPeer, + r.processMirrorPeerDeletion, + r.AddLabels, + r.UpdateMirrorPeerPhase, + r.processManagedClusterAddon, + r.createClusterRoleBindingsForSpoke, + r.processMirrorPeerSecretChanges, + r.createDRClusters, + r.updateMirrorPeerStatus, + } + + mirrorPeerCopy := mirrorPeer.DeepCopy() + for _, task := range tasks { + result, err := task(ctx, *mirrorPeerCopy) + if err != nil { + return result, err + } + if result.Requeue || result.RequeueAfter > 0 { + return result, nil + } + } + + return ctrl.Result{}, nil } // processManagedClusterAddon creates an addon for the cluster management in all the peer refs, // the resources gets an owner ref of the mirrorpeer to let the garbage collector handle it if the mirrorpeer gets deleted -func (r *MirrorPeerReconciler) processManagedClusterAddon(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) error { +func (r *MirrorPeerReconciler) processManagedClusterAddon(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) logger.Info("Processing ManagedClusterAddons for MirrorPeer") @@ -286,14 +293,14 @@ func (r *MirrorPeerReconciler) processManagedClusterAddon(ctx context.Context, m if err != nil { logger.Error("Failed to reconcile ManagedClusterAddOn", "ManagedClusterAddOn", klog.KRef(managedClusterAddOn.Namespace, managedClusterAddOn.Name), "error", err) - return err + return ctrl.Result{}, err } logger.Info("Successfully reconciled ManagedClusterAddOn", "ClusterName", item.ClusterName) } logger.Info("Successfully processed all ManagedClusterAddons for MirrorPeer") - return nil + return ctrl.Result{}, nil } // deleteSecrets checks if another mirrorpeer is using a peer ref in the mirrorpeer being deleted, if not then it @@ -350,11 +357,12 @@ func (r *MirrorPeerReconciler) deleteSecrets(ctx context.Context, mirrorPeer mul return nil } -func (r *MirrorPeerReconciler) processMirrorPeerSecretChanges(ctx context.Context, rc client.Client, mirrorPeerObj multiclusterv1alpha1.MirrorPeer) error { - logger := r.Logger - logger.Info("Processing mirror peer secret changes", "MirrorPeer", mirrorPeerObj.Name) +func (r *MirrorPeerReconciler) processMirrorPeerSecretChanges(ctx context.Context, mirrorPeerObj multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeer", mirrorPeerObj.Name) + logger.Info("Processing mirror peer secret changes") var anyErr error + rc := r.Client for _, eachPeerRef := range mirrorPeerObj.Spec.Items { logger.Info("Fetching all source secrets", "ClusterName", eachPeerRef.ClusterName) @@ -388,11 +396,11 @@ func (r *MirrorPeerReconciler) processMirrorPeerSecretChanges(ctx context.Contex logger.Info("Errors encountered in updating secrets; skipping cleanup") } - return anyErr + return ctrl.Result{}, anyErr } func (r *MirrorPeerReconciler) checkTokenExchangeStatus(ctx context.Context, mp multiclusterv1alpha1.MirrorPeer) (bool, error) { - logger := r.Logger + logger := r.Logger.With("MirrorPeer", mp.Name) logger.Info("Checking token exchange status for MirrorPeer", "MirrorPeer", mp.Name) @@ -501,24 +509,8 @@ func (r *MirrorPeerReconciler) SetupWithManager(mgr ctrl.Manager) error { } -// CheckK8sUpdateErrors checks what type of error occurs when trying to update a k8s object -// and logs according to the object -func checkK8sUpdateErrors(err error, obj client.Object, logger *slog.Logger) (ctrl.Result, error) { - if k8serrors.IsConflict(err) { - logger.Info("Object is being updated by another process. Retrying", "Kind", obj.GetObjectKind().GroupVersionKind().Kind, "Name", obj.GetName()) - return ctrl.Result{Requeue: true}, nil - } else if k8serrors.IsNotFound(err) { - logger.Info("Object no longer exists. Ignoring since object must have been deleted", "Kind", obj.GetObjectKind().GroupVersionKind().Kind, "Name", obj.GetName()) - return ctrl.Result{}, nil - } else if err != nil { - logger.Error("Failed to update object", "error", err, "Name", obj.GetName()) - return ctrl.Result{}, err - } - return ctrl.Result{}, nil -} - -func (r *MirrorPeerReconciler) createDRClusters(ctx context.Context, mp *multiclusterv1alpha1.MirrorPeer) error { - logger := r.Logger +func (r *MirrorPeerReconciler) createDRClusters(ctx context.Context, mp multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeerzName", mp.Name) currentNamespace := os.Getenv("POD_NAMESPACE") for _, pr := range mp.Spec.Items { @@ -536,27 +528,35 @@ func (r *MirrorPeerReconciler) createDRClusters(ctx context.Context, mp *multicl logger.Info("Fetching rook secret ", "Secret", rookSecretName) hs, err := utils.FetchSecretWithName(ctx, r.Client, types.NamespacedName{Name: rookSecretName, Namespace: currentNamespace}) if err != nil { + if k8serrors.IsNotFound(err) { + logger.Info("Secret not synchronised yet, retrying to create DRCluster", "MirrorPeer", mp.Name) + return ctrl.Result{Requeue: true}, nil + } logger.Error("Failed to fetch Rook secret", "error", err, "SecretName", rookSecretName, "Namespace", currentNamespace) - return err + return ctrl.Result{}, err } logger.Info("Unmarshalling rook secret ", "Secret Name:", rookSecretName) rt, err := utils.UnmarshalRookSecretExternal(hs) if err != nil { logger.Error("Failed to unmarshal Rook secret", "error", err, "SecretName", rookSecretName) - return err + return ctrl.Result{}, err } fsid = rt.FSID } else { logger.Info("Fetching rook secret ", "Secret Name:", rookSecretName) hs, err := utils.FetchSecretWithName(ctx, r.Client, types.NamespacedName{Name: rookSecretName, Namespace: clusterName}) if err != nil { - return err + if k8serrors.IsNotFound(err) { + logger.Info("Secret not synchronised yet, retrying to create DRCluster", "MirrorPeer", mp.Name) + return ctrl.Result{Requeue: true}, nil + } + return ctrl.Result{}, err } logger.Info("Unmarshalling rook secret ", "Secret Name:", rookSecretName) rt, err := utils.UnmarshalHubSecret(hs) if err != nil { logger.Error("Failed to unmarshal Hub secret", "error", err, "SecretName", rookSecretName) - return err + return ctrl.Result{}, err } fsid = rt.FSID } @@ -566,14 +566,14 @@ func (r *MirrorPeerReconciler) createDRClusters(ctx context.Context, mp *multicl ss, err := utils.FetchSecretWithName(ctx, r.Client, types.NamespacedName{Name: s3SecretName, Namespace: clusterName}) if err != nil { logger.Error("Failed to fetch S3 secret", "error", err, "SecretName", s3SecretName, "Namespace", clusterName) - return err + return ctrl.Result{}, err } logger.Info("Unmarshalling S3 secret", "SecretName", s3SecretName) st, err := utils.UnmarshalS3Secret(ss) if err != nil { logger.Error("Failed to unmarshal S3 secret", "error", err, "SecretName", s3SecretName) - return err + return ctrl.Result{}, err } logger.Info("Creating and updating DR clusters", "ClusterName", clusterName) @@ -583,22 +583,22 @@ func (r *MirrorPeerReconciler) createDRClusters(ctx context.Context, mp *multicl }) if err != nil { logger.Error("Failed to create/update DR cluster", "error", err, "ClusterName", clusterName) - return err + return ctrl.Result{}, err } } - return nil + return ctrl.Result{}, nil } -func (r *MirrorPeerReconciler) createClusterRoleBindingsForSpoke(ctx context.Context, peer multiclusterv1alpha1.MirrorPeer) error { - logger := r.Logger - logger.Info("Starting to create or update ClusterRoleBindings for the spoke", "MirrorPeerName", peer.Name) +func (r *MirrorPeerReconciler) createClusterRoleBindingsForSpoke(ctx context.Context, peer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { + logger := r.Logger.With("MirrorPeerName", peer.Name) + logger.Info("Starting to create or update ClusterRoleBindings for the spoke") crb := rbacv1.ClusterRoleBinding{} err := r.Client.Get(ctx, types.NamespacedName{Name: spokeClusterRoleBindingName}, &crb) if err != nil { if !k8serrors.IsNotFound(err) { logger.Error("Failed to get ClusterRoleBinding", "error", err, "ClusterRoleBindingName", spokeClusterRoleBindingName) - return err + return ctrl.Result{}, err } logger.Info("ClusterRoleBinding not found, will be created", "ClusterRoleBindingName", spokeClusterRoleBindingName) } @@ -646,28 +646,34 @@ func (r *MirrorPeerReconciler) createClusterRoleBindingsForSpoke(ctx context.Con if err != nil { logger.Error("Failed to create or update ClusterRoleBinding", "error", err, "ClusterRoleBindingName", spokeClusterRoleBindingName) - return err + return ctrl.Result{}, err } logger.Info("Successfully created or updated ClusterRoleBinding", "ClusterRoleBindingName", spokeClusterRoleBindingName) - return nil + return ctrl.Result{}, nil } func (r *MirrorPeerReconciler) updateMirrorPeerStatus(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer) (ctrl.Result, error) { - logger := r.Logger + logger := r.Logger.With("MirrorPeer", mirrorPeer.Name) if mirrorPeer.Spec.Type == multiclusterv1alpha1.Async { tokensExchanged, err := r.checkTokenExchangeStatus(ctx, mirrorPeer) if err != nil { + if k8serrors.IsConflict(err) { + logger.Info("Object is being updated by another process. Retrying") + return ctrl.Result{Requeue: true}, nil + } + if k8serrors.IsNotFound(err) { - logger.Info("Secrets not found; Attempting to reconcile again", "MirrorPeer", mirrorPeer.Name) + logger.Info("Secrets not found; Attempting to reconcile again") return ctrl.Result{Requeue: true}, nil } - logger.Error("Error while exchanging tokens", "error", err, "MirrorPeer", mirrorPeer.Name) + + logger.Error("Error while exchanging tokens", "error", err) mirrorPeer.Status.Message = err.Error() statusErr := r.Client.Status().Update(ctx, &mirrorPeer) if statusErr != nil { - logger.Error("Error occurred while updating the status of mirrorpeer", "error", statusErr, "MirrorPeer", mirrorPeer.Name) + logger.Error("Error occurred while updating the status of mirrorpeer", "error", statusErr) } return ctrl.Result{}, err } @@ -678,7 +684,7 @@ func (r *MirrorPeerReconciler) updateMirrorPeerStatus(ctx context.Context, mirro mirrorPeer.Status.Message = "" statusErr := r.Client.Status().Update(ctx, &mirrorPeer) if statusErr != nil { - logger.Error("Error occurred while updating the status of mirrorpeer", "error", statusErr, "MirrorPeer", mirrorPeer.Name) + logger.Error("Error occurred while updating the status of mirrorpeer", "error", statusErr) return ctrl.Result{Requeue: true}, nil } return ctrl.Result{}, nil diff --git a/controllers/mirrorpeer_controller_test.go b/controllers/mirrorpeer_controller_test.go index 8f95a834..bf1470d0 100644 --- a/controllers/mirrorpeer_controller_test.go +++ b/controllers/mirrorpeer_controller_test.go @@ -63,20 +63,33 @@ func TestMirrorPeerReconcilerReconcile(t *testing.T) { r := getFakeMirrorPeerReconciler(mirrorpeer) - ctx := context.TODO() - req := ctrl.Request{ - NamespacedName: types.NamespacedName{ - Name: "mirrorpeer", - }, - } + requeue := false + var ctx context.Context + var req ctrl.Request + i := 0 + for { + ctx = context.TODO() + req = ctrl.Request{ + NamespacedName: types.NamespacedName{ + Name: "mirrorpeer", + }, + } + result, err := r.Reconcile(ctx, req) + if err != nil { + t.Errorf("MirrorPeerReconciler Reconcile() failed. Error: %s", err) + } - _, err := r.Reconcile(ctx, req) - if err != nil { - t.Errorf("MirrorPeerReconciler Reconcile() failed. Error: %s", err) + requeue = result.Requeue + // The loop is required as updates fail due to conflict and request is requeued. + // 50 tries is the arbitrary number i've set to break from the loop and fail the test. To avoid running forever! + if !requeue || i == 50 { + break + } + i++ } var mp multiclusterv1alpha1.MirrorPeer - err = r.Get(ctx, req.NamespacedName, &mp) + err := r.Get(ctx, req.NamespacedName, &mp) if err != nil { t.Errorf("Failed to get MirrorPeer. Error: %s", err) } @@ -144,7 +157,7 @@ func TestProcessManagedClusterAddons(t *testing.T) { // Create fake k8s client r := getFakeMirrorPeerReconciler(mirrorpeer) // Create fake secrets somehow - if err := r.processManagedClusterAddon(ctx, mirrorpeer); err != nil { + if _, err := r.processManagedClusterAddon(ctx, mirrorpeer); err != nil { t.Error("Failed to create managed cluster addon") }