Skip to content

Commit

Permalink
🌱 Bump addon framework to 0.11 (#129)
Browse files Browse the repository at this point in the history
* 🌱 Bump addon framework to 0.11

Signed-off-by: zhujian <[email protected]>

* Use install strategy to install managedserviceaccount addon for all clusters

Signed-off-by: zhujian <[email protected]>

---------

Signed-off-by: zhujian <[email protected]>
  • Loading branch information
zhujian7 authored Oct 21, 2024
1 parent f8a2381 commit 940d1de
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
27 changes: 27 additions & 0 deletions charts/managed-serviceaccount/templates/placement.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
10 changes: 0 additions & 10 deletions cmd/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand All @@ -113,7 +108,6 @@ type HubManagerOptions struct {
EnableLeaderElection bool
ProbeAddr string
AddonAgentImageName string
AgentInstallAll bool
ImagePullSecretName string
FeatureGatesFlags map[string]bool
}
Expand Down Expand Up @@ -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")
Expand Down
74 changes: 37 additions & 37 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 940d1de

Please sign in to comment.