-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[context parser] Check current ref for Docker image existence #20345
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bee3be2
[context parser] Check current ref for Docker image existence
filiptronicek 13cf10a
Better builder bob errors from supervisor
filiptronicek fbcde24
Gently soft-fail when the Dockerfile isn't found
filiptronicek 1594c9b
Add warning to ws metadata when starting workspace
filiptronicek fbd4b35
Introduce a magic constant instead of empty strings
filiptronicek d0f46be
Improve supervisor failed reading bob log error
filiptronicek 541e880
Fixup cloning our special SHA
filiptronicek 2af89a5
idk what happened
filiptronicek 672336e
let workspaces start even on invalid docker refs
filiptronicek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,9 @@ | |
| package cmd | ||
|
|
||
| import ( | ||
| "errors" | ||
| "os" | ||
| "strings" | ||
| "time" | ||
|
|
||
| "github.com/spf13/cobra" | ||
|
|
@@ -32,6 +34,14 @@ var buildCmd = &cobra.Command{ | |
|
|
||
| cfg, err := builder.GetConfigFromEnv() | ||
| if err != nil { | ||
| if errors.Is(err, builder.DockerfilePathNotExists) { | ||
| dockerfilePath := strings.TrimPrefix(os.Getenv("BOB_DOCKERFILE_PATH"), "/workspace/") | ||
| err = os.WriteFile("/workspace/.gitpod/bob.log", []byte("could not find Dockerfile at \""+dockerfilePath+"\". Please double-check the value specified in image.file in .gitpod.yml"), 0644) | ||
| if err != nil { | ||
| log.WithError(err).Error("cannot write init message to /workspace/.gitpod/bob.log") | ||
| } | ||
| } | ||
|
|
||
| log.WithError(err).Fatal("cannot get config") | ||
| return | ||
| } | ||
|
|
@@ -43,6 +53,11 @@ var buildCmd = &cobra.Command{ | |
| if err != nil { | ||
| log.WithError(err).Error("build failed") | ||
|
|
||
| err := os.WriteFile("/workspace/.gitpod/bob.log", []byte(err.Error()), 0644) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧡 |
||
| if err != nil { | ||
| log.WithError(err).Error("cannot write error to /workspace/.gitpod/bob.log") | ||
| } | ||
|
|
||
| // make sure we're running long enough to have our logs read | ||
| if dt := time.Since(t0); dt < 5*time.Second { | ||
| time.Sleep(10 * time.Second) | ||
|
|
||
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧡