File tree Expand file tree Collapse file tree 4 files changed +43
-18
lines changed Expand file tree Collapse file tree 4 files changed +43
-18
lines changed Original file line number Diff line number Diff line change
1
+ apiVersion : chainsaw.kyverno.io/v1alpha1
2
+ kind : Test
3
+ metadata :
4
+ name : sm-with-ns-selector
5
+ spec :
6
+ steps :
7
+ - try :
8
+ - assert :
9
+ resource :
10
+ apiVersion : monitoring.coreos.com/v1
11
+ kind : ServiceMonitor
12
+ metadata :
13
+ name : sm-with-ns-selector-x-default-x-vcluster
14
+ namespace : default
15
+ spec :
16
+ namespaceSelector : {}
17
+ selector :
18
+ matchExpressions :
19
+ - key : vcluster.loft.sh/namespace
20
+ operator : In
21
+ values :
22
+ - my-virtual-namespace
23
+ matchLabels :
24
+ vcluster.loft.sh/label-vcluster-x-a172cedcae : example-app
File renamed without changes.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4
4
PLUGIN_IMAGE=$1
5
5
MYDIR=$( dirname $0 )
6
6
ROOT_DIR=$MYDIR /../../
7
- RESOURCES_FILE=$MYDIR /../vcluster-resources.yaml
7
+ RESOURCES_FILE=$MYDIR /../../../.e2e/ vcluster-resources.yaml
8
8
9
9
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.70.0/example/prometheus-operator-crd-full/monitoring.coreos.com_podmonitors.yaml
10
10
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.70.0/example/prometheus-operator-crd-full/monitoring.coreos.com_servicemonitors.yaml
11
11
helm upgrade --install --repo https://charts.loft.sh vcluster vcluster --version 0.16.4 --values $MYDIR /vcluster-values.yaml --values $ROOT_DIR /plugin.yaml --set plugin.prometheus-operator-resources.image=$PLUGIN_IMAGE --wait
12
12
13
- sleep 120 # Give time for for CRDs to sync
13
+ vcluster connect vcluster -n default -- kubectl get servicemonitor && vcluster connect vcluster -n default -- kubectl get podmonitor
14
+
15
+ res=$?
16
+ secondsWaited=0
17
+ timeout=300
18
+
19
+ while [ $res -ne 0 ] && [ $secondsWaited -lt $timeout ]; do
20
+ echo " Waiting for CRDs to get created, sleep for 30 seconds..."
21
+ sleep 30
22
+ secondsWaited=$(( secondsWaited + 30 ))
23
+ vcluster connect vcluster -n default -- kubectl get servicemonitorr && vcluster connect vcluster -n default -- kubectl get podmonitor
24
+ res=$?
25
+ done
26
+
27
+ if [ $res -ne 0 ]; then
28
+ echo " Timed out waiting for CRDs to get created in vcluster"
29
+ exit 1
30
+ fi
14
31
15
32
cat $RESOURCES_FILE | vcluster connect vcluster -n default -- kubectl -n default apply -f -
You can’t perform that action at this time.
0 commit comments