Skip to content

Commit ab90cce

Browse files
author
Priya Wadhwa
committed
fix error message and add replicaset to webhook
1 parent a762a5c commit ab90cce

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

helm-hooks/postinstall/postinstall.go

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ webhooks:
117117
# - UPDATE # TODO(aaron-prindle) add back update when whitelist and helm do not collide
118118
resources:
119119
- deployments
120+
- replicasets
120121
failurePolicy: Fail
121122
clientConfig:
122123
caBundle: %s

integration/testdata/java/java-with-vulnz-replicaset.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ spec:
66
replicas: 3
77
selector:
88
matchLabels:
9-
app: replicaset-with-acceptable-vulnz
9+
app: java-with-vulnz-replicaset
1010
template:
1111
metadata:
1212
labels:

pkg/kritis/admission/admission.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,31 +73,31 @@ var handlers = map[string]func(*v1beta1.AdmissionReview, *v1beta1.AdmissionRevie
7373
}
7474

7575
func handleDeployment(ar *v1beta1.AdmissionReview, admitResponse *v1beta1.AdmissionReview) error {
76-
glog.Info("handling deployment...")
7776
deployment := appsv1.Deployment{}
7877
if err := json.Unmarshal(ar.Request.Object.Raw, &deployment); err != nil {
7978
return err
8079
}
80+
glog.Infof("handling deployment %s...", deployment.Name)
8181
reviewDeployment(&deployment, admitResponse)
8282
return nil
8383
}
8484

8585
func handlePod(ar *v1beta1.AdmissionReview, admitResponse *v1beta1.AdmissionReview) error {
86-
glog.Info("handling pod...")
8786
pod := v1.Pod{}
8887
if err := json.Unmarshal(ar.Request.Object.Raw, &pod); err != nil {
8988
return err
9089
}
90+
glog.Infof("handling pod %s...", pod.Name)
9191
reviewPod(&pod, admitResponse)
9292
return nil
9393
}
9494

9595
func handleReplicaSet(ar *v1beta1.AdmissionReview, admitResponse *v1beta1.AdmissionReview) error {
96-
glog.Info("handling replica set...")
9796
replicaSet := appsv1.ReplicaSet{}
9897
if err := json.Unmarshal(ar.Request.Object.Raw, &replicaSet); err != nil {
9998
return err
10099
}
100+
glog.Infof("handling replica set %s...", replicaSet.Name)
101101
reviewReplicaSet(&replicaSet, admitResponse)
102102
return nil
103103
}

0 commit comments

Comments
 (0)