Skip to content

Commit

Permalink
Use harcoded addon namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Oct 12, 2024
1 parent 45ac674 commit df59fd9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/feature_installer/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
"k8s.io/client-go/tools/clientcmd/api"
"k8s.io/klog/v2"
cu "kmodules.xyz/client-go/client"
"kmodules.xyz/client-go/meta"
"kmodules.xyz/client-go/tools/clientcmd"
"kmodules.xyz/fake-apiserver/pkg"
uiapi "kmodules.xyz/resource-metadata/apis/ui/v1alpha1"
Expand All @@ -53,6 +52,8 @@ const (
pullInterval = 2 * time.Second
waitTimeout = 10 * time.Minute

// addonNamespace must be hardcoded as it is also used from b3
addonNamespace = "open-cluster-management-addon"
mwrsNameNamespace = "ace-namespace"
mwrsNameBootstrap = "ace-bootstrap"
)
Expand Down Expand Up @@ -137,7 +138,7 @@ func StartFakeApiServerAndApplyBaseManifestWorkReplicaSets(ctx context.Context,
}

var mwrsNamespace work.ManifestWorkReplicaSet
if err = kc.Get(ctx, client.ObjectKey{Name: mwrsNameNamespace, Namespace: meta.PodNamespace()}, &mwrsNamespace); err != nil {
if err = kc.Get(ctx, client.ObjectKey{Name: mwrsNameNamespace, Namespace: addonNamespace}, &mwrsNamespace); err != nil {
return nil, err
}

Expand All @@ -146,7 +147,7 @@ func StartFakeApiServerAndApplyBaseManifestWorkReplicaSets(ctx context.Context,
}

var mwrsBootstrap work.ManifestWorkReplicaSet
if err = kc.Get(ctx, client.ObjectKey{Name: mwrsNameBootstrap, Namespace: meta.PodNamespace()}, &mwrsBootstrap); err != nil {
if err = kc.Get(ctx, client.ObjectKey{Name: mwrsNameBootstrap, Namespace: addonNamespace}, &mwrsBootstrap); err != nil {
return nil, err
}

Expand Down

0 comments on commit df59fd9

Please sign in to comment.