kubernetes: patch in combination with --local not working

/kind bug

What happened: Getting the following error:

error: cannot specify --local and server resources

What you expected to happen: For the local file to be updated with the given patch

How to reproduce it (as minimally and precisely as possible): kubectl patch --local -o yaml -f YOUR_FILE_NAME -p YOUR_PATCH_HERE

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): 1.8.6
  • Cloud provider or hardware configuration: Google Cloud console
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a): Linux cs-6000-devshell-vm-910dec8e-3555-4604-adc1-47728685a429 3.16.0-5-amd64 #1 SMP Debian 3.16.51-3+deb8u1 (2018-01-08) x86_64 GNU/Linux
  • Install tools:
  • Others:

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 5
  • Comments: 15 (1 by maintainers)

Most upvoted comments

@ChrisTerBeke have you tried this way:

E.g:

kubectl patch --local -o yaml -f kubernetes/deployments/helloworld.yaml -p "$(cat patch.yaml)" > helloworld.yaml

Here I’m using kubectl v1.13.2

But what is the point of using output and stream redirection, --local is not supposed to work on the contents of the file?