Skip to content

Commit

Permalink
🌱 remove duplicate controller and installstrategy (#252)
Browse files Browse the repository at this point in the history
* remove duplicate controller and installstrategy

Signed-off-by: haoqing0110 <qhao@redhat.com>

* addon ownerref to pass integration tests

Signed-off-by: haoqing0110 <qhao@redhat.com>

* modify helloworld addon

Signed-off-by: haoqing0110 <qhao@redhat.com>

* remove self from annotation

Signed-off-by: haoqing0110 <qhao@redhat.com>

---------

Signed-off-by: haoqing0110 <qhao@redhat.com>
  • Loading branch information
haoqing0110 committed Mar 27, 2024
1 parent 52eef42 commit b0ef02a
Show file tree
Hide file tree
Showing 35 changed files with 119 additions and 4,920 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: addon.open-cluster-management.io/v1alpha1
kind: ClusterManagementAddOn
metadata:
name: hello-template
annotations:
addon.open-cluster-management.io/lifecycle: "addon-manager"
spec:
addOnMeta:
description: hello-template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: addon.open-cluster-management.io/v1alpha1
kind: ClusterManagementAddOn
metadata:
name: helloworld
annotations:
"addon.open-cluster-management.io/lifecycle": "addon-manager"
spec:
addOnMeta:
displayName: helloworld
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: addon.open-cluster-management.io/v1alpha1
kind: ClusterManagementAddOn
metadata:
name: kubernetes-dashboard
annotations:
addon.open-cluster-management.io/lifecycle: "addon-manager"
spec:
addOnMeta:
description: kubernetes-dashboard
Expand Down
14 changes: 0 additions & 14 deletions pkg/addonfactory/addonfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func NewAgentAddonFactory(addonName string, fs embed.FS, dir string) *AgentAddon
agentAddonOptions: agent.AgentAddonOptions{
AddonName: addonName,
Registration: nil,
InstallStrategy: nil,
HealthProber: nil,
SupportedConfigGVRs: []schema.GroupVersionResource{},
},
Expand All @@ -83,19 +82,6 @@ func (f *AgentAddonFactory) WithGetValuesFuncs(getValuesFuncs ...GetValuesFunc)
return f
}

// WithInstallStrategy defines the installation strategy of the manifests prescribed by Manifests(..).
// 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 {
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 {
f.agentAddonOptions.Registration = option
Expand Down
138 changes: 0 additions & 138 deletions pkg/addonmanager/controllers/addoninstall/controller.go

This file was deleted.

Loading

0 comments on commit b0ef02a

Please sign in to comment.