I am using the kubernetes plugin with Jenkins to automate my builds and am using the BUILD_NUMBER
in my pipeline definition:
def TEST = "${env.BUILD_NUMBER.toInteger() % 5}"
pipeline {
agent {
kubernetes {
label 'kind'
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
name: "$TEST"
spec:
...
however Jenkins seems to be caching the value of TEST
templated into the agent YAML. I'm getting name: 3
for multiple builds in a row for example.
Is it possible to disable this caching?