Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Large diff output for missing default values #46

Open
tomwilkie opened this issue Jun 29, 2017 · 2 comments
Open

Large diff output for missing default values #46

tomwilkie opened this issue Jun 29, 2017 · 2 comments

Comments

@tomwilkie
Copy link
Contributor

When I use kubecfg diff I tend to see a wall of red, representing default values missing from my local config but returned by the API server. To work around this in weaveworks/kubediff I only check the local config is a subset of the config returned by the API server - ie we ignore fields which don't exist in the local config.

If this something we can do for kubecfg?

@anguslees
Copy link
Contributor

Yes, the diff output could do with a lot more cleanup (a real simple example would be removing the status fields, etc that we know aren't going to appear in local config).

I'm a bit nervous about naively applying your proposed approach: removing an entire sidecar container would (eg) be something I would want to clearly show up in a diff. Probably have to put together some example situations and think about this a bit.

100% agreed on the need to remove spurious red noise.

@tomwilkie
Copy link
Contributor Author

With kubediff we found doing subset check on dictionaries, but a full equality check on lists works around that problem. Its a bit of a hack. Also, the API server is sometime "smart" about updates, and lists you read back from the API server might not be in the same order as the config you applied (for instance, I think this happens when adding a port to a service). So we have special case handling for certain lists.

Does the swagger spec have default values in it? If so we could use that to ignore fields that are missing but set to their defaults...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants