Skip to content

Commit 13ae104

Browse files
committed
truncate name with full suffix
1 parent 377b8ef commit 13ae104

File tree

5 files changed

+30
-23
lines changed

5 files changed

+30
-23
lines changed

.DS_Store

10 KB
Binary file not shown.

wiz-admission-controller/.helmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@
2121
.idea/
2222
*.tmproj
2323
.vscode/
24-

wiz-admission-controller/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type: application
77
# This is the chart version. This version number should be incremented each time you make changes
88
# to the chart and its templates, including the app version.
99
# Versions are expected to follow Semantic Versioning (https://semver.org/)
10-
version: 3.7.0
10+
version: 3.7.1
1111

1212
# This is the version number of the application being deployed. This version number should be
1313
# incremented each time you make changes to the application. Versions are not expected to

wiz-admission-controller/templates/_helpers.tpl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,32 @@ If release name contains chart name it will be used as a full name.
3434
{{- if .Values.kubernetesAuditLogsWebhook.nameOverride }}
3535
{{- .Values.kubernetesAuditLogsWebhook.nameOverride | trunc 63 | trimSuffix "-" }}
3636
{{- else }}
37-
{{- printf "%s-audit-log-collector" (include "wiz-admission-controller.fullname" .) | trunc 63 | trimSuffix "-" }}
37+
{{- $suffix := "-audit-log-collector" -}}
38+
{{- $maxLength := int (sub 63 (len $suffix)) -}}
39+
{{- printf "%s%s" (include "wiz-admission-controller.fullname" . | trunc $maxLength | trimSuffix "-") $suffix -}}
3840
{{- end }}
3941
{{- end }}
4042

4143
{{- define "wiz-admission-controller-manager.name" -}}
4244
{{- if .Values.wizManager.nameOverride }}
4345
{{- .Values.wizManager.nameOverride | trunc 63 | trimSuffix "-" }}
4446
{{- else }}
45-
{{- printf "%s-manager" (include "wiz-admission-controller.fullname" .) | trunc 52 | trimSuffix "-" }}
47+
{{- $suffix := "-manager" -}}
48+
{{- $maxLength := int (sub 52 (len $suffix)) -}}
49+
{{- printf "%s%s" (include "wiz-admission-controller.fullname" . | trunc $maxLength | trimSuffix "-") $suffix -}}
4650
{{- end }}
4751
{{- end }}
4852

4953
{{- define "wiz-hpa-enforcer.name" -}}
50-
{{- printf "%s-hpa" (include "wiz-admission-controller.fullname" .) | trunc 63 | trimSuffix "-" }}
54+
{{- $suffix := "-hpa" -}}
55+
{{- $maxLength := int (sub 63 (len $suffix)) -}}
56+
{{- printf "%s%s" (include "wiz-admission-controller.fullname" . | trunc $maxLength | trimSuffix "-") $suffix -}}
5157
{{- end }}
5258

5359
{{- define "wiz-hpa-audit-logs.name" -}}
54-
{{- printf "%s-hpa" (include "wiz-kubernetes-audit-log-collector.name" .) | trunc 63 | trimSuffix "-" }}
60+
{{- $suffix := "-hpa" -}}
61+
{{- $maxLength := int (sub 63 (len $suffix)) -}}
62+
{{- printf "%s%s" (include "wiz-kubernetes-audit-log-collector.name" . | trunc $maxLength | trimSuffix "-") $suffix -}}
5563
{{- end }}
5664

