Fix: gke-deploy respects declared ApiVersion for custom CRDs#1114
Open
64johnlee wants to merge 4 commits into
Open
Fix: gke-deploy respects declared ApiVersion for custom CRDs#111464johnlee wants to merge 4 commits into
64johnlee wants to merge 4 commits into
Conversation
The google-cloud-sdk installer requires the python command to be available. The Dockerfile.appengine was installing python3 but not the python package, which is needed as a symlink/alias for SDK compatibility. Fixes GoogleCloudPlatform#1056 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The docker builder was installing both docker-compose (v1.29.2, legacy) and docker-compose-plugin (v2.x+, modern), causing version conflicts and unpredictable behavior. The legacy v1 package is no longer maintained and should not be used. This change removes docker-compose and keeps only docker-compose-plugin, which is actively maintained by Docker and compatible with all supported Docker versions (19.03, 20.10, 24.0). Fixes GoogleCloudPlatform#1042 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The gcr.io/cloud-builders/go builder is no longer actively maintained and does not support current Go versions. This adds a prominent deprecation notice at the top of the README directing users to migrate to the official golang image, which is actively maintained by the Docker community. Fixes GoogleCloudPlatform#1067 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When deploying Kubernetes resources with custom API groups (e.g., Traefik CRDs with apiVersion: traefik.io/v1alpha1), gke-deploy was only using the Kind field and discarding the API group. This caused kubectl to resolve to the server's preferred version instead of the declared version, resulting in deployment verification failures for custom resources. Changes: - Added ObjectGroupVersionKind() function in resource.go that returns the full "kind.group" format needed for kubectl commands - Updated deployer.Apply() to use ObjectGroupVersionKind when calling kubectl for custom resources with API groups - Core API resources (without groups) continue to work unchanged Fixes GoogleCloudPlatform#962 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When deploying Kubernetes resources with custom API groups (e.g., Traefik CRDs with
apiVersion: traefik.io/v1alpha1), gke-deploy was only extracting the Kind field and discarding the API group. This caused kubectl to resolve to the server's preferred version instead of the declared version, resulting in deployment verification failures for custom resources.Root Cause
The
deployer.Apply()method was callingresource.ObjectKind()which returns only the Kind (e.g., 'Middleware'). When passed to kubectl, this results inkubectl get Middlewareinstead ofkubectl get middleware.traefik.io, causing kubectl to use the server's preferred version instead of the declared version.Solution
ObjectGroupVersionKind()function that returns the full 'kind.group' format (e.g., 'middleware.traefik.io')deployer.Apply()to use the full format when calling kubectl for custom resourcesExample
Before (broken):
After (fixed):
Changes
gke-deploy/core/resource/resource.go— added ObjectGroupVersionKind() functiongke-deploy/deployer/deployer.go— use gvk format for kubectl callsVerification
🤖 Generated with Claude Code