mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-22 07:28:06 +00:00
Addressing pr comments
This commit is contained in:
@@ -226,6 +226,12 @@ func (whsvr *WebhookServer) mutate(ar *v1beta1.AdmissionReview) *v1beta1.Admissi
|
|||||||
|
|
||||||
containers := map[string]struct{}{}
|
containers := map[string]struct{}{}
|
||||||
|
|
||||||
|
if containersStr == "" {
|
||||||
|
glog.Infof("No mutations made for %s/%s", pod.Namespace, pod.Name)
|
||||||
|
return &v1beta1.AdmissionResponse{
|
||||||
|
Allowed: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
for _, container := range strings.Split(containersStr, ",") {
|
for _, container := range strings.Split(containersStr, ",") {
|
||||||
containers[container] = struct{}{}
|
containers[container] = struct{}{}
|
||||||
}
|
}
|
||||||
@@ -280,6 +286,13 @@ func (whsvr *WebhookServer) mutate(ar *v1beta1.AdmissionReview) *v1beta1.Admissi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !mutated {
|
||||||
|
glog.Infof("No mutations made for %s/%s", pod.Namespace, pod.Name)
|
||||||
|
return &v1beta1.AdmissionResponse{
|
||||||
|
Allowed: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// binInitContainer is the container that pulls the OP CLI
|
// binInitContainer is the container that pulls the OP CLI
|
||||||
// into a shared volume mount.
|
// into a shared volume mount.
|
||||||
var binInitContainer = corev1.Container{
|
var binInitContainer = corev1.Container{
|
||||||
@@ -296,12 +309,6 @@ func (whsvr *WebhookServer) mutate(ar *v1beta1.AdmissionReview) *v1beta1.Admissi
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if !mutated {
|
|
||||||
glog.Infof("No mutations made for %s/%s", pod.Namespace, pod.Name)
|
|
||||||
return &v1beta1.AdmissionResponse{
|
|
||||||
Allowed: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
annotations := map[string]string{injectionStatus: "injected"}
|
annotations := map[string]string{injectionStatus: "injected"}
|
||||||
patchBytes, err := createOPCLIPatch(&pod, annotations, []corev1.Container{binInitContainer}, patch)
|
patchBytes, err := createOPCLIPatch(&pod, annotations, []corev1.Container{binInitContainer}, patch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user