Log Output Updates

This commit is contained in:
nhyatt committed 2023-03-18 12:27:29 -05:00
1 parent 3f60d34155
commit a8f35ee53d
3 files changed
+6 -3

No files matched your search

+4 -1
View File
@@ -1,6 +1,7 @@
package operations
import (
"log"
"strings"
admission "k8s.io/api/admission/v1"
@@ -21,7 +22,9 @@ func podValidationCreate() AdmitFunc {
for _, c := range pod.Spec.Containers {
if strings.HasSuffix(c.Image, ":latest") {
return &Result{Msg: "You cannot use the tag 'latest' in a container."}, nil
msg := "You cannot use the tag 'latest' in a container."
log.Printf("[TRACE] Request Rejectd: %s", msg)
return &Result{Msg: msg}, nil
}
}