1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-30 19:35:06 +00:00

correct scenario test

This commit is contained in:
Shuting Zhao 2019-11-05 12:59:22 -08:00
parent 5ded29f74e
commit 664a85363a
4 changed files with 5 additions and 5 deletions

View file

@ -33,7 +33,9 @@ func processOverlay(rule kyverno.Rule, resource unstructured.Unstructured) (resp
if err != nil && strings.Contains(err.Error(), "Conditions are not met") {
glog.Errorf("Resource %s/%s/%s does not meet the conditions in the rule %s with overlay pattern %s", resource.GetKind(), resource.GetNamespace(), resource.GetName(), rule.Name, rule.Mutation.Overlay)
//TODO: send zero response and not consider this as applied?
return RuleResponse{}, resource
response.Success = false
response.Message = fmt.Sprintf("Resource %s/%s/%s: %v.", resource.GetKind(), resource.GetNamespace(), resource.GetName(), err)
return response, resource
}
if err != nil {

View file

@ -35,4 +35,4 @@ spec:
spec:
volumes:
- (hostPath):
path: "*"
path: "*"

View file

@ -2,8 +2,6 @@ apiVersion: v1
kind: Pod
metadata:
name: pod-with-emptydir
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: true
spec:
containers:
- image: k8s.gcr.io/test-webserver

View file

@ -20,4 +20,4 @@ expected:
- name: host-path-add-safe-to-evict
type: Mutation
success: false
message: "successfully processed overlay"
message: "Resource Pod//pod-with-emptydir: Conditions are not met at /spec/volumes/0/hostPath/, resource field hostPath is not present."