Skip to content

Commit de0de3d

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/website/docusaurus/preset-classic-3.10.0
2 parents 28692c5 + c344f99 commit de0de3d

45 files changed

Lines changed: 1206 additions & 426 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ KIND_VERSION ?= 0.29.0
3131
KIND_CLUSTER_FILE ?= ""
3232
# note: k8s version pinned since KIND image availability lags k8s releases
3333
KUBERNETES_VERSION ?= 1.33.0
34-
KUSTOMIZE_VERSION ?= 3.8.9
34+
KUSTOMIZE_VERSION ?= 5.6.0
3535
BATS_VERSION ?= 1.13.0
3636
ORAS_VERSION ?= 1.3.1
3737
BATS_TESTS_FILE ?= test/bats/test.bats
@@ -400,7 +400,7 @@ manifests: __controller-gen
400400
/gatekeeper/config/default -o /gatekeeper/manifest_staging/deploy/gatekeeper.yaml
401401
docker run --rm -v $(shell pwd):/gatekeeper \
402402
registry.k8s.io/kustomize/kustomize:v${KUSTOMIZE_VERSION} build \
403-
--load_restrictor LoadRestrictionsNone /gatekeeper/cmd/build/helmify | go run cmd/build/helmify/*.go
403+
--load-restrictor LoadRestrictionsNone /gatekeeper/cmd/build/helmify | go run cmd/build/helmify/*.go
404404

405405
# lint runs a dockerized golangci-lint, and should give consistent results
406406
# across systems.

cmd/build/helmify/delete-ports.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ spec:
1010
- name: manager
1111
ports:
1212
- containerPort: 8888
13+
protocol: TCP
1314
$patch: delete
1415
- containerPort: 8443
16+
protocol: TCP
1517
$patch: delete
1618
- containerPort: 9090
19+
protocol: TCP
1720
$patch: delete
1821
---
1922
kind: Deployment
@@ -28,6 +31,8 @@ spec:
2831
- name: manager
2932
ports:
3033
- containerPort: 8888
34+
protocol: TCP
3135
$patch: delete
3236
- containerPort: 9090
37+
protocol: TCP
3338
$patch: delete

cmd/build/helmify/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ commonLabels:
44
chart: '{{ template "gatekeeper.name" . }}'
55
release: "{{ .Release.Name }}"
66
heritage: "{{ .Release.Service }}"
7-
bases:
7+
resources:
88
- "../../../config/default"
99
patchesStrategicMerge:
1010
- kustomize-for-helm.yaml

cmd/build/helmify/kustomize-for-helm.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ spec:
276276
apiVersion: v1
277277
kind: Secret
278278
metadata:
279-
annotations: HELMSUBST_SECRET_ANNOTATIONS
279+
annotations:
280+
HELMSUBST_SECRET_ANNOTATIONS: ""
280281
name: gatekeeper-webhook-server-cert
281282
namespace: gatekeeper-system
282283
---
@@ -286,7 +287,8 @@ metadata:
286287
labels:
287288
gatekeeper.sh/system: "yes"
288289
name: gatekeeper-mutating-webhook-configuration
289-
annotations: HELMSUBST_MUTATING_WEBHOOK_ANNOTATIONS
290+
annotations:
291+
HELMSUBST_MUTATING_WEBHOOK_ANNOTATIONS: ""
290292
webhooks:
291293
- clientConfig:
292294
service:
@@ -315,7 +317,8 @@ metadata:
315317
labels:
316318
gatekeeper.sh/system: "yes"
317319
name: gatekeeper-validating-webhook-configuration
318-
annotations: HELMSUBST_VALIDATING_WEBHOOK_ANNOTATIONS
320+
annotations:
321+
HELMSUBST_VALIDATING_WEBHOOK_ANNOTATIONS: ""
319322
webhooks:
320323
- clientConfig:
321324
service:

cmd/build/helmify/replacements.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ var replacements = map[string]string{
110110

111111
"- HELMSUBST_DEPLOYMENT_AUDIT_LOG_STATS_ADMISSION": `{{ if hasKey .Values "logStatsAudit" }}- --log-stats-audit={{ .Values.logStatsAudit }}{{- end }}`,
112112

113-
"HELMSUBST_SECRET_ANNOTATIONS": `{{- toYaml .Values.secretAnnotations | trim | nindent 4 }}`,
113+
`HELMSUBST_SECRET_ANNOTATIONS: ""`: `{{- toYaml .Values.secretAnnotations | trim | nindent 4 }}`,
114114

115115
"- HELMSUBST_TLS_HEALTHCHECK_ENABLED_ARG": `{{ if .Values.enableTLSHealthcheck}}- --enable-tls-healthcheck{{- end }}`,
116116

@@ -159,7 +159,7 @@ var replacements = map[string]string{
159159

160160
"HELMSUBST_MUTATING_WEBHOOK_REINVOCATION_POLICY": `{{ .Values.mutatingWebhookReinvocationPolicy }}`,
161161

162-
"HELMSUBST_MUTATING_WEBHOOK_ANNOTATIONS": `{{- toYaml .Values.mutatingWebhookAnnotations | trim | nindent 4 }}`,
162+
`HELMSUBST_MUTATING_WEBHOOK_ANNOTATIONS: ""`: `{{- toYaml .Values.mutatingWebhookAnnotations | trim | nindent 4 }}`,
163163

164164
"- HELMSUBST_MUTATING_WEBHOOK_EXEMPT_NAMESPACE_LABELS": `
165165
{{- /* 1. Get mandatory exemption from helper */ -}}
@@ -216,7 +216,7 @@ var replacements = map[string]string{
216216

217217
"HELMSUBST_VALIDATING_WEBHOOK_FAILURE_POLICY": `{{ .Values.validatingWebhookFailurePolicy }}`,
218218

219-
"HELMSUBST_VALIDATING_WEBHOOK_ANNOTATIONS": `{{- toYaml .Values.validatingWebhookAnnotations | trim | nindent 4 }}`,
219+
`HELMSUBST_VALIDATING_WEBHOOK_ANNOTATIONS: ""`: `{{- toYaml .Values.validatingWebhookAnnotations | trim | nindent 4 }}`,
220220

221221
"HELMSUBST_VALIDATING_WEBHOOK_MATCHEXPRESSION_METADATANAME": `key: kubernetes.io/metadata.name
222222
operator: NotIn

cmd/gator/test/test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func run(_ *cobra.Command, _ []string) {
8989
cmdutils.ErrFatalf("no input data identified")
9090
}
9191

92-
var printBuf bytes.Buffer
92+
printBuf := gator.NewPrintBuffer(gator.DefaultPrintBufferLimit)
9393

9494
var opts []gator.Opt
9595
if flagIncludeTrace {
@@ -102,7 +102,7 @@ func run(_ *cobra.Command, _ []string) {
102102
opts = append(opts, test.WithK8sCEL(flagGatherStats))
103103
}
104104
if flagVerbose {
105-
opts = append(opts, gator.WithPrintHook(&printBuf))
105+
opts = append(opts, gator.WithPrintHook(printBuf))
106106
}
107107

108108
responses, err := test.Test(unstrucs, opts...)

config/default/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namePrefix: gatekeeper-
1212
commonLabels:
1313
gatekeeper.sh/system: "yes"
1414

15-
bases:
15+
resources:
1616
- ../crd
1717
- ../rbac
1818
- ../manager

main.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,22 @@ func innerMain() int {
305305
return 1
306306
}
307307

308-
// only setup healthcheck when flag is set and available webhook count > 0
309-
if len(webhooks) > 0 && *enableTLSHealthcheck {
310-
tlsChecker := webhook.NewTLSChecker(*certDir, *port)
311-
setupLog.Info("setting up TLS healthcheck probe")
312-
if err := mgr.AddHealthzCheck("tls-check", tlsChecker); err != nil {
313-
setupLog.Error(err, "unable to create tls health check")
308+
if len(webhooks) > 0 {
309+
tlsChecker := webhook.NewTLSChecker(*certDir, *host, *port)
310+
setupLog.Info("setting up TLS readiness probe")
311+
if err := mgr.AddReadyzCheck("tls-check", tlsChecker); err != nil {
312+
setupLog.Error(err, "unable to create tls readiness check")
314313
return 1
315314
}
315+
316+
// only setup healthcheck when flag is set
317+
if *enableTLSHealthcheck {
318+
setupLog.Info("setting up TLS healthcheck probe")
319+
if err := mgr.AddHealthzCheck("tls-check", tlsChecker); err != nil {
320+
setupLog.Error(err, "unable to create tls health check")
321+
return 1
322+
}
323+
}
316324
}
317325

318326
// Setup controllers asynchronously, they will block for certificate generation if needed.

0 commit comments

Comments
 (0)