Skip to content

Commit

Permalink
set ROLEARN env variable in noobaa subscription
Browse files Browse the repository at this point in the history
If ROLEARN env variable is set, then pass on that env variable
to noobaa subscription.

Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
  • Loading branch information
Nikhil-Ladha committed Dec 6, 2023
1 parent 47e5643 commit aeb3bdd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var (
"NOOBAA_SUBSCRIPTION_STARTINGCSV": "noobaa-operator.v5.14.0",
"NOOBAA_SUBSCRIPTION_CATALOGSOURCE": "odf-catalogsource",
"NOOBAA_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE": "openshift-marketplace",
"ROLEARN": "",

"OCS_SUBSCRIPTION_NAME": "ocs-operator",
"OCS_SUBSCRIPTION_PACKAGE": "ocs-operator",
Expand Down Expand Up @@ -68,6 +69,7 @@ var (
NoobaaSubscriptionStartingCSV = GetEnvOrDefault("NOOBAA_SUBSCRIPTION_STARTINGCSV")
NoobaaSubscriptionCatalogSource = GetEnvOrDefault("NOOBAA_SUBSCRIPTION_CATALOGSOURCE")
NoobaaSubscriptionCatalogSourceNamespace = GetEnvOrDefault("NOOBAA_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE")
RoleARN = GetEnvOrDefault("ROLEARN")

CSIAddonsSubscriptionName = GetEnvOrDefault("CSIADDONS_SUBSCRIPTION_NAME")
CSIAddonsSubscriptionPackage = GetEnvOrDefault("CSIADDONS_SUBSCRIPTION_PACKAGE")
Expand Down
11 changes: 11 additions & 0 deletions controllers/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,17 @@ func GetStorageClusterSubscriptions() []*operatorv1alpha1.Subscription {
},
}

if RoleARN != "" {
noobaaSubscription.Spec.Config = &operatorv1alpha1.SubscriptionConfig{
Env: []corev1.EnvVar{
{
Name: "ROLEARN",
Value: RoleARN,
},
},
}
}

ocsSubscription := &operatorv1alpha1.Subscription{
ObjectMeta: metav1.ObjectMeta{
Name: OcsSubscriptionName,
Expand Down

0 comments on commit aeb3bdd

Please sign in to comment.