Merge pull request #62196 from liggitt/create-dry-run

Automatic merge from submit-queue (batch tested with PRs 60900, 62215, 62196). 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>.

Remove need for server connections for dry-run create

when running create commands in --dry-run mode, we don't need a server connection or restmapper information

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2018-04-06 21:30:12 -07:00
committed by GitHub
2 changed files with 31 additions and 30 deletions

View File

@@ -2387,11 +2387,12 @@ 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)
# Ensure dry run succeeds and includes kind, apiVersion and data, and doesn't require a server connection
output_message=$(kubectl create secret generic test --from-literal=key1=value1 --dry-run -o yaml --server=example.com --v=6)
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'
kube::test::if_has_not_string "${output_message}" 'example.com'
### Create a new namespace
# Pre-condition: the test-secrets namespace does not exist