Skip to content

tools: baseimage: Add pre-flight existence checks - #2968

Open
rmuthiah wants to merge 1 commit into
google:mainfrom
rmuthiah:fail-fast
Open

tools: baseimage: Add pre-flight existence checks#2968
rmuthiah wants to merge 1 commit into
google:mainfrom
rmuthiah:fail-fast

Conversation

@rmuthiah

@rmuthiah rmuthiah commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

for GCE images and builder resources

Add pre-flight existence verification before starting image creation builds in create_gce_base_image and create_gce_fixed_kernel:

  • Check that required source images exist in their respective projects before beginning.
  • Check that the target image-name does not already exist in the target project.
  • In GceHelper.BuildImage, check that builder VM instances and attached disks do not already exist before attempting resource creation.

Assisted-by: Antrigravity:Gemini-Next

@rmuthiah
rmuthiah requested a review from ser-io August 4, 2026 21:49
@rmuthiah rmuthiah added kokoro:force-run Trigger a presubmit build unconditionally. kokoro:run Run e2e tests. labels Aug 4, 2026
@rmuthiah
rmuthiah enabled auto-merge August 4, 2026 23:35
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Aug 4, 2026
@rmuthiah
rmuthiah requested a review from 3405691582 August 5, 2026 17:31

@3405691582 3405691582 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throughout: coalesce the if err != nil {} if exists {} pattern into just returning err != nil || exists or similar. Not really useful to have separate branches here.

Comment thread tools/baseimage/pkg/gce/gce.go Outdated
@rmuthiah
rmuthiah force-pushed the fail-fast branch 2 times, most recently from 69a9c6c to 25c61ba Compare August 5, 2026 21:35
Comment thread tools/baseimage/cmd/create_gce_fixed_kernel/main.go Outdated
@rmuthiah
rmuthiah force-pushed the fail-fast branch 2 times, most recently from 6dbfb75 to 0e7cf82 Compare August 5, 2026 21:56
…builder resources

Add pre-flight existence verification before starting image creation builds in create_gce_base_image and create_gce_fixed_kernel:
- Check that required source images exist in their respective projects before beginning.
- Check that the target image-name does not already exist in the target project.
- In GceHelper.BuildImage, check that builder attached disks do not already exist before attempting resource creation.

Assisted-by: Antigravity:Gemini-Next
@rmuthiah rmuthiah added the kokoro:run Run e2e tests. label Aug 5, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Aug 5, 2026
@rmuthiah
rmuthiah added this pull request to the merge queue Aug 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 6, 2026
@rmuthiah
rmuthiah added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants