Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove resource kind from resource names #329

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove "-secret" suffix
lindhe committed Nov 11, 2023
commit 277f19e4bf1ea8fcd7b797c431010be64c7a44bb
2 changes: 1 addition & 1 deletion charts/core/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
@@ -260,7 +260,7 @@ spec:
{{- if .Values.autoGenerateCert }}
- name: cert
secret:
secretName: neuvector-controller-secret
secretName: neuvector-controller
{{- end }}
{{- if .Values.controller.certificate.secret }}
- name: usercert
6 changes: 3 additions & 3 deletions charts/core/templates/controller-secret.yaml
Original file line number Diff line number Diff line change
@@ -5,11 +5,11 @@
apiVersion: v1
kind: Secret
metadata:
name: neuvector-controller-secret
name: neuvector-controller
type: Opaque
data:
ssl-cert.key: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-controller-secret" "key" "ssl-cert.key" "defaultValue" $cert.Key) }}
ssl-cert.pem: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-controller-secret" "key" "ssl-cert.pem" "defaultValue" $cert.Cert) }}
ssl-cert.key: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-controller" "key" "ssl-cert.key" "defaultValue" $cert.Key) }}
ssl-cert.pem: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-controller" "key" "ssl-cert.pem" "defaultValue" $cert.Cert) }}
---
{{- end}}
{{- end}}
2 changes: 1 addition & 1 deletion charts/core/templates/manager-deployment.yaml
Original file line number Diff line number Diff line change
@@ -129,6 +129,6 @@ spec:
{{- else if .Values.autoGenerateCert }}
- name: cert
secret:
secretName: neuvector-manager-secret
secretName: neuvector-manager
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/core/templates/manager-secret.yaml
Original file line number Diff line number Diff line change
@@ -5,11 +5,11 @@
apiVersion: v1
kind: Secret
metadata:
name: neuvector-manager-secret
name: neuvector-manager
type: Opaque
data:
ssl-cert.key: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-manager-secret" "key" "ssl-cert.key" "defaultValue" $cert.Key) }}
ssl-cert.pem: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-manager-secret" "key" "ssl-cert.pem" "defaultValue" $cert.Cert) }}
ssl-cert.key: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-manager" "key" "ssl-cert.key" "defaultValue" $cert.Key) }}
ssl-cert.pem: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-manager" "key" "ssl-cert.pem" "defaultValue" $cert.Cert) }}
---
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/core/templates/registry-adapter-secret.yaml
Original file line number Diff line number Diff line change
@@ -5,11 +5,11 @@
apiVersion: v1
kind: Secret
metadata:
name: neuvector-registry-adapter-secret
name: neuvector-registry-adapter
type: Opaque
data:
ssl-cert.key: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-registry-adapter-secret" "key" "ssl-cert.key" "defaultValue" $cert.Key) }}
ssl-cert.pem: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-registry-adapter-secret" "key" "ssl-cert.pem" "defaultValue" $cert.Cert) }}
ssl-cert.key: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-registry-adapter" "key" "ssl-cert.key" "defaultValue" $cert.Key) }}
ssl-cert.pem: {{ include "neuvector.secrets.lookup" (dict "namespace" .Release.Namespace "secret" "neuvector-registry-adapter" "key" "ssl-cert.pem" "defaultValue" $cert.Cert) }}
---
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/core/templates/registry-adapter.yaml
Original file line number Diff line number Diff line change
@@ -150,7 +150,7 @@ spec:
{{- else if .Values.autoGenerateCert }}
- name: cert
secret:
secretName: neuvector-registry-adapter-secret
secretName: neuvector-registry-adapter
{{- end }}
{{- if .Values.internal.certmanager.enabled }}
- name: internal-cert
2 changes: 1 addition & 1 deletion charts/monitor/templates/exporter-deployment.yaml
Original file line number Diff line number Diff line change
@@ -51,6 +51,6 @@ spec:
value: "8068"
envFrom:
- secretRef:
name: neuvector-prometheus-exporter-pod-secret
name: neuvector-prometheus-exporter-pod
restartPolicy: Always
{{- end }}
2 changes: 1 addition & 1 deletion charts/monitor/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: neuvector-prometheus-exporter-pod-secret
name: neuvector-prometheus-exporter-pod
namespace: {{ .Release.Namespace }}
labels:
chart: {{ template "neuvector.chart" . }}
20 changes: 10 additions & 10 deletions test/deployment_test.go
Original file line number Diff line number Diff line change
@@ -304,7 +304,7 @@ func TestControllerSecrets(t *testing.T) {
for _, output := range outs {
var secret corev1.Secret
helm.UnmarshalK8SYaml(t, output, &secret)
if secret.Name == "neuvector-controller-secret" {
if secret.Name == "neuvector-controller" {
assert.NotNil(t, secret.Data)
assert.NotEmpty(t, secret.Data["ssl-cert.key"])
assert.NotEmpty(t, secret.Data["ssl-cert.pem"])
@@ -327,7 +327,7 @@ func TestControllerSecrets(t *testing.T) {
Name: "cert",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "neuvector-controller-secret",
SecretName: "neuvector-controller",
},
},
})
@@ -344,7 +344,7 @@ func TestControllerSecrets(t *testing.T) {
Name: "cert",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "neuvector-controller-secret",
SecretName: "neuvector-controller",
},
},
})
@@ -353,7 +353,7 @@ func TestControllerSecrets(t *testing.T) {
Name: "usercert",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "nv-ssl-secret",
SecretName: "nv-ssl",
},
},
})
@@ -402,7 +402,7 @@ func TestControllerNoSecrets(t *testing.T) {
for _, output := range outs {
var secret corev1.Secret
helm.UnmarshalK8SYaml(t, output, &secret)
assert.NotEqual(t, "neuvector-controller-secret", secret.Name)
assert.NotEqual(t, "neuvector-controller", secret.Name)
}

for _, output := range outs {
@@ -415,7 +415,7 @@ func TestControllerNoSecrets(t *testing.T) {
Name: "cert",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "neuvector-controller-secret",
SecretName: "neuvector-controller",
},
},
})
@@ -424,7 +424,7 @@ func TestControllerNoSecrets(t *testing.T) {
Name: "usercert",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "nv-ssl-secret",
SecretName: "nv-ssl",
},
},
})
@@ -458,7 +458,7 @@ func TestControllerWithOnlySSLKeys(t *testing.T) {

options := &helm.Options{
SetValues: map[string]string{
"controller.certificate.secret": "nv-ssl-secret",
"controller.certificate.secret": "nv-ssl",
"controller.certificate.keyFile": "key3.pem",
"controller.certificate.pemFile": "cert3.pem",
},
@@ -481,7 +481,7 @@ func TestControllerWithOnlySSLKeys(t *testing.T) {
Name: "cert",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "neuvector-controller-secret",
SecretName: "neuvector-controller",
},
},
})
@@ -490,7 +490,7 @@ func TestControllerWithOnlySSLKeys(t *testing.T) {
Name: "usercert",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "nv-ssl-secret",
SecretName: "nv-ssl",
},
},
})