Skip to content

Commit 13c3fcf

Browse files
jmckulkJonathan S. Katz
authored andcommitted
Revert change to adjust placement of label creation
This change was to make the script more clear and get rid of false positive errors. This wasn't required in the ansible version of the script.
1 parent 2eadc4f commit 13c3fcf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ansible/roles/pgo-operator/templates/add-targeted-namespace.sh.j2

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ PG_SA="pgo-pg"
2929
# create the namespace if necessary
3030
{{ kubectl_or_oc }} get ns {{ item }} > /dev/null
3131
if [ $? -eq 0 ]; then
32-
echo "namespace" {{ item }} "already exists, adding labels"
33-
# set the labels so that existing namespace is owned by this installation
34-
{{ kubectl_or_oc }} label namespace/{{ item }} pgo-created-by=add-script
35-
{{ kubectl_or_oc }} label namespace/{{ item }} vendor=crunchydata
36-
{{ kubectl_or_oc }} label namespace/{{ item }} pgo-installation-name={{ pgo_installation_name }}
32+
echo "namespace" {{ item }} "already exists"
3733
else
3834
echo "namespace" {{ item }} "is new"
3935
{{ kubectl_or_oc }} create ns {{ item }}
4036
fi
4137

38+
# set the labels so that this namespace is owned by this installation
39+
{{ kubectl_or_oc }} label namespace/{{ item }} pgo-created-by=add-script
40+
{{ kubectl_or_oc }} label namespace/{{ item }} vendor=crunchydata
41+
{{ kubectl_or_oc }} label namespace/{{ item }} pgo-installation-name={{ pgo_installation_name }}
42+
4243
# determine if an existing pod is using the 'pgo-pg' service account. if so, do not delete
4344
# and recreate the SA or its associated role and role binding. this is to avoid any undesired
4445
# behavior with existing PG clusters that are actively utilizing the SA.

0 commit comments

Comments
 (0)