Skip to content

Commit

Permalink
update agent lease to check managed cluster api server (stolostron#614)
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiwei Yin <[email protected]>
  • Loading branch information
zhiweiyin318 authored May 22, 2023
1 parent 7c7eb07 commit 629b9e0
Show file tree
Hide file tree
Showing 45 changed files with 2,513 additions and 966 deletions.
3 changes: 2 additions & 1 deletion cmd/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ func startManager(o *options.AgentOptions, ctx context.Context) {
o.EnableNodeCapacity)
go resourceCollector.Start(ctx)

leaseUpdater := lease.NewLeaseUpdater(managementClusterKubeClient, AddonName, componentNamespace).
leaseUpdater := lease.NewLeaseUpdater(managementClusterKubeClient, AddonName,
componentNamespace, lease.CheckManagedClusterHealthFunc(managedClusterKubeClient.Discovery())).
WithHubLeaseConfig(hubConfig, o.ClusterName)
go leaseUpdater.Start(ctx)

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ require (
k8s.io/klog/v2 v2.90.1
k8s.io/kube-aggregator v0.26.2
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280
open-cluster-management.io/addon-framework v0.6.1
open-cluster-management.io/api v0.10.1-0.20230404062739-ddf72e2f1bea
open-cluster-management.io/addon-framework v0.6.2-0.20230518083220-0994d42b557a
open-cluster-management.io/api v0.10.1-0.20230426130439-54a83a1650d6
sigs.k8s.io/controller-runtime v0.14.4
sigs.k8s.io/yaml v1.3.0
)
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -883,10 +883,10 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 h1:xMMXJlJbsU8w3V5N2FLDQ8YgU8s1EoULdbQBcAeNJkY=
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
open-cluster-management.io/addon-framework v0.6.1 h1:gnBZaCRgtiPRjCBJoaRqMivajng/XOKp0NQhJUqLd+U=
open-cluster-management.io/addon-framework v0.6.1/go.mod h1:Uu4XC3Ec0ATS7U73PJtzAP4NCDfbDBVy1k5RUUwQDqY=
open-cluster-management.io/api v0.10.1-0.20230404062739-ddf72e2f1bea h1:E3BAlNqJohbxgkNkDguu95ET6nWd560D8HIl9eTIxAM=
open-cluster-management.io/api v0.10.1-0.20230404062739-ddf72e2f1bea/go.mod h1:WgKUCJ7+Bf40DsOmH1Gdkpyj3joco+QLzrlM6Ak39zE=
open-cluster-management.io/addon-framework v0.6.2-0.20230518083220-0994d42b557a h1:k2OCZ7tb2WirOjH3MOLf96U7I2r94E974msa2BCkWLk=
open-cluster-management.io/addon-framework v0.6.2-0.20230518083220-0994d42b557a/go.mod h1:kynUPV27PK84SKk5Kw91DJ93ldzLXV1r1MeRxH2x7Ls=
open-cluster-management.io/api v0.10.1-0.20230426130439-54a83a1650d6 h1:sViInPTDkS/jZS7SAmgZvgxP4EO+iC+uHKHPw1vTiqw=
open-cluster-management.io/api v0.10.1-0.20230426130439-54a83a1650d6/go.mod h1:WgKUCJ7+Bf40DsOmH1Gdkpyj3joco+QLzrlM6Ak39zE=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
10 changes: 6 additions & 4 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1460,24 +1460,26 @@ k8s.io/utils/path
k8s.io/utils/pointer
k8s.io/utils/strings/slices
k8s.io/utils/trace
# open-cluster-management.io/addon-framework v0.6.1
# open-cluster-management.io/addon-framework v0.6.2-0.20230518083220-0994d42b557a
## explicit; go 1.19
open-cluster-management.io/addon-framework/pkg/addonfactory
open-cluster-management.io/addon-framework/pkg/addonmanager
open-cluster-management.io/addon-framework/pkg/addonmanager/constants
open-cluster-management.io/addon-framework/pkg/addonmanager/controllers/addonconfig
open-cluster-management.io/addon-framework/pkg/addonmanager/controllers/addonhealthcheck
open-cluster-management.io/addon-framework/pkg/addonmanager/controllers/addoninstall
open-cluster-management.io/addon-framework/pkg/addonmanager/controllers/agentdeploy
open-cluster-management.io/addon-framework/pkg/addonmanager/controllers/certificate
open-cluster-management.io/addon-framework/pkg/addonmanager/controllers/clustermanagement
open-cluster-management.io/addon-framework/pkg/addonmanager/controllers/managementaddonconfig
open-cluster-management.io/addon-framework/pkg/addonmanager/controllers/registration
open-cluster-management.io/addon-framework/pkg/agent
open-cluster-management.io/addon-framework/pkg/assets
open-cluster-management.io/addon-framework/pkg/basecontroller/factory
open-cluster-management.io/addon-framework/pkg/index
open-cluster-management.io/addon-framework/pkg/lease
open-cluster-management.io/addon-framework/pkg/manager/controllers/addonconfiguration
open-cluster-management.io/addon-framework/pkg/manager/controllers/addonowner
open-cluster-management.io/addon-framework/pkg/utils
# open-cluster-management.io/api v0.10.1-0.20230404062739-ddf72e2f1bea
# open-cluster-management.io/api v0.10.1-0.20230426130439-54a83a1650d6
## explicit; go 1.19
open-cluster-management.io/api/addon/v1alpha1
open-cluster-management.io/api/client/addon/clientset/versioned
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 629b9e0

Please sign in to comment.