Skip to content

Commit

Permalink
Support custom ramen namespace
Browse files Browse the repository at this point in the history
ramenctl supports --ramen-namespace argument, but "ramen-system" was
hard coded in some yamls and kubectl calls.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Jul 17, 2023
1 parent 372456d commit a5bdd9c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions ramenctl/ramenctl/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ def run(args):
)

command.info("Creating s3 secret in ramen hub namespace")
template = drenv.template(command.resource("ramen-s3-secret.yaml"))
kubectl.apply(
"--filename",
command.resource("ramen-s3-secret.yaml"),
"--filename=-",
input=template.substitute(namespace=args.ramen_namespace),
context=env["hub"],
log=command.debug,
)
Expand All @@ -47,6 +48,7 @@ def run(args):
cluster2=env["clusters"][1],
minio_url_cluster1=minio.service_url(env["clusters"][0]),
minio_url_cluster2=minio.service_url(env["clusters"][1]),
namespace=args.ramen_namespace,
)
kubectl.apply(
"--filename=-",
Expand Down
2 changes: 1 addition & 1 deletion ramenctl/ramenctl/resources/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
cluster.open-cluster-management.io/backup: resource
name: ramen-hub-operator-config
namespace: ramen-system
namespace: $namespace
data:
ramen_manager_config.yaml: |
apiVersion: ramendr.openshift.io/v1alpha1
Expand Down
2 changes: 1 addition & 1 deletion ramenctl/ramenctl/resources/ramen-s3-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: v1
kind: Secret
metadata:
name: ramen-s3-secret
namespace: ramen-system
namespace: $namespace
stringData:
AWS_ACCESS_KEY_ID: minio
AWS_SECRET_ACCESS_KEY: minio123
5 changes: 3 additions & 2 deletions ramenctl/ramenctl/unconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ def run(args):
# We keep the ramen config map since we do not own it.

command.info("Deleting s3 secret in ramen hub namespace")
template = drenv.template(command.resource("ramen-s3-secret.yaml"))
kubectl.delete(
"--filename",
command.resource("ramen-s3-secret.yaml"),
"--filename=-",
"--ignore-not-found",
input=template.substitute(namespace=args.ramen_namespace),
context=env["hub"],
log=command.debug,
)

0 comments on commit a5bdd9c

Please sign in to comment.