Skip to content

Commit

Permalink
fix: update example (#19)
Browse files Browse the repository at this point in the history
* fix: update example

Signed-off-by: Yusan Kurban <yusankurban@gmail.com>
  • Loading branch information
yusank authored Apr 13, 2023
1 parent 92b2a98 commit bd08b15
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
12 changes: 6 additions & 6 deletions examples/templates/override-affinity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ spec:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchFields:
- key: bromo
- key: test
operator: In
values:
- abcd
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: bromo
- key: test
operator: In
values:
- abc
Expand All @@ -68,11 +68,11 @@ spec:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: bromo_deployment
- key: test_deployment
operator: In
values:
- "221019111032552325"
- key: bromo_service
- key: test_service
operator: In
values:
- szdevops-yushan-test-sg
Expand All @@ -85,11 +85,11 @@ spec:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: bromo_deployment
- key: test_deployment
operator: In
values:
- "221019111032552325"
- key: bromo_service
- key: test_service
operator: In
values:
- szdevops-yushan-test-sg
Expand Down
6 changes: 3 additions & 3 deletions examples/templates/validate-multi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
from: current
path: "/metadata/annotations/owned-by"
value: # reject when field value equals bormo
string: "bromo"
string: "test"
- targetOperations:
- DELETE
template:
Expand Down Expand Up @@ -75,7 +75,7 @@ spec:
message: "cannot delete this ns"
value:
stringSlice:
- bromo
- test
- ecp
- oam
- leap
Expand Down Expand Up @@ -121,7 +121,7 @@ spec:
message: "cannot delete this ns"
value:
stringSlice:
- bromo
- test
- leap
- ecp
dataRef:
Expand Down
14 changes: 3 additions & 11 deletions examples/templates/validate-pab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
kind: Pod # match all Pod | can add label to test in part of Pods
labelSelector:
matchLabels:
controller: bromo
controller: test
validateRules:
- targetOperations:
- DELETE
Expand All @@ -20,19 +20,11 @@ spec:
maxUnavailable: 50%
# In most case, no need to set replica reference since webhook will try to get replica from
# current pod owner reference spec.replica and status.replica.
# Only when pod running with custom workload or no k8s workload(bromo) then set replica reference.
# Only when pod running with custom workload or no k8s workload(test) then set replica reference.
replicaReference:
# from: k8s
# currentReplicaPath: "/status/replica"
# targetReplicaPath: "/spec/replica"
# k8s:
# apiVersion: apps.ecp.shopee.io/v1
# kind: Workload
# namespace: "{{metadata.namespace}}"
# name: "{{metadata.annotation.workload-name}}"
from: http
currentReplicaPath: "body.result.deployment.running_task_count"
targetReplicaPath: "body.result.deployment.target_task_count"
http:
url: "http://192.168.0.107:8081/api/deployment/{{metadata.annotations.bromo_deployment}}"
url: "http://192.168.0.107:8081/api/deployment/{{metadata.annotations.test_deployment}}"
method: GET

0 comments on commit bd08b15

Please sign in to comment.