Skip to content

Commit 7a9227b

Browse files
authored
add ServiceAccountMembers & copy roles from sa (#42)
1 parent dba92ed commit 7a9227b

File tree

5 files changed

+219
-82
lines changed

5 files changed

+219
-82
lines changed

api/v1/namespacescope_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ type NamespaceScopeSpec struct {
3131
// Namespaces that are part of this scope
3232
NamespaceMembers []string `json:"namespaceMembers,omitempty"`
3333

34+
// ServiceAccountMembers are extra service accounts will be bond the roles from other namespaces
35+
ServiceAccountMembers []string `json:"serviceAccountMembers,omitempty"`
36+
3437
// ConfigMap name that will contain the list of namespaces to be watched
3538
ConfigmapName string `json:"configmapName,omitempty"`
3639

api/v1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/operator.ibm.com_namespacescopes.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ spec:
6060
description: Restart pods with the following labels when the namspace
6161
list changes
6262
type: object
63+
serviceAccountMembers:
64+
description: ServiceAccountMembers are extra service accounts will be
65+
bond the roles from other namespaces
66+
items:
67+
type: string
68+
type: array
6369
type: object
6470
status:
6571
description: NamespaceScopeStatus defines the observed state of NamespaceScope

controllers/constant/constants.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
package constant
1818

1919
const (
20-
NamespaceScopeManagedPrefix = "nss-managed-role-from-"
21-
NamespaceScopeConfigmapName = "namespace-scope"
22-
NamespaceScopeFinalizer = "finalizer.nss.operator.ibm.com"
23-
NamespaceScopeLabel = "managedby-namespace-scope"
24-
DefaultRestartLabelsKey = "intent"
25-
DefaultRestartLabelsValue = "projected"
20+
NamespaceScopeManagedPrefix = "nss-managed-role-from-"
21+
NamespaceScopeConfigmapName = "namespace-scope"
22+
NamespaceScopeFinalizer = "finalizer.nss.operator.ibm.com"
23+
NamespaceScopeLabel = "managedby-namespace-scope"
24+
DefaultRestartLabelsKey = "intent"
25+
DefaultRestartLabelsValue = "projected"
26+
NamespaceScopeServiceAccount = "ibm-namespace-scope-operator"
2627
)

0 commit comments

Comments
 (0)