Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gceBakeHandler): Updating Image name pattern to match googlecompute pre/post 1.1.2 plugin (backport #1122) #1123

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicReference
@Component
public class GCEBakeHandler extends CloudProviderBakeHandler {

private static final String IMAGE_NAME_TOKEN = "googlecompute: A disk image was created:"
private static final String IMAGE_NAME_TOKEN = "googlecompute: A disk image was created"

private final resolvedBakeryDefaults = new AtomicReference<RoscoGoogleConfiguration.GCEBakeryDefaults>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,21 @@ class GCEBakeHandlerSpec extends Specification implements TestDefaults{
"Build 'googlecompute' finished.\n" +
"\n" +
"==> Builds finished. The artifacts of successful builds are:\n" +
"--> googlecompute: A disk image was created: kato-x12345678-trusty"
"--> googlecompute: ${packerLog}"

Bake bake = gceBakeHandler.scrapeCompletedBakeResults(REGION, "123", logsContent)
Bake bake = gceBakeHandler.scrapeCompletedBakeResults(REGION, bakeId, logsContent)

then:
with (bake) {
id == "123"
id == bakeId
!ami
image_name == "kato-x12345678-trusty"
image_name == imageName
}

where:
packerLog | bakeId | imageName
"A disk image was created: kato-x12345678-trusty" | "123" | "kato-x12345678-trusty"
"A disk image was created in the test-gcp project: kato-x12345678-trusty-changed" | "456" | "kato-x12345678-trusty-changed"
}

void 'scraping returns null for missing image name'() {
Expand Down
Loading