Skip to content
Open
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
4 changes: 2 additions & 2 deletions airflow/docker_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,8 @@ func (d *DockerImage) GetLabel(altImageName, labelName string) (string, error) {
if err != nil {
return label, err
}
if execErr := stderr.String(); execErr != "" {
return label, fmt.Errorf("%s: %w", execErr, errGetImageLabel)
if execWarn := strings.TrimSpace(stderr.String()); execWarn != "" {
logger.Debugf("container runtime stderr while inspecting %s: %s", imageName, execWarn)
Comment on lines +521 to +522
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we ignoring this? It's still not clear to me 🤔. The image that is mentioned in the issue description astrocrpublic.azurecr.io/astronomer/astro-runtime:3.1-2 is invalid, and thus the get label fails at this point, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops, I didn’t update the issue description correctly before - that's on me. The screenshot was still accurate. I've now updated the description; please take another look and let me know if it makes sense.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we then specifically ignore when stderr has the string Emulate Docker CLI using podman, so that we still catch other issues?

}
label = stdout.String()
label = strings.Trim(label, "\n")
Expand Down
9 changes: 6 additions & 3 deletions airflow/docker_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,17 +544,20 @@ func (s *Suite) TestDockerImageGetLabel() {
s.ErrorIs(err, errMockDocker)
})

s.Run("cmdExec failure", func() {
s.Run("cmdExec stderr warning", func() {
mockLabel := "test-label"
mockStdout := "label-value"
mockErrResp := "test-err-response"
cmdExec = func(cmd string, stdout, stderr io.Writer, args ...string) error {
s.Contains(args[2], mockLabel)
io.WriteString(stdout, mockStdout)
io.WriteString(stderr, mockErrResp)
return nil
}

_, err := handler.GetLabel("", mockLabel)
s.ErrorIs(err, errGetImageLabel)
resp, err := handler.GetLabel("", mockLabel)
s.NoError(err)
s.Equal(mockStdout, resp)
})
}

Expand Down
2 changes: 1 addition & 1 deletion cloud/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (
composeSkipImageBuildingPromptMsg = "Skipping building image..."
deploymentHeaderMsg = "Authenticated to %s \n\n"

warningInvalidImageNameMsg = "WARNING! The image in your Dockerfile '%s' is not based on Astro Runtime and is not supported. Change your Dockerfile with an image that pulls from 'quay.io/astronomer/astro-runtime' to proceed.\n"
warningInvalidImageNameMsg = "WARNING! The image in your Dockerfile '%s' is not based on Astro Runtime and is not supported. Use an Astronomer Runtime image such as 'quay.io/astronomer/astro-runtime', 'astrocrpublic.azurecr.io/astronomer/astro-runtime', or 'astrocrpublic.azurecr.io/runtime' (for Runtime 3.x) to proceed.\n"

allTests = "all-tests"
parseAndPytest = "parse-and-all-tests"
Expand Down
2 changes: 1 addition & 1 deletion software/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
ErrEmptyDagFolderUserCancelledOperation = errors.New("no DAGs found in the dags folder. User canceled the operation")
ErrBYORegistryDomainNotSet = errors.New("Custom registry host is not set in config. It can be set at astronomer.houston.config.deployments.registry.protectedCustomRegistry.updateRegistry.host") //nolint
ErrDeploymentTypeIncorrectForImageOnly = errors.New("--image only works for Dag-only, Git-sync-based and NFS-based deployments")
WarningInvalidImageNameMsg = "WARNING! The image in your Dockerfile '%s' is not based on Astro Runtime and is not supported. Change your Dockerfile with an image that pulls from 'quay.io/astronomer/astro-runtime' to proceed.\n"
WarningInvalidImageNameMsg = "WARNING! The image in your Dockerfile '%s' is not based on Astro Runtime and is not supported. Use an Astronomer Runtime image such as 'quay.io/astronomer/astro-runtime', 'astrocrpublic.azurecr.io/astronomer/astro-runtime', or 'astrocrpublic.azurecr.io/runtime' (for Runtime 3.x) to proceed.\n"
ErrNoRuntimeLabelOnCustomImage = errors.New("the image should have label io.astronomer.docker.runtime.version")
ErrRuntimeVersionNotPassedForRemoteImage = errors.New("if --image-name and --remote is passed, it's mandatory to pass --runtime-version")
)
Expand Down