-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(k8s): backwards-compatible deployment logic
This fixes an issue when using newer versions of `kubectl` with older cluster versions. When `kubectl apply --prune` is used against a cluster with different API versions of certain resources (most commonly `Ingress` and `CronJob`), it will fail because `kubectl apply --prune` can only handle the resources hardcoded in the current version of `kubectl`. See: https://github.com/kubernetes/kubectl/blob/0a152f10/pkg/cmd/apply/prune.go#L176-L192 Since the `--prune` option for `kubectl apply` currently isn't backwards-compatible, here we essentially reimplement the pruning logic in our Kubernetes plugin to be able to prune resources in a way that works for newer and older versions of Kubernetes. This really should be fixed in `kubectl` proper. In fact, simply including resource mappings for older/beta API versions and adding the appropriate error handling for missing API/resource versions to the pruning logic would be enough to make `kubectl apply --prune` backwards-compatible. If/when we have time, we should try to contribute a fix to `kubectl` along these lines.
- Loading branch information
Showing
10 changed files
with
210 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.