Skip to content

Commit 6dacb8c

Browse files
committed
fix mac cmd issue
1 parent 43ed6a5 commit 6dacb8c

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

docs/concepts/StagedUpdateRun/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ spec:
9797

9898
The user then need to manually approve the task by patching its status:
9999
```bash
100-
kubectl patch clusterapprovalrequests example-run-canary --type='merge' -p '{"status":{"conditions":[{"type":"Approved","status":"True","reason":"lgtm","message":"lgtm","lastTransitionTime":"'$(date --utc +%Y-%m-%dT%H:%M:%SZ)'","observedGeneration":1}]}}' --subresource=status
100+
kubectl patch clusterapprovalrequests example-run-canary --type='merge' -p '{"status":{"conditions":[{"type":"Approved","status":"True","reason":"lgtm","message":"lgtm","lastTransitionTime":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","observedGeneration":1}]}}' --subresource=status
101101
```
102102
The updateRun will only continue to next stage after the `ClusterApprovalRequest` is approved.
103103

docs/howtos/updaterun.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,29 @@ example-run-canary example-run canary 2m2s
299299
```
300300
We can approve the `ClusterApprovalRequest` by patching its status:
301301
```bash
302-
kubectl patch clusterapprovalrequests example-run-canary --type=merge -p {"status":{"conditions":[{"type":"Approved","status":"True","reason":"lgtm","message":"lgtm","lastTransitionTime":"'$(date --utc +%Y-%m-%dT%H:%M:%SZ)'","observedGeneration":1}]}} --subresource=status
302+
kubectl patch clusterapprovalrequests example-run-canary --type=merge -p {"status":{"conditions":[{"type":"Approved","status":"True","reason":"lgtm","message":"lgtm","lastTransitionTime":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","observedGeneration":1}]}} --subresource=status
303303
clusterapprovalrequest.placement.kubernetes-fleet.io/example-run-canary patched
304304
```
305+
This can be done equivalently by creating a json patch file and applying it:
306+
```bash
307+
cat << EOF > approval.json
308+
{
309+
"status": {
310+
"conditions": [
311+
{
312+
"lastTransitionTime": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
313+
"message": "lgtm",
314+
"observedGeneration": 1,
315+
"reason": "lgtm",
316+
"status": "True",
317+
"type": "Approved"
318+
}
319+
]
320+
}
321+
EOF
322+
kubectl patch clusterapprovalrequests example-run-canary --type='merge' --subresource=status --patch-file approval.json
323+
```
324+
305325
Then verify it's approved:
306326
```bash
307327
kubectl get clusterapprovalrequest

0 commit comments

Comments
 (0)