5765
{{/*

wiz-admission-controller/values.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ wizApiToken:
2222
annotations: {}
2323
# The name of the Wiz Service Account Secret.
2424
name: ""
25-
25+
2626
# API token should be read from an environment file, which is specified in podCustomEnvironmentVariablesFile
2727
usePodCustomEnvironmentVariablesFile: false
2828

@@ -49,7 +49,7 @@ replicaCount: 2
4949
# https://kubernetes.io/docs/tasks/run-application/configure-pdb/
5050
podDisruptionBudget:
5151
enabled: false # Should a PodDisruptionBudget be created by the chart or not.
52-
minAvailable: 1
52+
minAvailable: 1
5353
maxUnavailable: null
5454

5555
image:
@@ -150,17 +150,17 @@ opaWebhook:
150150
#
151151
sideEffects: None # https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#side-effects
152152

153-
policies: [] # List of policies to enforce on the misconfiguration webhook. If not set, by default AC will get policies from Wiz based on projects.
154-
153+
policies: [] # List of policies to enforce on the misconfiguration webhook. If not set, by default AC will get policies from Wiz based on projects.
154+
155155
# Deprecated, don't use!
156156
errorEnforcementMethod: "" # Deprecated, use `webhook.errorEnforcementMethod` instead
157157
policyEnforcementMethod: "" # Deprecated, use `webhook.policyEnforcementMethod` instead
158158
clusterExternalId: "" # Deprecated, use `webhook.clusterExternalId` instead
159159
secret: # Deprecated, use `webhook.secret` instead
160-
annotations: {}
160+
annotations: {}
161161

162162
imageIntegrityWebhook:
163-
enabled: false
163+
enabled: false
164164
policies: [] # List of policies to enforce on the image integrity webhook. If not set, by default AC will get policies from Wiz based on projects.
165165

166166
# Override to run admission controller on specific resources.
@@ -199,7 +199,7 @@ imageIntegrityWebhook:
199199

200200
# This webhooks sends the audit logs to Wiz, and should never block any requests.
201201
kubernetesAuditLogsWebhook:
202-
enabled: false
202+
enabled: false
203203

204204
nameOverride: "" # Override the audit logs deployment name.
205205
replicaCount: 2
@@ -316,18 +316,18 @@ debugWebhook:
316316
# The following values are used for image integrity webhook.
317317
imageRegistryClient:
318318
# Should a Role and RoleBinding be created by the chart or not.
319-
createRole: true
319+
createRole: true
320320
# Secret names for container image registry as described in https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry
321-
pullSecrets: []
321+
pullSecrets: []
322322
# Namespace of the pull secrets.
323-
secretsNamespace: "default"
324-
# List of credential helpers to use, Can be one of amazon, azure, google, github.
323+
secretsNamespace: "default"
324+
# List of credential helpers to use, Can be one of amazon, azure, google, github.
325325
credentialHelpers: []
326326
# The interval of the background reloader cache for image pull secrets. The cache is used to avoid querying the cluster for the same image pull secrets multiple times.
327-
cacheImagePullSecretsInterval: 5m
327+
cacheImagePullSecretsInterval: 5m
328328
# Ignore missing secret error on startup, the admission controller will continue to run without the secret value and tries to fetch the secret every cacheImagePullSecretsInterval.
329329
# Useful when the secret is not available at the time of startup.
330-
ignoreMissingSecretError: false
330+
ignoreMissingSecretError: false
331331

332332
kubernetesApiServer:
333333
cacheNamespaceLabelsTTL: 10m # The interval of the background reloder cache for namespace labels. The cache is used to avoid querying cluster for the same namespace multiple times.
@@ -422,7 +422,7 @@ probes: # Probes config for the container
422422
initialDelaySeconds: 5
423423
timeoutSeconds: 300 # 5 minutes
424424
failureThreshold: 30 # 10s(default) * 30 attempts = 300 seconds for it to finish
425-
425+
426426
readinessProbe:
427427
initialDelaySeconds: 5
428428
periodSeconds: 5
@@ -485,11 +485,11 @@ global:
485485

486486
# Wiz Service Account used to authenticate to Wiz.
487487
wizApiToken:
488-
clientId: ""
488+
clientId: ""
489489
clientToken: ""
490490
clientEndpoint: "" # Defaults to commercial.
491491
# If `global.isFedRamp` is `true`, this field gets automatically set to `fedramp`.
492-
492+
493493
secret:
494494
# The name of the Wiz Service Account Secret.
495495
name: ""
@@ -498,7 +498,7 @@ global:
498498
httpProxyConfiguration:
499499
enabled: false # Should the components use a proxy.
500500
secretName: "" # The name of the proxy Secret.
501-
501+
502502
httpProxy: ""
503503
httpsProxy: ""
504504
noProxyAddress: ""

0 commit comments

Comments
 (0)