Skip to content

Commit

Permalink
remove duplicate controller and installstrategy
Browse files Browse the repository at this point in the history
Signed-off-by: haoqing0110 <[email protected]>
  • Loading branch information
haoqing0110 committed Mar 13, 2024
1 parent 0bee558 commit d6636fd
Show file tree
Hide file tree
Showing 18 changed files with 81 additions and 4,140 deletions.
3 changes: 1 addition & 2 deletions cmd/example/helloworld/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"open-cluster-management.io/addon-framework/examples/helloworld_agent"
"open-cluster-management.io/addon-framework/pkg/addonfactory"
"open-cluster-management.io/addon-framework/pkg/addonmanager"
addonagent "open-cluster-management.io/addon-framework/pkg/agent"
cmdfactory "open-cluster-management.io/addon-framework/pkg/cmd/factory"
"open-cluster-management.io/addon-framework/pkg/utils"
"open-cluster-management.io/addon-framework/pkg/version"
Expand Down Expand Up @@ -109,7 +108,7 @@ func runController(ctx context.Context, kubeConfig *rest.Config) error {
),
).
WithAgentRegistrationOption(registrationOption).
WithInstallStrategy(addonagent.InstallAllStrategy(helloworld.InstallationNamespace)).
// WithInstallStrategy(addonagent.InstallAllStrategy(helloworld.InstallationNamespace)).
WithAgentHealthProber(helloworld.AgentHealthProber()).
BuildTemplateAgentAddon()
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions pkg/addonfactory/addonfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ func NewAgentAddonFactory(addonName string, fs embed.FS, dir string) *AgentAddon
fs: fs,
dir: dir,
agentAddonOptions: agent.AgentAddonOptions{
AddonName: addonName,
Registration: nil,
InstallStrategy: nil,
AddonName: addonName,
Registration: nil,
// InstallStrategy: nil,
HealthProber: nil,
SupportedConfigGVRs: []schema.GroupVersionResource{},
},
Expand Down Expand Up @@ -82,14 +82,14 @@ func (f *AgentAddonFactory) WithGetValuesFuncs(getValuesFuncs ...GetValuesFunc)
// Deprecated: add annotation "addon.open-cluster-management.io/lifecycle: addon-manager" to ClusterManagementAddon
// and define install strategy in ClusterManagementAddon spec.installStrategy instead.
// The migration plan refer to https://github.com/open-cluster-management-io/ocm/issues/355.
func (f *AgentAddonFactory) WithInstallStrategy(strategy *agent.InstallStrategy) *AgentAddonFactory {
/*func (f *AgentAddonFactory) WithInstallStrategy(strategy *agent.InstallStrategy) *AgentAddonFactory {
if strategy.InstallNamespace == "" {
strategy.InstallNamespace = AddonDefaultInstallNamespace
}
f.agentAddonOptions.InstallStrategy = strategy
return f
}
}*/

// WithAgentRegistrationOption defines how agent is registered to the hub cluster.
func (f *AgentAddonFactory) WithAgentRegistrationOption(option *agent.RegistrationOption) *AgentAddonFactory {
Expand Down
138 changes: 0 additions & 138 deletions pkg/addonmanager/controllers/addoninstall/controller.go

This file was deleted.

Loading

0 comments on commit d6636fd

Please sign in to comment.