rules_k8s icon indicating copy to clipboard operation
rules_k8s copied to clipboard

`build` docs claim a yaml file will be generated but none is

Open jmhodges opened this issue 7 years ago • 4 comments

Reading through the "build" docs it says

Build builds all of the constituent elements, and makes the template available as {name}.yaml

But no such yaml file is created when running bazel build //path/to:k8s_object_thing. Instead, some shell files are created.

Is there a way to see what yaml will be used when written back to the k8s without accessing container registries?

jmhodges avatar Jan 29 '18 07:01 jmhodges

Ah, docs bug. I got rid of this because it led to conflicts when folks wanted to write:

k8s_object(
    name = "foo",
    template = "foo.yaml", # Same as output!
)

On "build" nothing was changed in the yaml. If you "run" it, the resolved template is sent to stdout, and this is exactly how the .create (and friends) actions get the yaml to use with kubectl.

mattmoor avatar Jan 29 '18 15:01 mattmoor

Okay, cool. I see it printed out on run, but I'm also getting an error message that seems to be rules_k8s trying to do network IO when I didn't expect that. I'm getting:

CRITICAL:root:Error publishing provided image: Bad status during token exchange: 401
{"errors":[{"code":"UNAUTHORIZED","message":"You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication"}]}

jmhodges avatar Mar 16 '18 22:03 jmhodges

I'll make another ticket about that.

jmhodges avatar Mar 16 '18 22:03 jmhodges

Oops, the docs are still busted. Reopening.

jmhodges avatar Mar 16 '18 22:03 jmhodges