diff --git a/README.md b/README.md index 3c86e823..554a6af6 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ For example, let's look at the [example's k8s_deploy](./e2e/helloworld/BUILD). W cd e2e bazel run //helloworld:mynamespace.show ``` +We can run `bazel run ///helloworld:mynamespace.diff` to see a difference from source to what is stored in kubernetes. + When you run `bazel run ///helloworld:mynamespace.apply`, it applies this file into your personal (`{BUILD_USER}`) namespace. Viewing the rendered files with `.show` can be useful for debugging issues with invalid or misconfigured manifests. | Parameter | Default | Description diff --git a/skylib/k8s.bzl b/skylib/k8s.bzl index 597259df..b73201db 100644 --- a/skylib/k8s.bzl +++ b/skylib/k8s.bzl @@ -223,6 +223,17 @@ def k8s_deploy( tags = tags, visibility = visibility, ) + kubectl( + name = name + ".diff", + srcs = [name], + command = "diff", + cluster = cluster, + push = False, + user = user, + namespace = namespace, + tags = tags, + visibility = visibility, + ) show( name = name + ".show", namespace = namespace,