Skip to content

Commit d68b7c1

Browse files
committed
Explicitly set the namespace for acm objects
1 parent 9d4437e commit d68b7c1

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

managedClusters/templates/acm/policies/application-policies.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ apiVersion: policy.open-cluster-management.io/v1
66
kind: Policy
77
metadata:
88
name: {{ .name }}-clustergroup-policy
9+
namespace: open-cluster-management
910
annotations:
1011
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
1112
argocd.argoproj.io/compare-options: IgnoreExtraneous
@@ -98,6 +99,7 @@ apiVersion: policy.open-cluster-management.io/v1
9899
kind: PlacementBinding
99100
metadata:
100101
name: {{ .name }}-placement-binding
102+
namespace: open-cluster-management
101103
annotations:
102104
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
103105
placementRef:
@@ -113,6 +115,7 @@ apiVersion: apps.open-cluster-management.io/v1
113115
kind: PlacementRule
114116
metadata:
115117
name: {{ .name }}-placement
118+
namespace: open-cluster-management
116119
spec:
117120
clusterConditions:
118121
- status: 'True'

managedClusters/templates/acm/policies/ocp-gitops-policy.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ apiVersion: policy.open-cluster-management.io/v1
99
kind: Policy
1010
metadata:
1111
name: openshift-gitops-policy
12+
namespace: open-cluster-management
1213
annotations:
1314
policy.open-cluster-management.io/standards: NIST-CSF
1415
policy.open-cluster-management.io/categories: PR.DS Data Security
@@ -56,6 +57,7 @@ apiVersion: policy.open-cluster-management.io/v1
5657
kind: PlacementBinding
5758
metadata:
5859
name: openshift-gitops-placement-binding
60+
namespace: open-cluster-management
5961
annotations:
6062
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
6163
placementRef:
@@ -71,6 +73,7 @@ apiVersion: apps.open-cluster-management.io/v1
7173
kind: PlacementRule
7274
metadata:
7375
name: openshift-gitops-placement
76+
namespace: open-cluster-management
7477
spec:
7578
clusterConditions:
7679
- status: 'True'

tests/managedClusters-normal.expected.yml

+9
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ apiVersion: policy.open-cluster-management.io/v1
666666
kind: PlacementBinding
667667
metadata:
668668
name: acm-edge-placement-binding
669+
namespace: open-cluster-management
669670
annotations:
670671
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
671672
placementRef:
@@ -682,6 +683,7 @@ apiVersion: policy.open-cluster-management.io/v1
682683
kind: PlacementBinding
683684
metadata:
684685
name: acm-provision-edge-placement-binding
686+
namespace: open-cluster-management
685687
annotations:
686688
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
687689
placementRef:
@@ -698,6 +700,7 @@ apiVersion: policy.open-cluster-management.io/v1
698700
kind: PlacementBinding
699701
metadata:
700702
name: openshift-gitops-placement-binding
703+
namespace: open-cluster-management
701704
annotations:
702705
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
703706
placementRef:
@@ -714,6 +717,7 @@ apiVersion: apps.open-cluster-management.io/v1
714717
kind: PlacementRule
715718
metadata:
716719
name: acm-edge-placement
720+
namespace: open-cluster-management
717721
spec:
718722
clusterConditions:
719723
- status: 'True'
@@ -727,6 +731,7 @@ apiVersion: apps.open-cluster-management.io/v1
727731
kind: PlacementRule
728732
metadata:
729733
name: acm-provision-edge-placement
734+
namespace: open-cluster-management
730735
spec:
731736
clusterConditions:
732737
- status: 'True'
@@ -740,6 +745,7 @@ apiVersion: apps.open-cluster-management.io/v1
740745
kind: PlacementRule
741746
metadata:
742747
name: openshift-gitops-placement
748+
namespace: open-cluster-management
743749
spec:
744750
clusterConditions:
745751
- status: 'True'
@@ -757,6 +763,7 @@ apiVersion: policy.open-cluster-management.io/v1
757763
kind: Policy
758764
metadata:
759765
name: acm-edge-clustergroup-policy
766+
namespace: open-cluster-management
760767
annotations:
761768
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
762769
argocd.argoproj.io/compare-options: IgnoreExtraneous
@@ -838,6 +845,7 @@ apiVersion: policy.open-cluster-management.io/v1
838845
kind: Policy
839846
metadata:
840847
name: acm-provision-edge-clustergroup-policy
848+
namespace: open-cluster-management
841849
annotations:
842850
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
843851
argocd.argoproj.io/compare-options: IgnoreExtraneous
@@ -919,6 +927,7 @@ apiVersion: policy.open-cluster-management.io/v1
919927
kind: Policy
920928
metadata:
921929
name: openshift-gitops-policy
930+
namespace: open-cluster-management
922931
annotations:
923932
policy.open-cluster-management.io/standards: NIST-CSF
924933
policy.open-cluster-management.io/categories: PR.DS Data Security

