Fix switchblade Initialize() multi-stack buildpack deletion#1136
Closed
tnikolova82 wants to merge 1 commit intomasterfrom
Closed
Fix switchblade Initialize() multi-stack buildpack deletion#1136tnikolova82 wants to merge 1 commit intomasterfrom
tnikolova82 wants to merge 1 commit intomasterfrom
Conversation
When multiple buildpacks share the same name across different stacks (e.g. ruby_buildpack for cflinuxfs4 and cflinuxfs5), cf delete-buildpack requires -s <stack> to disambiguate. Without it, the command fails with: 'Multiple buildpacks named ruby_buildpack found. Specify a stack name by using a -s flag.' Parse the stack field from the /v3/buildpacks API response and iterate over all resources, deleting each with the appropriate -s flag. This fixes the CF integration test failure in Initialize() when both cflinuxfs4 and cflinuxfs5 stacks are deployed.
Contributor
Author
|
Closing: the switchblade multi-stack fix has been merged upstream (cloudfoundry/switchblade#126) and released as v0.9.5. PR #1131 now includes the proper upstream dependency update instead of a vendored patch. |
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
Fix
cf delete-buildpackfailure in switchbladeInitialize()when multiplebuildpacks share the same name across different stacks (cflinuxfs4 + cflinuxfs5).
Problem
When CF has both cflinuxfs4 and cflinuxfs5 stacks deployed, buildpacks like
ruby_buildpackexist once per stack. The switchbladeInitialize()methodcalled
cf delete-buildpack -f <name>without-s <stack>, causing:This broke the
create-cf-infrastructure-and-execute-integration-test-for-rubypipeline job — all 5 retry attempts failed identically at
platform.Initialize().Fix
In the vendored
switchblade/internal/cloudfoundry/initialize.go:stackfield from the/v3/buildpacksAPI response-s <stack>if resource.Stack != ""to handle any-stack buildpacks (null stack)This is a vendored fix — the same bug exists in upstream switchblade v0.9.4.
Testing
go build ./...passes