Summary
Two related defects in K8::Stateless::Command (used for pre/postdeploy commands):
-
Namespace mismatch. Command#namespace returns project.name, while the job template (resources/k8/stateless/command.yaml) and the rest of the deploy pipeline use project.namespace. When a project's namespace differs from its name (the project form allows this), delete_if_exists! / statuses query a namespace that may not exist, while the job itself is applied into project.namespace.
-
Crash instead of error. statuses rescues any kubectl error and returns false; done? then calls _statuses.include?(...), which raises:
Deployment failed: undefined method `include?' for false
masking the real error (in our case, the kubectl lookup failing because of defect 1).
Repro
- Create a project where
namespace != name and set a predeploy_command.
- Deploy → deployment fails with the
undefined method 'include?' for false message.
Suggested fix
Command#namespace → project.namespace (consistent with the template).
statuses rescue → return [] (and let the timeout surface) or re-raise a typed error so done? can report the underlying kubectl failure.
Happy to send a PR.
Summary
Two related defects in
K8::Stateless::Command(used for pre/postdeploy commands):Namespace mismatch.
Command#namespacereturnsproject.name, while the job template (resources/k8/stateless/command.yaml) and the rest of the deploy pipeline useproject.namespace. When a project's namespace differs from its name (the project form allows this),delete_if_exists!/statusesquery a namespace that may not exist, while the job itself is applied intoproject.namespace.Crash instead of error.
statusesrescues any kubectl error and returnsfalse;done?then calls_statuses.include?(...), which raises:masking the real error (in our case, the kubectl lookup failing because of defect 1).
Repro
namespace!=nameand set apredeploy_command.undefined method 'include?' for falsemessage.Suggested fix
Command#namespace→project.namespace(consistent with the template).statusesrescue → return[](and let the timeout surface) or re-raise a typed error sodone?can report the underlying kubectl failure.Happy to send a PR.