Skip to content

Commit

Permalink
Merge branch 'open-cluster-management-io:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiweiyin318 authored Feb 8, 2024
2 parents 3076a79 + e59b134 commit fd8d6e7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
13 changes: 8 additions & 5 deletions cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func main() {
var clusterName string
var spokeKubeconfig string
var featureGatesFlags map[string]bool
var leaseHealthCheck bool

logger := klogr.New()
klog.SetOutput(os.Stdout)
Expand All @@ -69,7 +70,7 @@ func main() {
"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()
ctrl.SetLogger(logger)

Expand Down Expand Up @@ -191,11 +192,13 @@ func main() {
ctx, cancel := context.WithCancel(ctrl.SetupSignalHandler())
defer cancel()

leaseUpdater, err := health.NewAddonHealthUpdater(mgr.GetConfig(), clusterName, spokeCfg, spokeNamespace)
if err != nil {
klog.Fatalf("unable to create healthiness lease updater for controller %v", "ManagedServiceAccount")
if leaseHealthCheck {
leaseUpdater, err := health.NewAddonHealthUpdater(mgr.GetConfig(), clusterName, spokeCfg, spokeNamespace)
if err != nil {
klog.Fatalf("unable to create healthiness lease updater for controller %v", "ManagedServiceAccount")
}
go leaseUpdater.Start(ctx)
}
go leaseUpdater.Start(ctx)

cc, err := addonutils.NewConfigChecker("managed-serviceaccount-agent", getHubKubeconfigPath())
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ require (
k8s.io/component-base v0.27.4
k8s.io/klog/v2 v2.90.1
k8s.io/utils v0.0.0-20230209194617-a36077c30491
open-cluster-management.io/addon-framework v0.7.1-0.20230922012530-9d049de615d8
open-cluster-management.io/api v0.11.1-0.20230921010001-9cb6321fa748
open-cluster-management.io/addon-framework v0.8.0
open-cluster-management.io/api v0.12.0
sigs.k8s.io/controller-runtime v0.15.1
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5F
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg=
k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
open-cluster-management.io/addon-framework v0.7.1-0.20230922012530-9d049de615d8 h1:YPOgQZ+Yb5bLIBXYVepPBkGh5dDIGxn/sFl5RkjkvW0=
open-cluster-management.io/addon-framework v0.7.1-0.20230922012530-9d049de615d8/go.mod h1:eI9o2LMXLBQK/IZ55X0zZiop2L9YDdL81ZoHWb9Pc0M=
open-cluster-management.io/api v0.11.1-0.20230921010001-9cb6321fa748 h1:OjemV/LWwBuKDZJLfEPw51w0Zbd9HKgpkxGtPclOjkQ=
open-cluster-management.io/api v0.11.1-0.20230921010001-9cb6321fa748/go.mod h1:/CZhelEH+30/pX7vXGSZOzLMX0zvjthYOkT/5ZTzVTQ=
open-cluster-management.io/addon-framework v0.8.0 h1:i1OReMHuZIoAw2Q04SLjkieU25DnxYilzVZzBNyROwU=
open-cluster-management.io/addon-framework v0.8.0/go.mod h1:20DP06VXhJ9RE1PetAMEQyeFCP7+nhs92pCAkqbWUOg=
open-cluster-management.io/api v0.12.0 h1:sNkj4k2XyWA/GLsTiFg82bLIZ7JDZKkLLLyZjJUlJMs=
open-cluster-management.io/api v0.12.0/go.mod h1:/CZhelEH+30/pX7vXGSZOzLMX0zvjthYOkT/5ZTzVTQ=
sigs.k8s.io/controller-runtime v0.15.1 h1:9UvgKD4ZJGcj24vefUFgZFP3xej/3igL9BsOUTb/+4c=
sigs.k8s.io/controller-runtime v0.15.1/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
Expand Down
1 change: 1 addition & 0 deletions pkg/addon/manager/manifests/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ spec:
- --leader-elect=false
- --cluster-name={{ .ClusterName }}
- --kubeconfig=/etc/hub/kubeconfig
- --lease-health-check=true
volumeMounts:
- name: hub-kubeconfig
mountPath: /etc/hub/
Expand Down

0 comments on commit fd8d6e7

Please sign in to comment.