Skip to content

Commit

Permalink
use diff addon namespace for each hub
Browse files Browse the repository at this point in the history
Signed-off-by: Coleen Iona Quadros <[email protected]>
  • Loading branch information
coleenquadros committed Jul 31, 2024
1 parent 16c5e81 commit 3c4e651
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ func generateGlobalManifestResources(c client.Client, mco *mcov1beta2.MultiClust
works := []workv1.Manifest{}

// inject the namespace
spokeNameSpace = getSpokeNameSpace(c)
works = injectIntoWork(works, generateNamespace())

// inject the image pull secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
package placementrule

import (
"context"
"github.com/stolostron/multicluster-observability-operator/operators/endpointmetrics/pkg/openshift"
"os"
client "sigs.k8s.io/controller-runtime/pkg/client"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -17,7 +20,14 @@ var (
spokeNameSpace = os.Getenv("SPOKE_NAMESPACE")
)

func getSpokeNameSpace(c client.Client) string {
clusterID, _ := openshift.GetClusterID(context.TODO(), c)
spokeNameSpace = spokeNameSpace + "-" + clusterID
return spokeNameSpace
}

func generateNamespace() *corev1.Namespace {

return &corev1.Namespace{
TypeMeta: metav1.TypeMeta{
APIVersion: corev1.SchemeGroupVersion.String(),
Expand Down

0 comments on commit 3c4e651

Please sign in to comment.