From 7a025e8f4183ebf27e3e281aa583bd91c25fe153 Mon Sep 17 00:00:00 2001 From: Michael Grosser Date: Mon, 29 Oct 2018 14:25:04 -0700 Subject: [PATCH] make prerequisite docs easier to find and use it consistently --- plugins/kubernetes/README.md | 4 ++-- .../kubernetes/test/models/kubernetes/role_validator_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/kubernetes/README.md b/plugins/kubernetes/README.md index fe98b069c4..89554d9396 100644 --- a/plugins/kubernetes/README.md +++ b/plugins/kubernetes/README.md @@ -120,9 +120,9 @@ Via [Template filler](/plugins/kubernetes/app/models/kubernetes/template_filler. KUBERNETES_CLUSTER_NAME, and environment variables defined via [env](/plugins/env) plugin. - Secret puller and secret annotations (if secret puller + vault is used) -### Migrations +### Migrations / Prerequisite -Add a role with only a `Pod`, `metadata.annotations.samson/prerequisite: true`, and command to run a migrations. +Add a role with only a `Pod`, `metadata.annotations.samson/prerequisite: 'true'`, and command to run a migrations. It will be executed before the rest is deployed. For default it waits for 10 minutes before timeout, you can change the timeout diff --git a/plugins/kubernetes/test/models/kubernetes/role_validator_test.rb b/plugins/kubernetes/test/models/kubernetes/role_validator_test.rb index 54850e0ee6..99a0494491 100644 --- a/plugins/kubernetes/test/models/kubernetes/role_validator_test.rb +++ b/plugins/kubernetes/test/models/kubernetes/role_validator_test.rb @@ -303,7 +303,7 @@ role.pop role.first[:kind] = "Job" role.first[:spec][:template][:spec][:restartPolicy] = "Never" - role.first[:metadata][:annotations] = {"samson/prerequisite": 'true'} + role.first[:metadata][:annotations] = {"samson/prerequisite": "true"} end it "does not report valid prerequisites" do @@ -313,7 +313,7 @@ it "does not report valid prerequisites for pod" do assert role.first.delete(:spec) role.first[:kind] = "Pod" - role.first[:metadata][:annotations] = {"samson/prerequisite": 'true'} + role.first[:metadata][:annotations] = {"samson/prerequisite": "true"} role.first[:spec] = {containers: [{name: "Foo"}]} errors.must_equal nil end