Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

.apply target returns exit code 1 #666

Open
dkryptr opened this issue Aug 11, 2021 · 0 comments
Open

.apply target returns exit code 1 #666

dkryptr opened this issue Aug 11, 2021 · 0 comments

Comments

@dkryptr
Copy link

dkryptr commented Aug 11, 2021

Our automated deploy pipeline checks the exit code of our bazel run deploy commands to confirm if the deploy succeeded. When upgrading from 0.4 to 0.6 we noticed our deploy stage failing. We tested versions 0.4, 0.5 and 0.6. This is a regression in versions 0.5 and 0.6. They return exit code 1 when the command appears to succeed.

Here's an example BUILD file followed by the commands I used to test:

BUILD file

py3_image(
    name = "docker_image",
    srcs = glob(["*.py"]),
    base = "@python_3_8//image",
    main = "main.py",
    deps = [
        requirement("boto3"),
    ],
)

k8s_object(
    name = "k8s_deploy",
    cluster = "cluster",
    images = {
        "image:{BUILD_TIMESTAMP}": "//path/to/docker/target:docker_image",
    },
    kind = "deployment",
    substitutions = {
        "%(BUILD_TIMESTAMP)": "{BUILD_TIMESTAMP}",
    },
    template = ":deployment.yaml",
)

With version 0.4 of the rules:

bazel run //path/to/target:k8s_deploy.apply
echo $?
# 0

With version 0.5 and 0.6 of the rules:

bazel run //path/to/target:k8s_deploy.apply
echo $?
# 1
@dkryptr dkryptr changed the title Apply functionality returns exit code 1 Apply target returns exit code 1 Aug 11, 2021
@dkryptr dkryptr changed the title Apply target returns exit code 1 .apply target returns exit code 1 Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant