Skip to content

Commit 19cbad4

Browse files
Fix#122 (#124)
* fixes#122 Signed-off-by: raffaelespazzoli <[email protected]> * fixed status Signed-off-by: raffaelespazzoli <[email protected]> * added docs Signed-off-by: raffaelespazzoli <[email protected]>
1 parent 84b1031 commit 19cbad4

File tree

6 files changed

+215
-108
lines changed

6 files changed

+215
-108
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ spec:
184184

185185
User will be selected by this `UserConfig` only if they login via the *okta-provider* and if the extra field was populate with the label `sandbox_enabled: "true"`. Note that not all authentication provider allow populating the extra fields in the Identity object.
186186
187+
## CR status
188+
189+
The CR status will display the outcome of the last reconcile cycle, plus any error regarding specific resources. Notice that in the past the operator was displaying also successful reconcile statuses for watched resources. Removing the status about successful resources allows for the operator to manage more resources with a single configuration (there is a limit to how big a CR can be).
190+
187191
## Deploying the Operator
188192
189193
This is a cluster-level operator that you can deploy in any namespace, `namespace-configuration-operator` is recommended.

config/manifests/bases/namespace-configuration-operator.clusterserviceversion.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ metadata:
1111
description: This operator provides a facility to define and enforce namespace
1212
configurations
1313
operatorframework.io/suggested-namespace: namespace-configuration-operator
14+
operators.openshift.io/infrastructure-features: '["Disconnected"]'
1415
repository: https://github.com/redhat-cop/namespace-configuration-operator
1516
support: Best Effort
16-
operators.openshift.io/infrastructure-features: '["Disconnected"]'
17-
name: namespace-configuration-operator.v0.0.0
18-
namespace: placeholder
1917
labels:
20-
operatorframework.io/os.linux: supported
2118
operatorframework.io/arch.amd64: supported
2219
operatorframework.io/arch.arm64: supported
2320
operatorframework.io/arch.ppc64le: supported
21+
operatorframework.io/os.linux: supported
22+
name: namespace-configuration-operator.v0.0.0
23+
namespace: placeholder
2424
spec:
2525
apiservicedefinitions: {}
2626
customresourcedefinitions:

controllers/userconfig_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ func (r *UserConfigReconciler) findApplicableUserConfigsFromUser(user *userv1.Us
224224
}
225225
matchingIdentities := []userv1.Identity{}
226226
for _, identity := range identitiesList.Items {
227-
matchingIdentities = append(matchingIdentities, identity)
227+
cidentity := identity.DeepCopy()
228+
matchingIdentities = append(matchingIdentities, *cidentity)
228229
}
229230
return r.findApplicableUserConfigsFromIdentities(user, matchingIdentities)
230231
}

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ require (
77
github.com/onsi/ginkgo v1.16.4
88
github.com/onsi/gomega v1.13.0
99
github.com/openshift/api v3.9.0+incompatible
10-
github.com/redhat-cop/operator-utils v1.1.4
10+
github.com/redhat-cop/operator-utils v1.2.2
1111
github.com/scylladb/go-set v1.0.2
12-
k8s.io/api v0.20.2
13-
k8s.io/apimachinery v0.20.2
14-
k8s.io/client-go v0.20.2
15-
sigs.k8s.io/controller-runtime v0.8.3
12+
k8s.io/api v0.21.2
13+
k8s.io/apimachinery v0.21.2
14+
k8s.io/client-go v0.21.2
15+
sigs.k8s.io/controller-runtime v0.9.2
1616
)

0 commit comments

Comments
 (0)