Skip to content

Commit

Permalink
refactor: set replicas function examples
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Dec 28, 2023
1 parent 466fc80 commit 6f65082
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions testdata/fn-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ metadata:
name: set-replicas
spec:
params:
replicas: 5
replicas: 6
source: |
[item | {if item.kind == "Deployment": spec.replicas = option("resource_list").functionConfig.spec.params.replicas} for item in option("resource_list").items]
[item | {if item.kind == "Deployment": spec.replicas = option("params").replicas} for item in option("items") or []]
2 changes: 1 addition & 1 deletion testdata/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
labels:
app: nginx
spec:
replicas: 5
replicas: 6
selector:
matchLabels:
app: nginx
Expand Down

0 comments on commit 6f65082

Please sign in to comment.