-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
- Loading branch information
1 parent
5a72331
commit a617c49
Showing
12 changed files
with
202 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
"program": "${workspaceFolder}", | ||
"args": [ | ||
"sidecar-injector", | ||
"--local" | ||
], | ||
} | ||
] | ||
|
10 changes: 10 additions & 0 deletions
10
charts/kyverno-envoy-plugin/templates/_helpers/_deployment.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
|
||
{{- define "kyverno.deployment.replicas" -}} | ||
{{- if and (not (kindIs "invalid" .)) (not (kindIs "string" .)) -}} | ||
{{- if eq (int .) 0 -}} | ||
{{- fail "Kyverno does not support running with 0 replicas. Please provide a non-zero integer value." -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- . -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package handlers | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"io" | ||
"net/http" | ||
|
||
admissionv1 "k8s.io/api/admission/v1" | ||
) | ||
|
||
func AdmissionReview(inner func(*admissionv1.AdmissionRequest) *admissionv1.AdmissionResponse) http.HandlerFunc { | ||
return func(writer http.ResponseWriter, request *http.Request) { | ||
if request.Body == nil { | ||
// HttpError(request.Context(), writer, request, logger, errors.New("empty body"), http.StatusBadRequest) | ||
return | ||
} | ||
defer request.Body.Close() | ||
body, err := io.ReadAll(request.Body) | ||
if err != nil { | ||
// HttpError(request.Context(), writer, request, logger, err, http.StatusBadRequest) | ||
return | ||
} | ||
contentType := request.Header.Get("Content-Type") | ||
if contentType != "application/json" { | ||
// HttpError(request.Context(), writer, request, logger, errors.New("invalid Content-Type"), http.StatusUnsupportedMediaType) | ||
return | ||
} | ||
fmt.Println(string(body)) | ||
var admissionReview admissionv1.AdmissionReview | ||
if err := json.Unmarshal(body, &admissionReview); err != nil { | ||
// HttpError(request.Context(), writer, request, logger, err, http.StatusExpectationFailed) | ||
return | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.