Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kubernetes): Use consistent casing for built-in kinds (#3989)
* fix(kubernetes): Revert consistent casing for kind The prior commit to always serialize kinds as lowercase is still something we should do longer-term to reduce the fragility of code that is depending on particular casings (ex: replicaSet). That being said, it turns out there are more places depending on the current casing than I initially thought. In particular, the logic to substitute parts of a kubernetes manifest (ex: to replace a config map with the fully-qualified config map with a version) depends on the kind being camelCased. As we're approaching 1.16, I think that this is a more invasive change that I'd like to do right now, and would also like to decouple that change from the more important work to refactor Kubernetes kinds. So this commit rolls back the change that always converts kinds to lower-case; the following commit fixes the issue with the refactor a different (and less invasive way). * fix(kubernetes): Use consistent casing for built-in kinds A lot of code depends on case-sensitive comparisons between kinds; the recent refactor removed the global kind registry so when Spinnaker encounters ReplicaSet it is leaving it cased as ReplicaSet instead of (as before) converting it to replicaSet. This change builds a small collection of the built-in kinds and handles that conversion to Spinnaker-canonical casing when we're reading kinds. This is only done for built-in kinds as these are the only ones where we have built-in logic that depends on the case. A later PR (after 1.16) will re-implement always converting to lower case and will fix places where we're incorrectly doing case-sensitive comparisons.
- Loading branch information