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

fix: NVSHAS-8682 remove misplaced resc from crds #453

Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion charts/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ Parameter | Description | Default | Notes
`bottlerocket.enabled` | Set to true if using AWS bottlerocket | `false` | Deprecated in 5.3.0.
`bottlerocket.runtimePath` | If bottlerocket is enabled, this local containerd socket path will be used | `/run/dockershim.sock` | Deprecated in 5.3.0.
`admissionwebhook.type` | admission webhook type | `ClusterIP` |
`crdwebhook.enabled` | Enable crd service and create crd related resources | `true` |
`crdwebhooksvc.enabled` | Enable crd service | `true` |
`crdwebhook.enabled` | Create crd resources | `true` |
`crdwebhook.type` | crd webhook type | `ClusterIP` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
Expand Down
19 changes: 19 additions & 0 deletions charts/core/templates/crd-webhook-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.crdwebhooksvc.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: neuvector-svc-crd-webhook
namespace: {{ .Release.Namespace }}
labels:
chart: {{ template "neuvector.chart" . }}
release: {{ .Release.Name }}
spec:
ports:
- port: 443
targetPort: 30443
protocol: TCP
name: crd-webhook
type: {{ .Values.crdwebhook.type }}
selector:
app: neuvector-controller-pod
{{- end }}
18 changes: 0 additions & 18 deletions charts/core/templates/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -974,22 +974,4 @@ spec:
type: object
type: object
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: neuvector-svc-crd-webhook
namespace: {{ .Release.Namespace }}
labels:
chart: {{ template "neuvector.chart" . }}
release: {{ .Release.Name }}
spec:
ports:
- port: 443
targetPort: 30443
protocol: TCP
name: crd-webhook
type: {{ .Values.crdwebhook.type }}
selector:
app: neuvector-controller-pod
{{- end }}
3 changes: 3 additions & 0 deletions charts/core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,9 @@ crio:
admissionwebhook:
type: ClusterIP

crdwebhooksvc:
enabled: true

crdwebhook:
enabled: true
type: ClusterIP
19 changes: 0 additions & 19 deletions charts/crd/templates/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -980,22 +980,3 @@ spec:
type: object
type: object
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: neuvector-svc-crd-webhook
namespace: {{ .Release.Namespace }}
labels:
chart: {{ template "neuvector.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
ports:
- port: 443
targetPort: 30443
protocol: TCP
name: crd-webhook
type: {{ .Values.crdwebhook.type }}
selector:
app: neuvector-controller-pod
4 changes: 2 additions & 2 deletions test/crd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestCRD(t *testing.T) {
out := helm.RenderTemplate(t, options, helmChartPath, nvRel, []string{"templates/crd.yaml"})
outs := splitYaml(out)

if len(outs) != 8 {
if len(outs) != 7 {
t.Errorf("Resource count is wrong. count=%v\n", len(outs))
}
}
Expand All @@ -33,7 +33,7 @@ func TestCoreCRD(t *testing.T) {
out := helm.RenderTemplate(t, options, helmChartPath, nvRel, []string{"templates/crd.yaml"})
outs := splitYaml(out)

if len(outs) != 8 {
if len(outs) != 7 {
t.Errorf("Resource count is wrong. count=%v\n", len(outs))
}
}
Expand Down
Loading