vmware-archive / kubecfg

A tool for managing complex enterprise Kubernetes environments as code.
Apache License 2.0
728 stars 62 forks source link

Validate command didn't report error, but kubctl report error #291

Open wd opened 4 years ago

wd commented 4 years ago

When I add an annotation managed-by-kubecfg to my deployment, and set its value to true(boolean, not string)

$ kubecfg validate  sandbox/main.jsonnet
INFO  Validating deployments sandbox.simple-deploy
INFO  validate object "apps/v1, Kind=Deployment"

$ kubecfg show  sandbox/main.jsonnet | kubectl diff -f-
error: unable to decode "STDIN": resource.metadataOnlyObject.ObjectMeta: v1.ObjectMeta.Annotations: ReadString: expects " or n, but found t, error found in #10 byte of ...|kubecfg":true},"labe|..., bigger context ...
|environment":"sandbox","managed-by-kubecfg":true},"labels":{"name":"simple-deploy"},"name":"sim|...

The validate and update command didn't report errors which should be. kubectl report the error correctly.