Skip to content

Commit

Permalink
add deprecated marks
Browse files Browse the repository at this point in the history
Signed-off-by: zhujian <[email protected]>
  • Loading branch information
zhujian7 committed Mar 15, 2024
1 parent 3142006 commit f9f3ccd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions pkg/addonfactory/addonfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func (f *AgentAddonFactory) WithHostingCluster(cluster *clusterv1.ManagedCluster
return f
}

// WithManagedClusterClient defines the cluster client that can get the hosting cluster used in hosted mode.
func (f *AgentAddonFactory) WithManagedClusterClient(c clusterclientset.Interface) *AgentAddonFactory {
f.clusterClient = c
return f
Expand Down
17 changes: 12 additions & 5 deletions pkg/addonfactory/helm_agentaddon.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ type helmDefaultValues struct {
}

type HelmAgentAddon struct {
decoder runtime.Decoder
chart *chart.Chart
getValuesFuncs []GetValuesFunc
agentAddonOptions agent.AgentAddonOptions
trimCRDDescription bool
decoder runtime.Decoder
chart *chart.Chart
getValuesFuncs []GetValuesFunc
agentAddonOptions agent.AgentAddonOptions
trimCRDDescription bool
// Deprecated: use clusterClient to get the hosting cluster.
hostingCluster *clusterv1.ManagedCluster
clusterClient clusterclientset.Interface
agentInstallNamespace func(addon *addonapiv1alpha1.ManagedClusterAddOn) string
Expand Down Expand Up @@ -245,6 +246,12 @@ func (a *HelmAgentAddon) getBuiltinValues(
return helmBuiltinValues, nil
}

// Deprecated: use "WithManagedClusterClient" in AgentAddonFactory to set a cluster client that
// can be used to get the hosting cluster.
func (a *HelmAgentAddon) SetHostingCluster(hostingCluster *clusterv1.ManagedCluster) {
a.hostingCluster = hostingCluster
}

func (a *HelmAgentAddon) getDefaultValues(
cluster *clusterv1.ManagedCluster,
addon *addonapiv1alpha1.ManagedClusterAddOn) (Values, error) {
Expand Down

0 comments on commit f9f3ccd

Please sign in to comment.