This repository was archived by the owner on Feb 6, 2024. It is now read-only.
Tags: bazelbuild/rules_k8s
Tags
Parse stamp variables in substitutions (#505) * Parse stamp variables in substitutions Allow stamp variables in substitutions for `k8s_object`. To do this, we move all substitution handling to the resolver. Since the resolver is already handling stamping anyway, it becomes relatively trivial for it pre-stamp substitutions before applying them. Fixes #351. * Use JSON to pass substitutions to resolver Serialize the substitutions as JSON instead of a wacky custom format. * examples/hellogrpc: Remove unused import * Add test for substitition stamping * Rename `examples/imagestamping` to `examples/stamping`, with targets that demonstrate both image and substitition stamping. * Add a test that verifies the substitition target is doing stamping correctly. * Clarify that we're not using expand_template Substitutions are now handled using our own string replacement code in the resolver rather than with `ctx.expand_template`. The end result shouldn't look any different, but updating the README just to be clear. * examples/hellogrpc: Clean up unused substitution * examples/stamping: Fix "kind" of ConfigMap This never actually gets deployed anywhere so it's kind of moot, but we don't want to confuse people. * resolver: Do string substitution before YAML parsing This matches the behavior of `ctx.expand_template()`, which is what we were previously using for string substitution. It allows entire YAML structures to be inserted or modified, rather than just YAML strings. * Extend and document substitution tests * Add some docstrings explaining what this test class is doing. * Test for the case of substituting a value that is not a plain YAML string.