The issue is that the DeclarativePipeline support on kubernetes-plugin is:
- Not complete - some options are missing
- Not aligned with Documentation - by reading docs, I assume I can use all options in declarativePipeline
Example: I'm trying to introduce `slaveConnectTimeout` in my pipeline, because 100 is ridiculously small if you want to pre-warm caches or so. Here is what I get
What's actually missing here:
- slaveConnectTimeout Timeout in seconds for an agent to be online.
- name The name of the pod.
- namespace The namespace of the pod.
- nodeUsageMode Either 'NORMAL' or 'EXCLUSIVE', this controls whether Jenkins only schedules jobs with label expressions matching or use the node as much as possible.
- volumes Volumes that are defined for the pod and are mounted by ALL containers.
- envVars Environment variables that are applied to ALL containers.
- envVar An environment variable whose value is defined inline.
- secretEnvVar An environment variable whose value is derived from a Kubernetes secret.
- imagePullSecrets List of pull secret names
- annotations Annotations to apply to the pod.
Assuming that `volumes`, `envVars`, `imagePullSecrets` and `annotations` by design have a structure which is hard to read and `name` which looks quite useless here - I'd suggest to add `slaveConnectTimeout`, `namespace` and `nodeUsageMode` to Declarative Pipeline class.
Gonna try to do this by myself, will create the branch/PR