|
12 | 12 | echo "==> cpflow github-flow-readiness" |
13 | 13 | "${cpflow_cmd[@]}" github-flow-readiness |
14 | 14 |
|
| 15 | +echo "==> check node renderer probe template" |
| 16 | +ruby <<'RUBY' |
| 17 | +require "yaml" |
| 18 | +
|
| 19 | +template = File.read(".controlplane/templates/node-renderer.yml") |
| 20 | +rendered = template.gsub(/\{\{[A-Z_]+\}\}/, "template-placeholder") |
| 21 | +container = YAML.safe_load(rendered).fetch("spec").fetch("containers").fetch(0) |
| 22 | +
|
| 23 | +expected_args = [ |
| 24 | + "bash", |
| 25 | + "-lc", |
| 26 | + <<~'SHELL', |
| 27 | + # The rake task warns and continues on bundle fetch misses so rollout |
| 28 | + # does not wedge; unexpected task failures still stop the shell. |
| 29 | + set -e |
| 30 | + bundle exec rake react_on_rails_pro:pre_seed_renderer_cache |
| 31 | + exec yarn node-renderer |
| 32 | + SHELL |
| 33 | +] |
| 34 | +expected_ports = [{ "number" => 3800, "protocol" => "http2" }] |
| 35 | +expected_readiness_probe = { |
| 36 | + "tcpSocket" => { "port" => 3800 }, |
| 37 | + "failureThreshold" => 3, |
| 38 | + "periodSeconds" => 5, |
| 39 | +} |
| 40 | +expected_liveness_probe = { |
| 41 | + "tcpSocket" => { "port" => 3800 }, |
| 42 | + "failureThreshold" => 3, |
| 43 | + "periodSeconds" => 10, |
| 44 | + "initialDelaySeconds" => 120, |
| 45 | +} |
| 46 | +
|
| 47 | +failures = [] |
| 48 | +failures << "unsupported startupProbe is present" if container.key?("startupProbe") |
| 49 | +failures << "command changed" if container.key?("command") |
| 50 | +failures << "args changed" unless container.fetch("args") == expected_args |
| 51 | +failures << "image changed" unless container.fetch("image") == "template-placeholder" |
| 52 | +failures << "ports changed" unless container.fetch("ports") == expected_ports |
| 53 | +failures << "readinessProbe changed" unless container.fetch("readinessProbe") == expected_readiness_probe |
| 54 | +failures << "livenessProbe grace or thresholds changed" unless container.fetch("livenessProbe") == expected_liveness_probe |
| 55 | +
|
| 56 | +abort failures.join("\n") unless failures.empty? |
| 57 | +puts "node renderer template preserves supported probe grace and stable runtime settings" |
| 58 | +RUBY |
| 59 | + |
15 | 60 | echo "==> parse generated GitHub Actions YAML" |
16 | 61 | ruby <<'RUBY' |
17 | 62 | require "yaml" |
|
0 commit comments