mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Merge pull request #61808 from liggitt/dry-run-printing
Automatic merge from submit-queue (batch tested with PRs 61790, 61808, 60339, 61615, 61757). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Ensure -o yaml populates kind/apiVersion Fixes #61780 ```release-note kubectl: fixes issue with `-o yaml` and `-o json` omitting kind and apiVersion when used with `--dry-run` ```
This commit is contained in:
@@ -2386,6 +2386,13 @@ run_secrets_test() {
|
||||
|
||||
create_and_use_new_namespace
|
||||
kube::log::status "Testing secrets"
|
||||
|
||||
# Ensure dry run succeeds and includes kind, apiVersion and data
|
||||
output_message=$(kubectl create secret generic test --from-literal=key1=value1 --dry-run -o yaml)
|
||||
kube::test::if_has_string "${output_message}" 'kind: Secret'
|
||||
kube::test::if_has_string "${output_message}" 'apiVersion: v1'
|
||||
kube::test::if_has_string "${output_message}" 'key1: dmFsdWUx'
|
||||
|
||||
### Create a new namespace
|
||||
# Pre-condition: the test-secrets namespace does not exist
|
||||
kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-secrets\" }}found{{end}}{{end}}:' ':'
|
||||
|
||||
Reference in New Issue
Block a user