Skip to content

Commit e516ae4

Browse files
fix: sample : missing t from the test makefile replace (#5986)
1 parent 63a2c3a commit e516ae4

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

hack/generate/samples/internal/go/v3/memcached_with_webhooks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (mh *Memcached) Run() {
107107
// https://github.com/operator-framework/operator-sdk/issues/5875
108108
err = kbutil.ReplaceInFile(filepath.Join(mh.ctx.Dir, "Makefile"),
109109
`curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN)`,
110-
`est -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }`,
110+
`test -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }`,
111111
)
112112
pkg.CheckError("replacing test target", err)
113113

testdata/go/v3/memcached-operator/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/k
170170
.PHONY: kustomize
171171
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
172172
$(KUSTOMIZE): $(LOCALBIN)
173-
est -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }
173+
test -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }
174174

175175
.PHONY: controller-gen
176176
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.

testdata/go/v3/memcached-operator/controllers/memcached_controller.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ func (r *MemcachedReconciler) deploymentForMemcached(m *cachev1alpha1.Memcached)
158158
// Ensure restrictive standard for the Pod.
159159
// More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
160160
SecurityContext: &corev1.PodSecurityContext{
161+
// WARNING: Ensure that the image used defines an UserID in the Dockerfile
162+
// otherwise the Pod will not run and will fail with "container has runAsNonRoot and image has non-numeric user"".
163+
// If you want your workloads admitted in namespaces enforced with the restricted mode in OpenShift/OKD vendors
164+
// then, you MUST ensure that the Dockerfile defines a User ID OR you MUST leave the "RunAsNonRoot" and
165+
// "RunAsUser" fields empty.
161166
RunAsNonRoot: &[]bool{true}[0],
162167
// Please ensure that you can use SeccompProfile and do NOT use
163168
// this field if your project must work on old Kubernetes
@@ -173,6 +178,11 @@ func (r *MemcachedReconciler) deploymentForMemcached(m *cachev1alpha1.Memcached)
173178
// Ensure restrictive context for the container
174179
// More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
175180
SecurityContext: &corev1.SecurityContext{
181+
// WARNING: Ensure that the image used defines an UserID in the Dockerfile
182+
// otherwise the Pod will not run and will fail with "container has runAsNonRoot and image has non-numeric user"".
183+
// If you want your workloads admitted in namespaces enforced with the restricted mode in OpenShift/OKD vendors
184+
// then, you MUST ensure that the Dockerfile defines a User ID OR you MUST leave the "RunAsNonRoot" and
185+
// "RunAsUser" fields empty.
176186
RunAsNonRoot: &[]bool{true}[0],
177187
AllowPrivilegeEscalation: &[]bool{false}[0],
178188
Capabilities: &corev1.Capabilities{

0 commit comments

Comments
 (0)