kubectl: WarningHandler cannot be configured when applying

What happened: In Argo project, kubectl client is used to apply the resources and WarningHandler need to be configured in order to expose warning when applying the resources. However, I think WarningHandler cannot be configured when using kubctl client.

What you expected to happen: WarningHandler should be configured when using kubectl client.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?: Customized WarningHandler will be configured in ApplyOptions and in this line, it generate the objects but it does not contains the WarningHandler in the ApplyOptions. And the client in generated object is used to communicate with API server in this line, this line and this line. So it means, whatever the user configure the WarningHandler in ApplyOptions, it is not used.

Environment:

  • Kubernetes client and server versions (use kubectl version):
  • Cloud provider or hardware configuration:
  • OS (e.g: cat /etc/os-release):

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Thanks again @ardaguclu for looking at it. Hope it could be supported soon. Also please let me know if there is anything I could work on. I am more than happy to contribute to it.

ah, now we are on the same page 😃. Because apply command does not use RestClient to set custom warning handler, instead it uses builder which does not support configuring custom warning handler.

/triage accepted /remove-kind bug /kind feature /priority backlog