Skip to content

Commit

Permalink
Fix sanity tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo2308 committed May 3, 2024
1 parent 392aae0 commit 59295f4
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 33 deletions.
2 changes: 1 addition & 1 deletion hack/generate/samples/ansible/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func addingAnsibleTask(dir string, gvk schema.GroupVersionKind) {
// Makefile to the version specified
func replaceKustomizeVersion(dir string, version string) {
err := kbutil.ReplaceInFile(filepath.Join(dir, "Makefile"),
"curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.1.1/kustomize_v5.1.1_$(OS)_$(ARCH).tar.gz | \\",
"curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.3.0/kustomize_v5.3.0_$(OS)_$(ARCH).tar.gz | \\",
fmt.Sprintf("curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/%s/kustomize_%s_$(OS)_$(ARCH).tar.gz | \\", version, version))
pkg.CheckError(fmt.Sprintf("replacing kustomize version to %s", version), err)
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (f *ManagerRole) SetTemplateDefaults() error {
}

f.TemplateBody = fmt.Sprintf(roleTemplate, machinery.NewMarkerFor(f.Path, rulesMarker))

f.IfExistsAction = machinery.OverwriteFile
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/plugins/util/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ func UpdateKustomizationsInit() error {
`
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- manager_webhook_patch.yaml
#- path: manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
#- webhookcainjection_patch.yaml
#- path: webhookcainjection_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
- ../prometheus

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


- path: manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
- "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
- "ALL"
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Prometheus Monitor Service (Metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/instance: controller-manager-sa
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: memcached-molecule-operator
app.kubernetes.io/part-of: memcached-molecule-operator
app.kubernetes.io/name: memcached-molecule-operator
app.kubernetes.io/managed-by: kustomize
name: controller-manager
namespace: system
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ apiVersion: cache.example.com/v1alpha1
kind: Foo
metadata:
labels:
app.kubernetes.io/name: foo
app.kubernetes.io/instance: foo-sample
app.kubernetes.io/part-of: memcached-molecule-operator
app.kubernetes.io/name: memcached-molecule-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: memcached-molecule-operator
name: foo-sample
spec:
foo: bar
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ apiVersion: cache.example.com/v1alpha1
kind: Memcached
metadata:
labels:
app.kubernetes.io/name: memcached
app.kubernetes.io/instance: memcached-sample
app.kubernetes.io/part-of: memcached-molecule-operator
app.kubernetes.io/name: memcached-molecule-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: memcached-molecule-operator
name: memcached-sample
spec:
size: 1
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ apiVersion: cache.example.com/v1alpha1
kind: Memfin
metadata:
labels:
app.kubernetes.io/name: memfin
app.kubernetes.io/instance: memfin-sample
app.kubernetes.io/part-of: memcached-molecule-operator
app.kubernetes.io/name: memcached-molecule-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: memcached-molecule-operator
name: memfin-sample
spec:
foo: bar
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ apiVersion: ignore.example.com/v1
kind: Secret
metadata:
labels:
app.kubernetes.io/name: secret
app.kubernetes.io/instance: secret-sample
app.kubernetes.io/part-of: memcached-molecule-operator
app.kubernetes.io/name: memcached-molecule-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: memcached-molecule-operator
name: secret-sample
spec:
# TODO(user): Add fields here

0 comments on commit 59295f4

Please sign in to comment.