From 952fba8a61b01d10c6be4b5f2cb3c2c4e39e18f3 Mon Sep 17 00:00:00 2001 From: Jian Zhu Date: Thu, 17 Oct 2024 14:16:23 +0800 Subject: [PATCH 1/9] Merge manager and agent to one binary (#121) Signed-off-by: zhujian --- .github/workflows/go-postsubmit.yml | 4 +- .github/workflows/go-presubmit.yml | 2 +- .github/workflows/go-release.yml | 2 +- Dockerfile | 8 +- Makefile | 9 +- .../templates/addontemplate.yaml | 3 +- .../templates/manager-deployment.yaml | 3 +- cmd/agent/{main.go => agent.go} | 96 ++++++++++------ cmd/main.go | 41 +++++++ cmd/manager/{main.go => manager.go} | 105 ++++++++++++------ go.mod | 6 +- .../manifests/templates/deployment.yaml | 3 +- 12 files changed, 191 insertions(+), 91 deletions(-) rename cmd/agent/{main.go => agent.go} (76%) create mode 100644 cmd/main.go rename cmd/manager/{main.go => manager.go} (75%) diff --git a/.github/workflows/go-postsubmit.yml b/.github/workflows/go-postsubmit.yml index f9b5d40..372a0c0 100644 --- a/.github/workflows/go-postsubmit.yml +++ b/.github/workflows/go-postsubmit.yml @@ -9,7 +9,7 @@ on: env: # Common versions - GO_VERSION: '1.21' + GO_VERSION: '1.22' GO_REQUIRED_MIN_VERSION: '' GOPATH: '/home/runner/work/managed-serviceaccount/managed-serviceaccount/go' @@ -71,4 +71,4 @@ jobs: quay.io/open-cluster-management/managed-serviceaccount:latest-arm64 --arch arm64 - name: push run: | - docker manifest push quay.io/open-cluster-management/managed-serviceaccount:latest \ No newline at end of file + docker manifest push quay.io/open-cluster-management/managed-serviceaccount:latest diff --git a/.github/workflows/go-presubmit.yml b/.github/workflows/go-presubmit.yml index a820504..1cb44ee 100644 --- a/.github/workflows/go-presubmit.yml +++ b/.github/workflows/go-presubmit.yml @@ -13,7 +13,7 @@ on: env: # Common versions - GO_VERSION: '1.21' + GO_VERSION: '1.22' GO_REQUIRED_MIN_VERSION: '' jobs: diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index 832a322..adecbda 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -6,7 +6,7 @@ on: - 'v*.*.*' env: # Common versions - GO_VERSION: '1.21' + GO_VERSION: '1.22' GO_REQUIRED_MIN_VERSION: '' GITHUB_REF: ${{ github.ref }} CHART_NAME: managed-serviceaccount diff --git a/Dockerfile b/Dockerfile index 10b634b..c7a02ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,8 @@ -FROM golang:1.21-bullseye AS builder +FROM golang:1.22-bullseye AS builder WORKDIR /go/src/github.com/open-cluster-management.io/managed-serviceaccount COPY . . RUN go env -RUN make build-manager -RUN make build-agent +RUN make build-bin FROM registry.access.redhat.com/ubi8/ubi-minimal:latest -COPY --from=builder /go/src/github.com/open-cluster-management.io/managed-serviceaccount/bin/manager / -COPY --from=builder /go/src/github.com/open-cluster-management.io/managed-serviceaccount/bin/agent / +COPY --from=builder /go/src/github.com/open-cluster-management.io/managed-serviceaccount/bin/msa / diff --git a/Makefile b/Makefile index 1f3ac5d..6bf2bc1 100644 --- a/Makefile +++ b/Makefile @@ -63,13 +63,10 @@ test: manifests generate fmt vet ## Run tests. ##@ Build -build: generate fmt vet build-manager build-agent +build: generate fmt vet build-bin -build-manager: - go build -a -o bin/manager cmd/manager/main.go - -build-agent: - go build -a -o bin/agent cmd/agent/main.go +build-bin: + go build -a -o bin/msa cmd/main.go build-e2e: go test -c -o bin/e2e ./e2e/ diff --git a/charts/managed-serviceaccount/templates/addontemplate.yaml b/charts/managed-serviceaccount/templates/addontemplate.yaml index 2896c26..d4d67a9 100644 --- a/charts/managed-serviceaccount/templates/addontemplate.yaml +++ b/charts/managed-serviceaccount/templates/addontemplate.yaml @@ -65,7 +65,8 @@ spec: - --kubeconfig={{ "{{" }}HUB_KUBECONFIG{{ "}}" }} # escape double curly brackets, option 2 - --feature-gates=EphemeralIdentity=true command: - - /agent + - /msa + - agent image: {{ .Values.image }}:{{ .Values.tag | default (print "v" .Chart.Version) }} imagePullPolicy: IfNotPresent livenessProbe: diff --git a/charts/managed-serviceaccount/templates/manager-deployment.yaml b/charts/managed-serviceaccount/templates/manager-deployment.yaml index 3e37f2a..235d65a 100644 --- a/charts/managed-serviceaccount/templates/manager-deployment.yaml +++ b/charts/managed-serviceaccount/templates/manager-deployment.yaml @@ -20,7 +20,8 @@ spec: image: {{ .Values.image }}:{{ .Values.tag | default (print "v" .Chart.Version) }} imagePullPolicy: IfNotPresent command: - - /manager + - /msa + - manager args: {{- if gt (int .Values.replicas) 1 }} - --leader-elect=true diff --git a/cmd/agent/main.go b/cmd/agent/agent.go similarity index 76% rename from cmd/agent/main.go rename to cmd/agent/agent.go index d5b2020..d67332e 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/agent.go @@ -1,4 +1,4 @@ -package main +package agent import ( "context" @@ -9,6 +9,8 @@ import ( "strings" "time" + "github.com/spf13/cobra" + "github.com/spf13/pflag" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -19,7 +21,6 @@ import ( "k8s.io/client-go/tools/clientcmd" cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" - "k8s.io/klog/v2/klogr" addonutils "open-cluster-management.io/addon-framework/pkg/utils" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" @@ -45,48 +46,76 @@ func init() { utilruntime.Must(authv1beta1.AddToScheme(scheme)) } -func main() { +func NewAgent() *cobra.Command { + agentOpts := NewAgentOptions() - var metricsAddr string - var enableLeaderElection bool - var probeAddr string - var clusterName string - var spokeKubeconfig string - var featureGatesFlags map[string]bool - var leaseHealthCheck bool + cmd := &cobra.Command{ + Use: "agent", + Short: "Start the managed service account addon agent", + Run: func(cmd *cobra.Command, args []string) { + if err := agentOpts.Run(); err != nil { + klog.Fatal(err) + } + }, + } - logger := klogr.New() - klog.SetOutput(os.Stdout) - klog.InitFlags(flag.CommandLine) - flag.StringVar(&metricsAddr, "metrics-bind-address", ":38080", "The address the metric endpoint binds to.") - flag.StringVar(&probeAddr, "health-probe-bind-address", ":38081", "The address the probe endpoint binds to.") - flag.BoolVar(&enableLeaderElection, "leader-elect", false, + flags := cmd.Flags() + agentOpts.AddFlags(flags) + + return cmd +} + +func (o *AgentOptions) AddFlags(flags *pflag.FlagSet) { + flags.StringVar(&o.MetricsAddr, "metrics-bind-address", ":38080", "The address the metric endpoint binds to.") + flags.StringVar(&o.ProbeAddr, "health-probe-bind-address", ":38081", "The address the probe endpoint binds to.") + flags.BoolVar(&o.EnableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") - flag.StringVar(&clusterName, "cluster-name", "", "The name of the managed cluster.") - flag.StringVar(&spokeKubeconfig, "spoke-kubeconfig", "", "The kubeconfig to talk to the managed cluster, "+ + flags.StringVar(&o.ClusterName, "cluster-name", "", "The name of the managed cluster.") + flags.StringVar(&o.SpokeKubeconfig, "spoke-kubeconfig", "", "The kubeconfig to talk to the managed cluster, "+ "will use the in-cluster client if not specified.") - flag.Var( - cliflag.NewMapStringBool(&featureGatesFlags), + flags.Var( + cliflag.NewMapStringBool(&o.FeatureGatesFlags), "feature-gates", "A set of key=value pairs that describe feature gates for alpha/experimental features. "+ "Options are:\n"+strings.Join(features.FeatureGates.KnownFeatures(), "\n")) - flag.BoolVar(&leaseHealthCheck, "lease-health-check", false, "Use lease to report health check.") - flag.Parse() + flags.BoolVar(&o.LeaseHealthCheck, "lease-health-check", false, "Use lease to report health check.") +} + +// AgentOptions holds configuration for agent controller +type AgentOptions struct { + MetricsAddr string + EnableLeaderElection bool + ProbeAddr string + FeatureGatesFlags map[string]bool + ClusterName string + SpokeKubeconfig string + LeaseHealthCheck bool +} + +// NewAgentOptions returns an AgentOptions +func NewAgentOptions() *AgentOptions { + return &AgentOptions{} +} + +func (o *AgentOptions) Run() error { + logger := klog.Background() + klog.SetOutput(os.Stdout) + klog.InitFlags(flag.CommandLine) ctrl.SetLogger(logger) - err := features.FeatureGates.SetFromMap(featureGatesFlags) + err := features.FeatureGates.SetFromMap(o.FeatureGatesFlags) if err != nil { klog.Fatalf("unable to set featuregates map: %v", err) } - if len(clusterName) == 0 { + if len(o.ClusterName) == 0 { klog.Fatal("missing --cluster-name") } var spokeCfg *rest.Config - if len(spokeKubeconfig) > 0 { - spokeCfg, err = clientcmd.BuildConfigFromFlags("", spokeKubeconfig) + if len(o.SpokeKubeconfig) > 0 { + spokeCfg, err = clientcmd.BuildConfigFromFlags("", o.SpokeKubeconfig) if err != nil { klog.Fatal("failed to build a spoke cluster client config from --spoke-kubeconfig") } @@ -99,15 +128,15 @@ func main() { mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, - Metrics: metricsserver.Options{BindAddress: metricsAddr}, - HealthProbeBindAddress: probeAddr, - LeaderElection: enableLeaderElection, + Metrics: metricsserver.Options{BindAddress: o.MetricsAddr}, + HealthProbeBindAddress: o.ProbeAddr, + LeaderElection: o.EnableLeaderElection, LeaderElectionID: "managed-serviceaccount-addon-agent", LeaderElectionConfig: spokeCfg, Cache: cache.Options{ // Only watch resources in the managed cluster namespace on the hub cluster. DefaultNamespaces: map[string]cache.Config{ - clusterName: {}, + o.ClusterName: {}, }, }, }) @@ -189,7 +218,7 @@ func main() { SpokeNamespace: spokeNamespace, SpokeClientConfig: spokeCfg, SpokeNativeClient: spokeNativeClient, - ClusterName: clusterName, + ClusterName: o.ClusterName, SpokeCache: spokeCache, CreateTokenByDefaultSecret: !foundTokenRequest, }).SetupWithManager(mgr); err != nil { @@ -199,8 +228,8 @@ func main() { ctx, cancel := context.WithCancel(ctrl.SetupSignalHandler()) defer cancel() - if leaseHealthCheck { - leaseUpdater, err := health.NewAddonHealthUpdater(mgr.GetConfig(), clusterName, spokeCfg, spokeNamespace) + if o.LeaseHealthCheck { + leaseUpdater, err := health.NewAddonHealthUpdater(mgr.GetConfig(), o.ClusterName, spokeCfg, spokeNamespace) if err != nil { klog.Fatalf("unable to create healthiness lease updater for controller %v", "ManagedServiceAccount") } @@ -221,6 +250,7 @@ func main() { klog.Fatalf("unable to start controller manager: %v", err) } + return nil } // serveHealthProbes serves health probes and configchecker. diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 0000000..6b244de --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,41 @@ +package main + +import ( + goflag "flag" + "fmt" + "os" + + "github.com/spf13/cobra" + "github.com/spf13/pflag" + utilflag "k8s.io/component-base/cli/flag" + + "open-cluster-management.io/managed-serviceaccount/cmd/agent" + hub "open-cluster-management.io/managed-serviceaccount/cmd/manager" +) + +func main() { + pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc) + pflag.CommandLine.AddGoFlagSet(goflag.CommandLine) + + command := newCommand() + if err := command.Execute(); err != nil { + fmt.Fprintf(os.Stderr, "%v\n", err) + os.Exit(1) + } +} + +func newCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "managed service account", + Short: "msa", + Run: func(cmd *cobra.Command, args []string) { + _ = cmd.Help() + os.Exit(1) + }, + } + + cmd.AddCommand(hub.NewManager()) + cmd.AddCommand(agent.NewAgent()) + + return cmd +} diff --git a/cmd/manager/main.go b/cmd/manager/manager.go similarity index 75% rename from cmd/manager/main.go rename to cmd/manager/manager.go index 7f3525f..d95bb5a 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/manager.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main +package manager import ( "context" @@ -25,8 +25,8 @@ import ( // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) // to ensure that exec-entrypoint and run can make use of them. "github.com/pkg/errors" - _ "k8s.io/client-go/plugin/pkg/client/auth" - + "github.com/spf13/cobra" + "github.com/spf13/pflag" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -34,6 +34,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + _ "k8s.io/client-go/plugin/pkg/client/auth" cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "open-cluster-management.io/addon-framework/pkg/addonfactory" @@ -41,14 +42,15 @@ import ( "open-cluster-management.io/addon-framework/pkg/agent" "open-cluster-management.io/addon-framework/pkg/utils" addonclient "open-cluster-management.io/api/client/addon/clientset/versioned" + ctrl "sigs.k8s.io/controller-runtime" + metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" + authv1beta1 "open-cluster-management.io/managed-serviceaccount/apis/authentication/v1beta1" "open-cluster-management.io/managed-serviceaccount/pkg/addon/commoncontroller" "open-cluster-management.io/managed-serviceaccount/pkg/addon/manager" "open-cluster-management.io/managed-serviceaccount/pkg/common" "open-cluster-management.io/managed-serviceaccount/pkg/features" "open-cluster-management.io/managed-serviceaccount/pkg/util" - ctrl "sigs.k8s.io/controller-runtime" - metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" //+kubebuilder:scaffold:imports ) @@ -63,43 +65,71 @@ func init() { //+kubebuilder:scaffold:scheme } -func main() { - var metricsAddr string - var enableLeaderElection bool - var probeAddr string - var addonAgentImageName string - var agentInstallAll bool - var imagePullSecretName string - var featureGatesFlags map[string]bool +func NewManager() *cobra.Command { + managerOpts := NewHubManagerOptions() - logger := klog.Background() - klog.SetOutput(os.Stdout) - klog.InitFlags(flag.CommandLine) - flag.StringVar(&metricsAddr, "metrics-bind-address", ":38080", "The address the metric endpoint binds to.") - flag.StringVar(&probeAddr, "health-probe-bind-address", ":38081", "The address the probe endpoint binds to.") - flag.StringVar(&addonAgentImageName, "agent-image-name", "quay.io/open-cluster-management/managed-serviceaccount:latest", + cmd := &cobra.Command{ + Use: "manager", + Short: "Start the managed service account addon manager", + Run: func(cmd *cobra.Command, args []string) { + if err := managerOpts.Run(); err != nil { + klog.Fatal(err) + } + }, + } + + flags := cmd.Flags() + managerOpts.AddFlags(flags) + + return cmd +} + +func (o *HubManagerOptions) AddFlags(flags *pflag.FlagSet) { + flags.StringVar(&o.MetricsAddr, "metrics-bind-address", ":38080", "The address the metric endpoint binds to.") + flags.StringVar(&o.ProbeAddr, "health-probe-bind-address", ":38081", "The address the probe endpoint binds to.") + flags.StringVar(&o.AddonAgentImageName, "agent-image-name", "quay.io/open-cluster-management/managed-serviceaccount:latest", "The image name of the addon agent") - flag.BoolVar(&enableLeaderElection, "leader-elect", false, + flags.BoolVar(&o.EnableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") - flag.BoolVar( - &agentInstallAll, "agent-install-all", false, + flags.BoolVar( + &o.AgentInstallAll, "agent-install-all", false, "Configure the install strategy of agent on managed clusters. "+ "Enabling this will automatically install agent on all managed cluster.") - flag.Var( - cliflag.NewMapStringBool(&featureGatesFlags), + flags.Var( + cliflag.NewMapStringBool(&o.FeatureGatesFlags), "feature-gates", "A set of key=value pairs that describe feature gates for alpha/experimental features. "+ "Options are:\n"+strings.Join(features.FeatureGates.KnownFeatures(), "\n")) - flag.StringVar(&imagePullSecretName, "agent-image-pull-secret", "", + flags.StringVar(&o.ImagePullSecretName, "agent-image-pull-secret", "", "The image pull secret that addon agent will use. "+ "When specified, the content of image pull secret in the manager namespace on hub will be copied to the agent namespace on the managed cluster."+ "This can also be configured with environment variable AGENT_IMAGE_PULL_SECRET.") +} + +// HubManagerOptions holds configuration for hub manager controller +type HubManagerOptions struct { + MetricsAddr string + EnableLeaderElection bool + ProbeAddr string + AddonAgentImageName string + AgentInstallAll bool + ImagePullSecretName string + FeatureGatesFlags map[string]bool +} - flag.Parse() +// NewHubManagerOptions returns a HubManagerOptions +func NewHubManagerOptions() *HubManagerOptions { + return &HubManagerOptions{} +} +func (o *HubManagerOptions) Run() error { + logger := klog.Background() + klog.SetOutput(os.Stdout) + klog.InitFlags(flag.CommandLine) ctrl.SetLogger(logger) - err := features.FeatureGates.SetFromMap(featureGatesFlags) + + err := features.FeatureGates.SetFromMap(o.FeatureGatesFlags) if err != nil { setupLog.Error(err, "unable to set featuregates map") os.Exit(1) @@ -107,9 +137,9 @@ func main() { mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, - Metrics: metricsserver.Options{BindAddress: metricsAddr}, - HealthProbeBindAddress: probeAddr, - LeaderElection: enableLeaderElection, + Metrics: metricsserver.Options{BindAddress: o.MetricsAddr}, + HealthProbeBindAddress: o.ProbeAddr, + LeaderElection: o.EnableLeaderElection, LeaderElectionID: "managed-serviceaccount-addon-manager", }) if err != nil { @@ -154,15 +184,15 @@ func main() { hubNamespace = inClusterNamespace } - if len(imagePullSecretName) == 0 { - imagePullSecretName = os.Getenv("AGENT_IMAGE_PULL_SECRET") + if len(o.ImagePullSecretName) == 0 { + o.ImagePullSecretName = os.Getenv("AGENT_IMAGE_PULL_SECRET") } imagePullSecret := &corev1.Secret{} - if len(imagePullSecretName) != 0 { + if len(o.ImagePullSecretName) != 0 { imagePullSecret, err = nativeClient.CoreV1().Secrets(hubNamespace).Get( context.TODO(), - imagePullSecretName, + o.ImagePullSecretName, metav1.GetOptions{}, ) if err != nil { @@ -178,11 +208,11 @@ func main() { agentFactory := addonfactory.NewAgentAddonFactory(common.AddonName, manager.FS, "manifests/templates"). WithConfigGVRs(utils.AddOnDeploymentConfigGVR). WithGetValuesFuncs( - manager.GetDefaultValues(addonAgentImageName, imagePullSecret), + manager.GetDefaultValues(o.AddonAgentImageName, imagePullSecret), addonfactory.GetAgentImageValues( utils.NewAddOnDeploymentConfigGetter(addonClient), "Image", - addonAgentImageName, + o.AddonAgentImageName, ), addonfactory.GetAddOnDeploymentConfigValues( utils.NewAddOnDeploymentConfigGetter(addonClient), @@ -192,7 +222,7 @@ func main() { WithAgentRegistrationOption(manager.NewRegistrationOption(nativeClient)). WithAgentDeployTriggerClusterFilter(utils.ClusterImageRegistriesAnnotationChanged) - if agentInstallAll { + if o.AgentInstallAll { agentFactory.WithInstallStrategy(agent.InstallAllStrategy(common.AddonAgentInstallNamespace)) } @@ -231,4 +261,5 @@ func main() { setupLog.Error(err, "problem running manager") os.Exit(1) } + return nil } diff --git a/go.mod b/go.mod index 0b7ee65..ed91ae4 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,13 @@ module open-cluster-management.io/managed-serviceaccount -go 1.21 +go 1.22 require ( github.com/onsi/ginkgo/v2 v2.15.0 github.com/onsi/gomega v1.31.1 github.com/pkg/errors v0.9.1 + github.com/spf13/cobra v1.7.0 + github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 @@ -66,8 +68,6 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/cast v1.4.1 // indirect - github.com/spf13/cobra v1.7.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect diff --git a/pkg/addon/manager/manifests/templates/deployment.yaml b/pkg/addon/manager/manifests/templates/deployment.yaml index a694493..4c0ccaf 100644 --- a/pkg/addon/manager/manifests/templates/deployment.yaml +++ b/pkg/addon/manager/manifests/templates/deployment.yaml @@ -37,7 +37,8 @@ spec: image: {{ .Image }} imagePullPolicy: IfNotPresent command: - - /agent + - /msa + - agent args: - --leader-elect=false - --cluster-name={{ .ClusterName }} From aff9e3f9ce5ed9b48dbf2e7eba9c2d302d01436e Mon Sep 17 00:00:00 2001 From: Jian Zhu Date: Thu, 17 Oct 2024 17:27:21 +0800 Subject: [PATCH 2/9] :seedling: Add dependabot to auto update dependencies (#122) Signed-off-by: zhujian --- .github/dependabot.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..46dcaa0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 2 +updates: +- package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + commit-message: + prefix: ":seedling:" + open-pull-requests-limit: 3 +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: ":seedling:" + groups: + github-actions: + patterns: + - "*" + # These actions directly influence the build process and are excluded from grouped updates + exclude-patterns: + - "actions/setup-go" + - "arduino/setup-protoc" + - "goreleaser/goreleaser-action" From 004bed41bdbe4be4814f6d3ca46c6b2da9bd1678 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 01:56:51 +0000 Subject: [PATCH 3/9] :seedling: Bump the github-actions group with 7 updates (#124) Bumps the github-actions group with 7 updates: | Package | From | To | | --- | --- | --- | | [codecov/codecov-action](https://github.com/codecov/codecov-action) | `3` | `4` | | [helm/kind-action](https://github.com/helm/kind-action) | `1.2.0` | `1.10.0` | | [azure/setup-helm](https://github.com/azure/setup-helm) | `1` | `4` | | [softprops/action-gh-release](https://github.com/softprops/action-gh-release) | `1` | `2` | | [actions/github-script](https://github.com/actions/github-script) | `6` | `7` | | [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) | `6` | `7` | | [kubernetes-sigs/kubebuilder-release-tools](https://github.com/kubernetes-sigs/kubebuilder-release-tools) | `0.4.0` | `0.4.3` | Updates `codecov/codecov-action` from 3 to 4 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) Updates `helm/kind-action` from 1.2.0 to 1.10.0 - [Release notes](https://github.com/helm/kind-action/releases) - [Commits](https://github.com/helm/kind-action/compare/v1.2.0...v1.10.0) Updates `azure/setup-helm` from 1 to 4 - [Release notes](https://github.com/azure/setup-helm/releases) - [Changelog](https://github.com/Azure/setup-helm/blob/main/CHANGELOG.md) - [Commits](https://github.com/azure/setup-helm/compare/v1...v4) Updates `softprops/action-gh-release` from 1 to 2 - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2) Updates `actions/github-script` from 6 to 7 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v6...v7) Updates `peter-evans/create-pull-request` from 6 to 7 - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7) Updates `kubernetes-sigs/kubebuilder-release-tools` from 0.4.0 to 0.4.3 - [Release notes](https://github.com/kubernetes-sigs/kubebuilder-release-tools/releases) - [Changelog](https://github.com/kubernetes-sigs/kubebuilder-release-tools/blob/master/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/kubebuilder-release-tools/compare/v0.4.0...v0.4.3) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: helm/kind-action dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: azure/setup-helm dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/github-script dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: kubernetes-sigs/kubebuilder-release-tools dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/go-presubmit.yml | 6 +++--- .github/workflows/go-release.yml | 8 ++++---- .github/workflows/pr-verify.yml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go-presubmit.yml b/.github/workflows/go-presubmit.yml index 1cb44ee..80b319b 100644 --- a/.github/workflows/go-presubmit.yml +++ b/.github/workflows/go-presubmit.yml @@ -43,7 +43,7 @@ jobs: - name: unit run: make test - name: report coverage - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./cover.out flags: unit @@ -77,7 +77,7 @@ jobs: - name: Install clusteradm run: curl -L https://raw.githubusercontent.com/open-cluster-management-io/clusteradm/main/install.sh | bash - name: Create k8s Kind Cluster - uses: helm/kind-action@v1.2.0 + uses: helm/kind-action@v1.10.0 - name: Prepare OCM testing environment run: | clusteradm init --output-join-command-file join.sh --wait @@ -114,7 +114,7 @@ jobs: cd clusteradm make build - name: Create k8s Kind Cluster - uses: helm/kind-action@v1.2.0 + uses: helm/kind-action@v1.10.0 - name: Prepare OCM testing environment run: | clusteradm init --bundle-version='latest' --output-join-command-file join.sh --wait diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index adecbda..0cf95fa 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -95,7 +95,7 @@ jobs: with: fetch-depth: 1 - name: setup helm - uses: azure/setup-helm@v1 + uses: azure/setup-helm@v4 - name: chart package run: | mkdir -p release @@ -106,7 +106,7 @@ jobs: run: | echo "# Managed ServiceAccount ${{ needs.env.outputs.RELEASE_VERSION }}" > /home/runner/work/changelog.txt - name: publish release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -117,7 +117,7 @@ jobs: prerelease: false generate_release_notes: true - name: submit charts to OCM chart repo - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ secrets.OCM_BOT_PAT }} script: | @@ -190,7 +190,7 @@ jobs: - name: create pull request if: steps.update_chart_version.outputs.file_changed == 'true' && steps.check_pull_request.outputs.pr_exists != 'true' - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: # use OCM bot token to bypass "GitHub Actions is not permitted to create or approve pull requests." token: ${{ secrets.OCM_BOT_PAT }} diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index 26e0ee8..b672780 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -26,6 +26,6 @@ jobs: steps: - name: Verifier action id: verifier - uses: kubernetes-sigs/kubebuilder-release-tools@v0.4.0 + uses: kubernetes-sigs/kubebuilder-release-tools@v0.4.3 with: github_token: ${{ secrets.GITHUB_TOKEN }} From 026c4f192a975e6a4d3fc10957288bc4182b5e53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 01:59:36 +0000 Subject: [PATCH 4/9] :seedling: Bump actions/setup-go from 2 to 5 (#126) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v2...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/go-postsubmit.yml | 2 +- .github/workflows/go-presubmit.yml | 10 +++++----- .github/workflows/go-release.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go-postsubmit.yml b/.github/workflows/go-postsubmit.yml index 372a0c0..47f9308 100644 --- a/.github/workflows/go-postsubmit.yml +++ b/.github/workflows/go-postsubmit.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 1 path: go/src/open-cluster-management.io/managed-serviceaccount - name: install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: install imagebuilder diff --git a/.github/workflows/go-presubmit.yml b/.github/workflows/go-presubmit.yml index 80b319b..63a42de 100644 --- a/.github/workflows/go-presubmit.yml +++ b/.github/workflows/go-presubmit.yml @@ -24,7 +24,7 @@ jobs: - name: checkout code uses: actions/checkout@v4 - name: install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: build @@ -37,7 +37,7 @@ jobs: - name: checkout code uses: actions/checkout@v4 - name: install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: unit @@ -58,7 +58,7 @@ jobs: - name: checkout code uses: actions/checkout@v4 - name: install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: integration @@ -71,7 +71,7 @@ jobs: - name: checkout code uses: actions/checkout@v4 - name: install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Install clusteradm @@ -105,7 +105,7 @@ jobs: - name: checkout code uses: actions/checkout@v4 - name: install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Install clusteradm diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index 0cf95fa..cc64a27 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -45,7 +45,7 @@ jobs: with: fetch-depth: 1 - name: install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: install imagebuilder From c205cbc27363da4dde0078bee9b8809651747619 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 02:02:30 +0000 Subject: [PATCH 5/9] :seedling: Bump k8s.io/klog/v2 from 2.120.1 to 2.130.1 (#127) Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.120.1 to 2.130.1. - [Release notes](https://github.com/kubernetes/klog/releases) - [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes/klog/compare/v2.120.1...v2.130.1) --- updated-dependencies: - dependency-name: k8s.io/klog/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ed91ae4..af078bf 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 k8s.io/component-base v0.29.2 - k8s.io/klog/v2 v2.120.1 + k8s.io/klog/v2 v2.130.1 k8s.io/utils v0.0.0-20240102154912-e7106e64919e open-cluster-management.io/addon-framework v0.9.0 open-cluster-management.io/api v0.13.0 diff --git a/go.sum b/go.sum index 4dffe13..05640e6 100644 --- a/go.sum +++ b/go.sum @@ -268,8 +268,8 @@ k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= k8s.io/component-base v0.29.2 h1:lpiLyuvPA9yV1aQwGLENYyK7n/8t6l3nn3zAtFTJYe8= k8s.io/component-base v0.29.2/go.mod h1:BfB3SLrefbZXiBfbM+2H1dlat21Uewg/5qtKOl8degM= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= From f8a2381531cd281381521fa6eb70fad21afe8db5 Mon Sep 17 00:00:00 2001 From: xuezhao Date: Mon, 21 Oct 2024 18:51:01 +0800 Subject: [PATCH 6/9] Change coverage configuration. (#131) Signed-off-by: xuezhaojun --- .github/workflows/go-presubmit.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go-presubmit.yml b/.github/workflows/go-presubmit.yml index 63a42de..d0af7ef 100644 --- a/.github/workflows/go-presubmit.yml +++ b/.github/workflows/go-presubmit.yml @@ -45,11 +45,12 @@ jobs: - name: report coverage uses: codecov/codecov-action@v4 with: + token: ${{ secrets.CODECOV_UPLOAD_TOKEN }} files: ./cover.out flags: unit name: unit verbose: true - fail_ci_if_error: false + fail_ci_if_error: true integration: name: integration From 940d1dedfdd92b2688cd0b529ce6733d1776977b Mon Sep 17 00:00:00 2001 From: Jian Zhu Date: Mon, 21 Oct 2024 22:22:49 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=F0=9F=8C=B1=20Bump=20addon=20framework=20t?= =?UTF-8?q?o=200.11=20(#129)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :seedling: Bump addon framework to 0.11 Signed-off-by: zhujian * Use install strategy to install managedserviceaccount addon for all clusters Signed-off-by: zhujian --------- Signed-off-by: zhujian --- .../templates/clustermanagementaddon.yaml | 9 + .../templates/manager-deployment.yaml | 1 - .../templates/placement.yaml | 27 +++ cmd/manager/manager.go | 10 -- go.mod | 74 ++++----- go.sum | 155 +++++++++--------- pkg/addon/agent/controller/token.go | 2 +- pkg/common/constants.go | 5 +- pkg/controllers/event/secret_test.go | 3 +- pkg/controllers/event/serviceaccount.go | 38 ++--- pkg/controllers/event/serviceaccount_test.go | 3 +- 11 files changed, 174 insertions(+), 153 deletions(-) create mode 100644 charts/managed-serviceaccount/templates/placement.yaml diff --git a/charts/managed-serviceaccount/templates/clustermanagementaddon.yaml b/charts/managed-serviceaccount/templates/clustermanagementaddon.yaml index cc564fc..2d1bea5 100644 --- a/charts/managed-serviceaccount/templates/clustermanagementaddon.yaml +++ b/charts/managed-serviceaccount/templates/clustermanagementaddon.yaml @@ -10,6 +10,15 @@ spec: addOnMeta: displayName: managed-serviceaccount description: managed-serviceaccount +{{- if .Values.agentInstallAll }} + installStrategy: + placements: + - name: global + namespace: {{ .Release.Namespace }} + rolloutStrategy: + type: All + type: Placements +{{- end }} supportedConfigs: - group: addon.open-cluster-management.io resource: addondeploymentconfigs diff --git a/charts/managed-serviceaccount/templates/manager-deployment.yaml b/charts/managed-serviceaccount/templates/manager-deployment.yaml index 235d65a..1e031ef 100644 --- a/charts/managed-serviceaccount/templates/manager-deployment.yaml +++ b/charts/managed-serviceaccount/templates/manager-deployment.yaml @@ -27,7 +27,6 @@ spec: - --leader-elect=true {{- end }} - --agent-image-name={{ .Values.image }}:{{ .Values.tag | default (print "v" .Chart.Version) }} - - --agent-install-all={{ .Values.agentInstallAll }} {{- if .Values.featureGates }} - --feature-gates=EphemeralIdentity={{ .Values.featureGates.ephemeralIdentity | default false}} {{- end}} diff --git a/charts/managed-serviceaccount/templates/placement.yaml b/charts/managed-serviceaccount/templates/placement.yaml new file mode 100644 index 0000000..81779bc --- /dev/null +++ b/charts/managed-serviceaccount/templates/placement.yaml @@ -0,0 +1,27 @@ +{{- if .Values.agentInstallAll }} + +apiVersion: cluster.open-cluster-management.io/v1beta2 +kind: ManagedClusterSetBinding +metadata: + name: global + namespace: {{ .Release.Namespace }} +spec: + clusterSet: global + +--- + +apiVersion: cluster.open-cluster-management.io/v1beta1 +kind: Placement +metadata: + name: global + namespace: {{ .Release.Namespace }} +spec: + clusterSets: + - global + tolerations: + - key: cluster.open-cluster-management.io/unreachable + operator: Equal + - key: cluster.open-cluster-management.io/unavailable + operator: Equal + +{{- end }} diff --git a/cmd/manager/manager.go b/cmd/manager/manager.go index d95bb5a..241f193 100644 --- a/cmd/manager/manager.go +++ b/cmd/manager/manager.go @@ -39,7 +39,6 @@ import ( "k8s.io/klog/v2" "open-cluster-management.io/addon-framework/pkg/addonfactory" "open-cluster-management.io/addon-framework/pkg/addonmanager" - "open-cluster-management.io/addon-framework/pkg/agent" "open-cluster-management.io/addon-framework/pkg/utils" addonclient "open-cluster-management.io/api/client/addon/clientset/versioned" ctrl "sigs.k8s.io/controller-runtime" @@ -92,10 +91,6 @@ func (o *HubManagerOptions) AddFlags(flags *pflag.FlagSet) { flags.BoolVar(&o.EnableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") - flags.BoolVar( - &o.AgentInstallAll, "agent-install-all", false, - "Configure the install strategy of agent on managed clusters. "+ - "Enabling this will automatically install agent on all managed cluster.") flags.Var( cliflag.NewMapStringBool(&o.FeatureGatesFlags), "feature-gates", @@ -113,7 +108,6 @@ type HubManagerOptions struct { EnableLeaderElection bool ProbeAddr string AddonAgentImageName string - AgentInstallAll bool ImagePullSecretName string FeatureGatesFlags map[string]bool } @@ -222,10 +216,6 @@ func (o *HubManagerOptions) Run() error { WithAgentRegistrationOption(manager.NewRegistrationOption(nativeClient)). WithAgentDeployTriggerClusterFilter(utils.ClusterImageRegistriesAnnotationChanged) - if o.AgentInstallAll { - agentFactory.WithInstallStrategy(agent.InstallAllStrategy(common.AddonAgentInstallNamespace)) - } - agentAddOn, err := agentFactory.BuildTemplateAgentAddon() if err != nil { setupLog.Error(err, "failed to build agent") diff --git a/go.mod b/go.mod index af078bf..53bcc08 100644 --- a/go.mod +++ b/go.mod @@ -1,38 +1,38 @@ module open-cluster-management.io/managed-serviceaccount -go 1.22 +go 1.22.0 require ( - github.com/onsi/ginkgo/v2 v2.15.0 - github.com/onsi/gomega v1.31.1 + github.com/onsi/ginkgo/v2 v2.17.1 + github.com/onsi/gomega v1.32.0 github.com/pkg/errors v0.9.1 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 - k8s.io/api v0.29.2 - k8s.io/apimachinery v0.29.2 - k8s.io/client-go v0.29.2 - k8s.io/component-base v0.29.2 + k8s.io/api v0.30.2 + k8s.io/apimachinery v0.30.2 + k8s.io/client-go v0.30.2 + k8s.io/component-base v0.30.2 k8s.io/klog/v2 v2.130.1 - k8s.io/utils v0.0.0-20240102154912-e7106e64919e - open-cluster-management.io/addon-framework v0.9.0 - open-cluster-management.io/api v0.13.0 - sigs.k8s.io/controller-runtime v0.17.2 + k8s.io/utils v0.0.0-20240310230437-4693a0247e57 + open-cluster-management.io/addon-framework v0.11.0 + open-cluster-management.io/api v0.15.0 + sigs.k8s.io/controller-runtime v0.18.4 ) require ( - github.com/BurntSushi/toml v1.2.1 // indirect + github.com/BurntSushi/toml v1.3.2 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cyphar/filepath-securejoin v0.2.3 // indirect + github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/evanphx/json-patch v5.6.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.8.0 // indirect + github.com/evanphx/json-patch v5.7.0+incompatible // indirect + github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect @@ -43,14 +43,14 @@ require ( github.com/gobwas/glob v0.2.3 // 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-20210720184732-4bb14d4b1be1 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/huandu/xstrings v1.3.3 // indirect - github.com/imdario/mergo v0.3.12 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/huandu/xstrings v1.4.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 @@ -66,31 +66,31 @@ require ( github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/shopspring/decimal v1.2.0 // indirect - github.com/spf13/cast v1.4.1 // indirect - github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect + github.com/shopspring/decimal v1.3.1 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect + golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect golang.org/x/net v0.23.0 // indirect - golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/oauth2 v0.17.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.16.1 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.18.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - helm.sh/helm/v3 v3.11.1 // indirect - k8s.io/apiextensions-apiserver v0.29.0 // indirect - k8s.io/apiserver v0.29.0 // indirect - k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect - open-cluster-management.io/sdk-go v0.13.0 // indirect + helm.sh/helm/v3 v3.14.2 // indirect + k8s.io/apiextensions-apiserver v0.30.2 // indirect + k8s.io/apiserver v0.30.2 // indirect + k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect + open-cluster-management.io/sdk-go v0.15.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect diff --git a/go.sum b/go.sum index 05640e6..d933eae 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,10 @@ -github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +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/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -15,21 +16,23 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI= -github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= -github.com/evanphx/json-patch v5.6.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/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 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= +github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= @@ -50,10 +53,10 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -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.2/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/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -66,14 +69,15 @@ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= +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/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= +github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -110,12 +114,10 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -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/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= -github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= -github.com/openshift/library-go v0.0.0-20240116081341-964bcb3f545c h1:gLylEQQryG+A6nqWYIwE1wUzn1eFUmthjADvflMWKnM= -github.com/openshift/library-go v0.0.0-20240116081341-964bcb3f545c/go.mod h1:82B0gt8XawdXWRtKMrm3jSMTeRsiOSYKCi4F0fvPjG0= +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 v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= +github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -131,13 +133,14 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c 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/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -152,8 +155,9 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= 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/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= @@ -165,8 +169,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -174,13 +178,12 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= 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-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -189,8 +192,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= 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.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= +golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -204,41 +207,41 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -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/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 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.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -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/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -254,34 +257,34 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -helm.sh/helm/v3 v3.11.1 h1:cmL9fFohOoNQf+wnp2Wa0OhNFH0KFnSzEkVxi3fcc3I= -helm.sh/helm/v3 v3.11.1/go.mod h1:z/Bu/BylToGno/6dtNGuSmjRqxKq5gaH+FU0BPO+AQ8= -k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A= -k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0= -k8s.io/apiextensions-apiserver v0.29.0 h1:0VuspFG7Hj+SxyF/Z/2T0uFbI5gb5LRgEyUVE3Q4lV0= -k8s.io/apiextensions-apiserver v0.29.0/go.mod h1:TKmpy3bTS0mr9pylH0nOt/QzQRrW7/h7yLdRForMZwc= -k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= -k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= -k8s.io/apiserver v0.29.0 h1:Y1xEMjJkP+BIi0GSEv1BBrf1jLU9UPfAnnGGbbDdp7o= -k8s.io/apiserver v0.29.0/go.mod h1:31n78PsRKPmfpee7/l9NYEv67u6hOL6AfcE761HapDM= -k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= -k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= -k8s.io/component-base v0.29.2 h1:lpiLyuvPA9yV1aQwGLENYyK7n/8t6l3nn3zAtFTJYe8= -k8s.io/component-base v0.29.2/go.mod h1:BfB3SLrefbZXiBfbM+2H1dlat21Uewg/5qtKOl8degM= +helm.sh/helm/v3 v3.14.2 h1:V71fv+NGZv0icBlr+in1MJXuUIHCiPG1hW9gEBISTIA= +helm.sh/helm/v3 v3.14.2/go.mod h1:2itvvDv2WSZXTllknfQo6j7u3VVgMAvm8POCDgYH424= +k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= +k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= +k8s.io/apiextensions-apiserver v0.30.2 h1:l7Eue2t6QiLHErfn2vwK4KgF4NeDgjQkCXtEbOocKIE= +k8s.io/apiextensions-apiserver v0.30.2/go.mod h1:lsJFLYyK40iguuinsb3nt+Sj6CmodSI4ACDLep1rgjw= +k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= +k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/apiserver v0.30.2 h1:ACouHiYl1yFI2VFI3YGM+lvxgy6ir4yK2oLOsLI1/tw= +k8s.io/apiserver v0.30.2/go.mod h1:BOTdFBIch9Sv0ypSEcUR6ew/NUFGocRFNl72Ra7wTm8= +k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= +k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= +k8s.io/component-base v0.30.2 h1:pqGBczYoW1sno8q9ObExUqrYSKhtE5rW3y6gX88GZII= +k8s.io/component-base v0.30.2/go.mod h1:yQLkQDrkK8J6NtP+MGJOws+/PPeEXNpwFixsUI7h/OE= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -open-cluster-management.io/addon-framework v0.9.0 h1:7QKLgfRns2BRLFigjIaWVTPCwG9feM+CNtZ22Yf2I20= -open-cluster-management.io/addon-framework v0.9.0/go.mod h1:OEIFCEXhZKO/Grv08CB0T+TGzS0bLshw4G9u7Vw8dw0= -open-cluster-management.io/api v0.13.0 h1:dlcJEZlNlE0DmSDctK2s7iWKg9l+Tgb0V78Z040nMuk= -open-cluster-management.io/api v0.13.0/go.mod h1:CuCPEzXDvOyxBB0H1d1eSeajbHqaeGEKq9c63vQc63w= -open-cluster-management.io/sdk-go v0.13.0 h1:ddMGsPUekQr9z03tVN6vF39Uf+WEKMtGU/xSd81HdoA= -open-cluster-management.io/sdk-go v0.13.0/go.mod h1:UnsjzYOrDTF9a8rHEXksoIAtAdO1o5CD5Jtaw6T5B9w= -sigs.k8s.io/controller-runtime v0.17.2 h1:FwHwD1CTUemg0pW2otk7/U5/i5m2ymzvOXdbeGOUvw0= -sigs.k8s.io/controller-runtime v0.17.2/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +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.11.0 h1:ZJxphgHQ36VUJF0RIag+nzcEn5PNyep2rsEPdz6wT7o= +open-cluster-management.io/addon-framework v0.11.0/go.mod h1:ruMU8i/dciz3qCv2CQ46Cu1b7rkK7TpvB+W4bRwHf+I= +open-cluster-management.io/api v0.15.0 h1:lRee1KOlGHZb2scTA7ff9E9Fxt2hJc7jpkHnaCbvkOU= +open-cluster-management.io/api v0.15.0/go.mod h1:9erZEWEn4bEqh0nIX2wA7f/s3KCuFycQdBrPrRzi0QM= +open-cluster-management.io/sdk-go v0.15.0 h1:2IAJnPfUoY6rPC5w7LhqAnvIlgekPoVW03LdZO1unIM= +open-cluster-management.io/sdk-go v0.15.0/go.mod h1:fi5WBsbC5K3txKb8eRLuP0Sim/Oqz/PHX18skAEyjiA= +sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw= +sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/pkg/addon/agent/controller/token.go b/pkg/addon/agent/controller/token.go index 848a891..60d40b1 100644 --- a/pkg/addon/agent/controller/token.go +++ b/pkg/addon/agent/controller/token.go @@ -58,8 +58,8 @@ func (r *TokenReconciler) SetupWithManager(mgr ctrl.Manager) error { source.Kind( r.SpokeCache, &corev1.ServiceAccount{}, + event.NewServiceAccountEventHandler[*corev1.ServiceAccount](r.ClusterName), ), - event.NewServiceAccountEventHandler(r.ClusterName), ). Complete(r) } diff --git a/pkg/common/constants.go b/pkg/common/constants.go index 8ebc6e4..7dce39e 100644 --- a/pkg/common/constants.go +++ b/pkg/common/constants.go @@ -1,9 +1,8 @@ package common const ( - AddonName = "managed-serviceaccount" - AgentName = "addon-agent" - AddonAgentInstallNamespace = "open-cluster-management-" + AddonName + AddonName = "managed-serviceaccount" + AgentName = "addon-agent" HubAddonUserGroup = "system:open-cluster-management:addon:managed-serviceaccount" ) diff --git a/pkg/controllers/event/secret_test.go b/pkg/controllers/event/secret_test.go index 9b9851d..b482785 100644 --- a/pkg/controllers/event/secret_test.go +++ b/pkg/controllers/event/secret_test.go @@ -9,6 +9,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/workqueue" "open-cluster-management.io/managed-serviceaccount/pkg/common" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllertest" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" @@ -94,7 +95,7 @@ func TestSecretEventHandler(t *testing.T) { } } -func processEvent(handler handler.EventHandler, evt interface{}) workqueue.RateLimitingInterface { +func processEvent(handler handler.TypedEventHandler[client.Object], evt interface{}) workqueue.RateLimitingInterface { q := &controllertest.Queue{Interface: workqueue.New()} switch e := evt.(type) { case *event.CreateEvent: diff --git a/pkg/controllers/event/serviceaccount.go b/pkg/controllers/event/serviceaccount.go index 991718d..05741ea 100644 --- a/pkg/controllers/event/serviceaccount.go +++ b/pkg/controllers/event/serviceaccount.go @@ -7,59 +7,51 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/workqueue" "open-cluster-management.io/managed-serviceaccount/pkg/common" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" ) -var _ handler.EventHandler = &serviceAccountEventHandler{} +var _ handler.TypedEventHandler[*corev1.ServiceAccount] = &serviceAccountEventHandler[*corev1.ServiceAccount]{} -func NewServiceAccountEventHandler(clusterName string) handler.EventHandler { - return serviceAccountEventHandler{ +func NewServiceAccountEventHandler[T client.Object](clusterName string) serviceAccountEventHandler[T] { + return serviceAccountEventHandler[T]{ clusterName: clusterName, } } -type serviceAccountEventHandler struct { +type serviceAccountEventHandler[T client.Object] struct { clusterName string } -func (s serviceAccountEventHandler) Create(ctx context.Context, event event.CreateEvent, +func (s serviceAccountEventHandler[T]) Create(ctx context.Context, event event.TypedCreateEvent[T], q workqueue.RateLimitingInterface) { - serviceAccount, ok := event.Object.(*corev1.ServiceAccount) - if ok { - s.process(serviceAccount, q) - } + s.process(event.Object.GetLabels(), event.Object.GetName(), q) } -func (s serviceAccountEventHandler) Update(ctx context.Context, event event.UpdateEvent, +func (s serviceAccountEventHandler[T]) Update(ctx context.Context, event event.TypedUpdateEvent[T], q workqueue.RateLimitingInterface) { } -func (s serviceAccountEventHandler) Delete(ctx context.Context, event event.DeleteEvent, +func (s serviceAccountEventHandler[T]) Delete(ctx context.Context, event event.TypedDeleteEvent[T], q workqueue.RateLimitingInterface) { - serviceAccount, ok := event.Object.(*corev1.ServiceAccount) - if ok { - s.process(serviceAccount, q) - } + s.process(event.Object.GetLabels(), event.Object.GetName(), q) } -func (s serviceAccountEventHandler) Generic(ctx context.Context, event event.GenericEvent, +func (s serviceAccountEventHandler[T]) Generic(ctx context.Context, event event.TypedGenericEvent[T], q workqueue.RateLimitingInterface) { - serviceAccount, ok := event.Object.(*corev1.ServiceAccount) - if ok { - s.process(serviceAccount, q) - } + s.process(event.Object.GetLabels(), event.Object.GetName(), q) } -func (s serviceAccountEventHandler) process(serviceAccount *corev1.ServiceAccount, q workqueue.RateLimitingInterface) { - if serviceAccount.Labels[common.LabelKeyIsManagedServiceAccount] != "true" { +func (s serviceAccountEventHandler[T]) process(labels map[string]string, name string, q workqueue.RateLimitingInterface) { + if labels[common.LabelKeyIsManagedServiceAccount] != "true" { return } q.Add(reconcile.Request{ NamespacedName: types.NamespacedName{ Namespace: s.clusterName, - Name: serviceAccount.Name, + Name: name, }, }) } diff --git a/pkg/controllers/event/serviceaccount_test.go b/pkg/controllers/event/serviceaccount_test.go index 9b39faf..2c9598e 100644 --- a/pkg/controllers/event/serviceaccount_test.go +++ b/pkg/controllers/event/serviceaccount_test.go @@ -7,6 +7,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "open-cluster-management.io/managed-serviceaccount/pkg/common" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" ) @@ -79,7 +80,7 @@ func TestServiceAccountEventHandler(t *testing.T) { } for _, c := range cases { t.Run(c.name, func(t *testing.T) { - q := processEvent(NewServiceAccountEventHandler("cluster1"), c.event) + q := processEvent(NewServiceAccountEventHandler[client.Object]("cluster1"), c.event) if c.queued { assert.Equal(t, 1, q.Len(), "expect event queued") } else { From 41aa8f77a9d152fc834e163b1bbffaa8b7bdbda4 Mon Sep 17 00:00:00 2001 From: Jian Zhu Date: Thu, 31 Oct 2024 18:08:14 +0800 Subject: [PATCH 8/9] Upload charts after the release published (#136) Signed-off-by: zhujian --- .github/workflows/chart-upload.yml | 62 +++++++++++++ .github/workflows/go-release.yml | 89 ------------------ .github/workflows/increase-chart-version.yml | 94 ++++++++++++++++++++ 3 files changed, 156 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/chart-upload.yml create mode 100644 .github/workflows/increase-chart-version.yml diff --git a/.github/workflows/chart-upload.yml b/.github/workflows/chart-upload.yml new file mode 100644 index 0000000..0cf52f4 --- /dev/null +++ b/.github/workflows/chart-upload.yml @@ -0,0 +1,62 @@ +name: ChartUpload + +permissions: + contents: read + +on: + release: + types: [published] + +env: + CHART_NAME: managed-serviceaccount + +jobs: + env: + name: prepare release env + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: get release version + id: get_release_version + run: | + RELEASE_VERSION=${GITHUB_REF#refs/tags/} + echo "::set-output name=RELEASE_VERSION::${RELEASE_VERSION}" + echo "::set-output name=MAJOR_RELEASE_VERSION::${RELEASE_VERSION%.*}" + echo "::set-output name=TRIMMED_RELEASE_VERSION::${RELEASE_VERSION#v}" + outputs: + RELEASE_VERSION: ${{ steps.get_release_version.outputs.RELEASE_VERSION }} + MAJOR_RELEASE_VERSION: ${{ steps.get_release_version.outputs.MAJOR_RELEASE_VERSION }} + TRIMMED_RELEASE_VERSION: ${{ steps.get_release_version.outputs.TRIMMED_RELEASE_VERSION }} + upload: + name: upload + runs-on: ubuntu-latest + needs: [ env ] + permissions: + contents: write + steps: + - name: submit charts to OCM chart repo + if: github.event_name != 'pull_request' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.OCM_BOT_PAT }} + script: | + try { + const result = await github.rest.actions.createWorkflowDispatch({ + owner: 'open-cluster-management-io', + repo: 'helm-charts', + workflow_id: 'download-chart.yml', + ref: 'main', + inputs: { + repo: "${{ github.repository }}", + version: "${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }}", + "chart-name": "${{ env.CHART_NAME }}", + }, + }) + console.log(result); + } catch(error) { + console.error(error); + core.setFailed(error); + } diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index cc64a27..8f9e8ec 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -10,7 +10,6 @@ env: GO_REQUIRED_MIN_VERSION: '' GITHUB_REF: ${{ github.ref }} CHART_NAME: managed-serviceaccount - CHART_VERSION_FILE_PATH: ./charts/managed-serviceaccount/Chart.yaml jobs: env: @@ -116,91 +115,3 @@ jobs: draft: true prerelease: false generate_release_notes: true - - name: submit charts to OCM chart repo - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.OCM_BOT_PAT }} - script: | - try { - const result = await github.rest.actions.createWorkflowDispatch({ - owner: 'open-cluster-management-io', - repo: 'helm-charts', - workflow_id: 'download-chart.yml', - ref: 'main', - inputs: { - repo: "${{ github.repository }}", - version: "${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }}", - "chart-name": "${{ env.CHART_NAME }}", - }, - }) - console.log(result); - } catch(error) { - console.error(error); - core.setFailed(error); - } - increase-chart-version: - runs-on: ubuntu-latest - needs: [ env, release ] - steps: - - name: checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: calculate next version - id: calculate_next_version - run: | - echo "Current version: $CURRENT_VERSION" - # Extract the major and minor version components - MAJOR=$(echo $CURRENT_VERSION | cut -d '.' -f 1) - MINOR=$(echo $CURRENT_VERSION | cut -d '.' -f 2) - # Increment the minor version - NEXT_MINOR=$((MINOR + 1)) - # Construct the next version - NEXT_VERSION="$MAJOR.$NEXT_MINOR.0" - echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT - env: - CURRENT_VERSION: ${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }} - - - name: update chart version file - id: update_chart_version - run: | - echo "Updating chart version file from $CURRENT_VERSION to $NEXT_VERSION" - sed -i "s/version: $CURRENT_VERSION/version: $NEXT_VERSION/" ${{ env.CHART_VERSION_FILE_PATH }} - git diff - FILE_CHANGED=$(git diff --exit-code --quiet && echo false || echo true) - echo "Chart version file changed: $FILE_CHANGED" - echo "file_changed=$FILE_CHANGED" >> $GITHUB_OUTPUT - env: - CURRENT_VERSION: ${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }} - NEXT_VERSION: ${{ steps.calculate_next_version.outputs.next_version }} - - - name: check if pull request already exists - id: check_pull_request - if : steps.update_chart_version.outputs.file_changed == 'true' - run: | - gh pr list --state open > pr_list.txt - cat pr_list.txt - PR_EXIST=$(grep -q "Update chart version to ${{ steps.calculate_next_version.outputs.next_version }}" pr_list.txt && echo true || echo false) - echo "pr_exists=$PR_EXIST" >> $GITHUB_OUTPUT - echo "Pull request for version ${{ steps.calculate_next_version.outputs.next_version }} exists: $PR_EXIST" - rm -rf pr_list.txt - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: create pull request - if: steps.update_chart_version.outputs.file_changed == 'true' && steps.check_pull_request.outputs.pr_exists != 'true' - uses: peter-evans/create-pull-request@v7 - with: - # use OCM bot token to bypass "GitHub Actions is not permitted to create or approve pull requests." - token: ${{ secrets.OCM_BOT_PAT }} - commit-message: | - Update chart version to ${{ steps.calculate_next_version.outputs.next_version }} - title: ":seedling: Update chart version to ${{ steps.calculate_next_version.outputs.next_version }}" - body: "Automatically updating chart version to ${{ steps.calculate_next_version.outputs.next_version }}" - branch: update-chart-version-${{ steps.calculate_next_version.outputs.next_version }} - signoff: true - base: main - env: - CURRENT_VERSION: ${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }} - NEXT_VERSION: ${{ steps.calculate_next_version.outputs.next_version }} diff --git a/.github/workflows/increase-chart-version.yml b/.github/workflows/increase-chart-version.yml new file mode 100644 index 0000000..86caa62 --- /dev/null +++ b/.github/workflows/increase-chart-version.yml @@ -0,0 +1,94 @@ +name: ChartUpload + +permissions: + contents: read + +on: + release: + types: [published] + +env: + CHART_VERSION_FILE_PATH: ./charts/managed-serviceaccount/Chart.yaml + +jobs: + env: + name: prepare release env + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: get release version + id: get_release_version + run: | + RELEASE_VERSION=${GITHUB_REF#refs/tags/} + echo "::set-output name=TRIMMED_RELEASE_VERSION::${RELEASE_VERSION#v}" + outputs: + TRIMMED_RELEASE_VERSION: ${{ steps.get_release_version.outputs.TRIMMED_RELEASE_VERSION }} + increase-chart-version: + runs-on: ubuntu-latest + needs: [ env ] + steps: + - name: checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: calculate next version + id: calculate_next_version + run: | + echo "Current version: $CURRENT_VERSION" + # Extract the major and minor version components + MAJOR=$(echo $CURRENT_VERSION | cut -d '.' -f 1) + MINOR=$(echo $CURRENT_VERSION | cut -d '.' -f 2) + # Increment the minor version + NEXT_MINOR=$((MINOR + 1)) + # Construct the next version + NEXT_VERSION="$MAJOR.$NEXT_MINOR.0" + echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT + env: + CURRENT_VERSION: ${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }} + + - name: update chart version file + id: update_chart_version + run: | + echo "Updating chart version file from $CURRENT_VERSION to $NEXT_VERSION" + sed -i "s/version: $CURRENT_VERSION/version: $NEXT_VERSION/" ${{ env.CHART_VERSION_FILE_PATH }} + git diff + FILE_CHANGED=$(git diff --exit-code --quiet && echo false || echo true) + echo "Chart version file changed: $FILE_CHANGED" + echo "file_changed=$FILE_CHANGED" >> $GITHUB_OUTPUT + env: + CURRENT_VERSION: ${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }} + NEXT_VERSION: ${{ steps.calculate_next_version.outputs.next_version }} + + - name: check if pull request already exists + id: check_pull_request + if : steps.update_chart_version.outputs.file_changed == 'true' + run: | + gh pr list --state open > pr_list.txt + cat pr_list.txt + PR_EXIST=$(grep -q "Update chart version to ${{ steps.calculate_next_version.outputs.next_version }}" pr_list.txt && echo true || echo false) + echo "pr_exists=$PR_EXIST" >> $GITHUB_OUTPUT + echo "Pull request for version ${{ steps.calculate_next_version.outputs.next_version }} exists: $PR_EXIST" + rm -rf pr_list.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: create pull request + if: steps.update_chart_version.outputs.file_changed == 'true' && steps.check_pull_request.outputs.pr_exists != 'true' + uses: peter-evans/create-pull-request@v7 + with: + # use OCM bot token to bypass "GitHub Actions is not permitted to create or approve pull requests." + token: ${{ secrets.OCM_BOT_PAT }} + commit-message: | + Update chart version to ${{ steps.calculate_next_version.outputs.next_version }} + title: ":seedling: Update chart version to ${{ steps.calculate_next_version.outputs.next_version }}" + body: "Automatically updating chart version to ${{ steps.calculate_next_version.outputs.next_version }}" + branch: update-chart-version-${{ steps.calculate_next_version.outputs.next_version }} + signoff: true + base: main + env: + CURRENT_VERSION: ${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }} + NEXT_VERSION: ${{ steps.calculate_next_version.outputs.next_version }} From 49dcd4605c84c922222f837faf0de6f7efeb6627 Mon Sep 17 00:00:00 2001 From: Jian Zhu Date: Mon, 11 Nov 2024 22:31:52 +0800 Subject: [PATCH 9/9] upgrade base image to ubi9 (#137) Signed-off-by: zhujian --- .github/workflows/go-postsubmit.yml | 2 +- .github/workflows/go-release.yml | 2 +- Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go-postsubmit.yml b/.github/workflows/go-postsubmit.yml index 47f9308..a880248 100644 --- a/.github/workflows/go-postsubmit.yml +++ b/.github/workflows/go-postsubmit.yml @@ -37,7 +37,7 @@ jobs: - name: install imagebuilder run: go install github.com/openshift/imagebuilder/cmd/imagebuilder@v1.2.3 - name: pull base image - run: docker pull registry.access.redhat.com/ubi8/ubi-minimal:latest --platform=linux/${{ matrix.arch }} + run: docker pull registry.access.redhat.com/ubi9/ubi-minimal:latest --platform=linux/${{ matrix.arch }} - name: images run: | IMAGE_TAG=latest-${{ matrix.arch }} \ diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index 8f9e8ec..59b131d 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -50,7 +50,7 @@ jobs: - name: install imagebuilder run: go install github.com/openshift/imagebuilder/cmd/imagebuilder@v1.2.3 - name: pull base image - run: docker pull registry.access.redhat.com/ubi8/ubi-minimal:latest --platform=linux/${{ matrix.arch }} + run: docker pull registry.access.redhat.com/ubi9/ubi-minimal:latest --platform=linux/${{ matrix.arch }} - name: images run: | IMAGE_TAG=${{ needs.env.outputs.RELEASE_VERSION }}-${{ matrix.arch }} \ diff --git a/Dockerfile b/Dockerfile index c7a02ce..ebded06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,5 +4,5 @@ COPY . . RUN go env RUN make build-bin -FROM registry.access.redhat.com/ubi8/ubi-minimal:latest +FROM registry.access.redhat.com/ubi9/ubi-minimal:latest COPY --from=builder /go/src/github.com/open-cluster-management.io/managed-serviceaccount/bin/msa /