Skip to content

Commit 59295f4

Browse files
committed
Fix sanity tests
1 parent 392aae0 commit 59295f4

File tree

12 files changed

+14
-33
lines changed

12 files changed

+14
-33
lines changed

hack/generate/samples/ansible/memcached.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func addingAnsibleTask(dir string, gvk schema.GroupVersionKind) {
8282
// Makefile to the version specified
8383
func replaceKustomizeVersion(dir string, version string) {
8484
err := kbutil.ReplaceInFile(filepath.Join(dir, "Makefile"),
85-
"curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.1.1/kustomize_v5.1.1_$(OS)_$(ARCH).tar.gz | \\",
85+
"curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.3.0/kustomize_v5.3.0_$(OS)_$(ARCH).tar.gz | \\",
8686
fmt.Sprintf("curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/%s/kustomize_%s_$(OS)_$(ARCH).tar.gz | \\", version, version))
8787
pkg.CheckError(fmt.Sprintf("replacing kustomize version to %s", version), err)
8888
}

pkg/plugins/ansible/v1/scaffolds/internal/templates/config/rbac/role.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (f *ManagerRole) SetTemplateDefaults() error {
3939
}
4040

4141
f.TemplateBody = fmt.Sprintf(roleTemplate, machinery.NewMarkerFor(f.Path, rulesMarker))
42-
42+
f.IfExistsAction = machinery.OverwriteFile
4343
return nil
4444
}
4545

pkg/plugins/util/cleanup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ func UpdateKustomizationsInit() error {
7676
`
7777
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
7878
# crd/kustomization.yaml
79-
#- manager_webhook_patch.yaml
79+
#- path: manager_webhook_patch.yaml
8080
8181
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
8282
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
8383
# 'CERTMANAGER' needs to be enabled to use ca injection
84-
#- webhookcainjection_patch.yaml
84+
#- path: webhookcainjection_patch.yaml
8585
8686
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
8787
# Uncomment the following replacements to add the cert-manager CA injection annotations

testdata/memcached-molecule-operator/config/default/kustomization.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ resources:
2121
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2222
- ../prometheus
2323

24-
patchesStrategicMerge:
24+
patches:
2525
# Protect the /metrics endpoint by putting it behind auth.
2626
# If you want your controller-manager to expose the /metrics
2727
# endpoint w/o any authn/z, please comment the following line.
28-
- manager_auth_proxy_patch.yaml
29-
30-
28+
- path: manager_auth_proxy_patch.yaml

testdata/memcached-molecule-operator/config/default/manager_auth_proxy_patch.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ spec:
1414
allowPrivilegeEscalation: false
1515
capabilities:
1616
drop:
17-
- "ALL"
18-
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
17+
- "ALL"
18+
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
1919
args:
2020
- "--secure-listen-address=0.0.0.0:8443"
2121
- "--upstream=http://127.0.0.1:8080/"

testdata/memcached-molecule-operator/config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ spec:
7878
allowPrivilegeEscalation: false
7979
capabilities:
8080
drop:
81-
- "ALL"
81+
- "ALL"
8282
livenessProbe:
8383
httpGet:
8484
path: /healthz

testdata/memcached-molecule-operator/config/prometheus/monitor.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Prometheus Monitor Service (Metrics)
32
apiVersion: monitoring.coreos.com/v1
43
kind: ServiceMonitor

testdata/memcached-molecule-operator/config/rbac/service_account.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ apiVersion: v1
22
kind: ServiceAccount
33
metadata:
44
labels:
5-
app.kubernetes.io/name: serviceaccount
6-
app.kubernetes.io/instance: controller-manager-sa
7-
app.kubernetes.io/component: rbac
8-
app.kubernetes.io/created-by: memcached-molecule-operator
9-
app.kubernetes.io/part-of: memcached-molecule-operator
5+
app.kubernetes.io/name: memcached-molecule-operator
106
app.kubernetes.io/managed-by: kustomize
117
name: controller-manager
128
namespace: system

testdata/memcached-molecule-operator/config/samples/cache_v1alpha1_foo.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ apiVersion: cache.example.com/v1alpha1
22
kind: Foo
33
metadata:
44
labels:
5-
app.kubernetes.io/name: foo
6-
app.kubernetes.io/instance: foo-sample
7-
app.kubernetes.io/part-of: memcached-molecule-operator
5+
app.kubernetes.io/name: memcached-molecule-operator
86
app.kubernetes.io/managed-by: kustomize
9-
app.kubernetes.io/created-by: memcached-molecule-operator
107
name: foo-sample
118
spec:
129
foo: bar

testdata/memcached-molecule-operator/config/samples/cache_v1alpha1_memcached.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ apiVersion: cache.example.com/v1alpha1
22
kind: Memcached
33
metadata:
44
labels:
5-
app.kubernetes.io/name: memcached
6-
app.kubernetes.io/instance: memcached-sample
7-
app.kubernetes.io/part-of: memcached-molecule-operator
5+
app.kubernetes.io/name: memcached-molecule-operator
86
app.kubernetes.io/managed-by: kustomize
9-
app.kubernetes.io/created-by: memcached-molecule-operator
107
name: memcached-sample
118
spec:
129
size: 1

testdata/memcached-molecule-operator/config/samples/cache_v1alpha1_memfin.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ apiVersion: cache.example.com/v1alpha1
22
kind: Memfin
33
metadata:
44
labels:
5-
app.kubernetes.io/name: memfin
6-
app.kubernetes.io/instance: memfin-sample
7-
app.kubernetes.io/part-of: memcached-molecule-operator
5+
app.kubernetes.io/name: memcached-molecule-operator
86
app.kubernetes.io/managed-by: kustomize
9-
app.kubernetes.io/created-by: memcached-molecule-operator
107
name: memfin-sample
118
spec:
129
foo: bar

testdata/memcached-molecule-operator/config/samples/ignore_v1_secret.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ apiVersion: ignore.example.com/v1
22
kind: Secret
33
metadata:
44
labels:
5-
app.kubernetes.io/name: secret
6-
app.kubernetes.io/instance: secret-sample
7-
app.kubernetes.io/part-of: memcached-molecule-operator
5+
app.kubernetes.io/name: memcached-molecule-operator
86
app.kubernetes.io/managed-by: kustomize
9-
app.kubernetes.io/created-by: memcached-molecule-operator
107
name: secret-sample
118
spec:
129
# TODO(user): Add fields here

0 commit comments

Comments
 (0)