tests/managedClusters.expected.diff

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- tests/managedClusters-naked.expected.yml
22
+++ tests/managedClusters-normal.expected.yml
3-
@@ -1,3 +1,963 @@
3+
@@ -1,3 +1,972 @@
44
---
55
+# Source: acm/templates/acm/provision/secrets-common.yaml
66
+apiVersion: v1
@@ -669,6 +669,7 @@
669669
+kind: PlacementBinding
670670
+metadata:
671671
+ name: acm-edge-placement-binding
672+
+ namespace: open-cluster-management
672673
+ annotations:
673674
+ argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
674675
+placementRef:
@@ -685,6 +686,7 @@
685686
+kind: PlacementBinding
686687
+metadata:
687688
+ name: acm-provision-edge-placement-binding
689+
+ namespace: open-cluster-management
688690
+ annotations:
689691
+ argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
690692
+placementRef:
@@ -701,6 +703,7 @@
701703
+kind: PlacementBinding
702704
+metadata:
703705
+ name: openshift-gitops-placement-binding
706+
+ namespace: open-cluster-management
704707
+ annotations:
705708
+ argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
706709
+placementRef:
@@ -717,6 +720,7 @@
717720
+kind: PlacementRule
718721
+metadata:
719722
+ name: acm-edge-placement
723+
+ namespace: open-cluster-management
720724
+spec:
721725
+ clusterConditions:
722726
+ - status: 'True'
@@ -730,6 +734,7 @@
730734
+kind: PlacementRule
731735
+metadata:
732736
+ name: acm-provision-edge-placement
737+
+ namespace: open-cluster-management
733738
+spec:
734739
+ clusterConditions:
735740
+ - status: 'True'
@@ -743,6 +748,7 @@
743748
+kind: PlacementRule
744749
+metadata:
745750
+ name: openshift-gitops-placement
751+
+ namespace: open-cluster-management
746752
+spec:
747753
+ clusterConditions:
748754
+ - status: 'True'
@@ -760,6 +766,7 @@
760766
+kind: Policy
761767
+metadata:
762768
+ name: acm-edge-clustergroup-policy
769+
+ namespace: open-cluster-management
763770
+ annotations:
764771
+ argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
765772
+ argocd.argoproj.io/compare-options: IgnoreExtraneous
@@ -841,6 +848,7 @@
841848
+kind: Policy
842849
+metadata:
843850
+ name: acm-provision-edge-clustergroup-policy
851+
+ namespace: open-cluster-management
844852
+ annotations:
845853
+ argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
846854
+ argocd.argoproj.io/compare-options: IgnoreExtraneous
@@ -922,6 +930,7 @@
922930
+kind: Policy
923931
+metadata:
924932
+ name: openshift-gitops-policy
933+
+ namespace: open-cluster-management
925934
+ annotations:
926935
+ policy.open-cluster-management.io/standards: NIST-CSF
927936
+ policy.open-cluster-management.io/categories: PR.DS Data Security

0 commit comments

Comments
 (0)