fix(e2e): resolve Deployment name by label for scale-to-zero test#17
Merged
Conversation
chadcrum
approved these changes
May 6, 2026
The k8s-container-service-provider switched from Name to GenerateName for Kubernetes Deployments (PR #22). The scale-to-zero test assumed the Deployment name matched the container metadata.name, but GenerateName appends a random suffix, so `oc scale deployment <name>` fails with exit code 1 (not found). Fix: look up the actual Deployment name via the dcm.project/dcm-instance-id label before scaling. Also log kubectl output on failure so future errors are visible in the Ginkgo report. Fixes: FLPATH-4167 Requested-By: <@UTKKVT884> (gharden) Signed-off-by: QE CI AI Bot <qe-ci-ai-bot@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0558962 to
7626efb
Compare
y-first
approved these changes
May 6, 2026
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
k8s-container-service-providerswitched fromNametoGenerateNamefor Kubernetes Deployments (PR #22, merged Apr 28)metadata.name, butGenerateNameappends a random suffix — sooc scale deployment <name>fails withexit code 1(not found)flightpath-dcm-nightlyfor 10 consecutive builds (#71–#80, Apr 30 – May 6). 73/74 tests pass; only this one fails.Changes
sp_helpers_test.go— AddedfindDeploymentName()helper that resolves the actual Deployment name via label selectordcm.project/dcm-instance-id=<containerID>. Also added error logging torunKubectlso future failures show the actual kubectl output in the Ginkgo report (previously discarded, showing only a bareexec.ExitErrorwithStderr: nil).sp_container_status_test.go— Updated the "scaled to zero" test to resolve the real Deployment name before scaling, instead of assuming it matches the container name.Root Cause
In
convert.go:313ofk8s-container-service-provider:When a container named
e2e-scale-123456is created via the DCM API, the actual K8s Deployment is namede2e-scale-123456-xK7m2(random suffix). The test ranoc scale deployment e2e-scale-123456which doesn't exist.Test plan
flightpath-dcm-nightlyand verify the scale-to-zero test passes (73 → 74/74)findDeploymentNamecorrectly resolves viadcm.project/dcm-instance-idlabelAttribution
<@UTKKVT884>)Fixes: FLPATH-4167
🤖 Generated with Claude Code