Add meta ID and owner to find workspace image-build Pod #10029
Merged
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.
Description
Add meta ID (workspace ID) and owner to find the workspace image-build Pod.
The integration test
TestParallelBaseImageBuild
did not hit this issue oncore-dev
env but it always happens onpreview-environment
.The integration test calls image-builder-mk3 Build twice with the same dockerfile. The image-builder-mk3 requests the ws-manager to create the image-builder Pod for building the container image. If the image-builder Pod always exists, the ws-manager returns the existed image-builder Pod to the image-builder-mk3.
In
core-dev
, the 2nd image-buildBuild
call would not hit this code block However, inpreview-environment
, the 2nd image-buildBuild
call would hit this code block. It seems to be a race condition.core-dev
, the ws-manager can receives the StartWorkspace call simultaneously.preview-environment
, the ws-manager receives the 2nd StartWorkspace call after the 1st image build Pod created.gitpod/components/ws-manager/pkg/manager/manager.go
Lines 176 to 182 in 6b5f345
In general, to find the corresponding workspace Pods, we should add the meta ID (workspace ID) as well as the owner name.
Otherwise, the 2nd image-build
Build
call will not launch a new Pod to execute the image build because the 1st image-build Pod matches the annotations.Related Issue(s)
Fixes #9782
How to test
Release Notes
Documentation
N/A