mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-29 10:55:05 +00:00
temp update for debugging
This commit is contained in:
parent
bdb677abf6
commit
5ded29f74e
3 changed files with 29 additions and 5 deletions
|
@ -3,6 +3,7 @@ package testrunner
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
ospath "path"
|
||||
|
@ -442,6 +443,9 @@ func loadPolicy(t *testing.T, path string) *kyverno.ClusterPolicy {
|
|||
}
|
||||
|
||||
func testScenario(t *testing.T, path string) {
|
||||
flag.Set("logtostderr", "true")
|
||||
flag.Set("v", "8")
|
||||
|
||||
scenario, err := loadScenario(t, path)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
|
|
|
@ -4,10 +4,12 @@ metadata:
|
|||
name: "annotate-emptyDir"
|
||||
annotations:
|
||||
policies.kyverno.io/category: AutoScaling
|
||||
policies.kyverno.io/description:
|
||||
policies.kyverno.io/description: The Kubernetes cluster autoscaler does not evict pods that
|
||||
use hostPath or emptyDir volumes. To allow eviction the annotation
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict=true is added to the pod.
|
||||
spec:
|
||||
rules:
|
||||
- name: "add-safe-to-evict-annotation"
|
||||
- name: "empty-dir-add-safe-to-evict"
|
||||
match:
|
||||
resources:
|
||||
kinds:
|
||||
|
@ -19,4 +21,18 @@ spec:
|
|||
+(cluster-autoscaler.kubernetes.io/safe-to-evict): true
|
||||
spec:
|
||||
volumes:
|
||||
- (emptyDir): {}
|
||||
- (emptyDir): {}
|
||||
- name: "host-path-add-safe-to-evict"
|
||||
match:
|
||||
resources:
|
||||
kinds:
|
||||
- "Pod"
|
||||
mutate:
|
||||
overlay:
|
||||
metadata:
|
||||
annotations:
|
||||
+(cluster-autoscaler.kubernetes.io/safe-to-evict): true
|
||||
spec:
|
||||
volumes:
|
||||
- (hostPath):
|
||||
path: "*"
|
||||
|
|
|
@ -13,7 +13,11 @@ expected:
|
|||
namespace: ''
|
||||
name: pod-with-emptydir
|
||||
rules:
|
||||
- name: add-safe-to-evict-annotation
|
||||
- name: empty-dir-add-safe-to-evict
|
||||
type: Mutation
|
||||
success: true
|
||||
message: "successfully processed overlay"
|
||||
message: "successfully processed overlay"
|
||||
- name: host-path-add-safe-to-evict
|
||||
type: Mutation
|
||||
success: false
|
||||
message: "successfully processed overlay"
|
Loading…
Add table
Reference in a new issue