suite: Configuration as Code
templates:
  - jcasc-config.yaml
tests:
  - it: default config
    release:
      namespace: default
    asserts:
      - isKind:
          of: ConfigMap
      - hasDocuments:
         count: 1
      - isNotEmpty:
          path: data.jcasc-default-config\.yaml
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 474be7705ac6cddeedf68ad2962972dd9921f64c6e534967402794fbf06a21ec
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: agent namespace and templates
    release:
      namespace: controller-namespace
    set:
      additionalAgents:
        maven:
          namespace: maven
          podName: maven
          customJenkinsLabels: maven
          image: jenkins/jnlp-agent-maven
          tag: latest
        python:
          podName: python
          customJenkinsLabels: python
          sideContainerName: python
          image: python
          tag: "3"
          command: /bin/sh -c
          args: "cat"
          TTYEnabled: true
      agent:
        namespace: jenkins-agents
        podTemplates:
          python3: |
            - name: python3
              label: jenkins-python3
              serviceAccount: jenkins
              containers:
                - name: python
                  image: python:3
                  command: "/bin/sh -c"
                  args: "cat"
                  ttyEnabled: true
                  privileged: true
                  resourceRequestCpu: "400m"
                  resourceRequestMemory: "512Mi"
                  resourceLimitCpu: "1"
                  resourceLimitMemory: "1024Mi"
    asserts:
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.controller-namespace.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.controller-namespace.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "jenkins-agents"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "jenkins-agents"
                      id: 6e750ae7b000be7917df5b00a91d0d0923a73357848c683cad33a556119b7a51
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.controller-namespace.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
                    - name: "maven"
                      namespace: "maven"
                      id: 10c1058e6b2f56024132b1e745b1dc59bb96efc1cb4ce96c7e7eeff69234d2ef
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.controller-namespace.svc.cluster.local:8080/"
                        image: "jenkins/jnlp-agent-maven:latest"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent maven"
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
                    - name: "python"
                      namespace: "jenkins-agents"
                      id: 4b0b84d994ac4c762ae46ea55829ebde7bf02a03315ca47425c61efc160b5709
                      containers:
                      - name: "python"
                        alwaysPullImage: false
                        args: "cat"
                        command: /bin/sh -c
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.controller-namespace.svc.cluster.local:8080/"
                        image: "python:3"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: true
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent python"
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
                    - name: python3
                      label: jenkins-python3
                      serviceAccount: jenkins
                      containers:
                        - name: python
                          image: python:3
                          command: "/bin/sh -c"
                          args: "cat"
                          ttyEnabled: true
                          privileged: true
                          resourceRequestCpu: "400m"
                          resourceRequestMemory: "512Mi"
                          resourceLimitCpu: "1"
                          resourceLimitMemory: "1024Mi"

              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: customized config
    set:
      controller:
        disableRememberMe: true
        executorMode: EXCLUSIVE
        numExecutors: 1
        enableRawHtmlMarkupFormatter: true
        JCasC:
          authorizationStrategy: |-
            globalMatrix:
              permissions:
                - "Overall/Read:anonymous"
          configScripts:
            welcome-message: |
              jenkins:
                systemMessage: Welcome to our CI\CD server.  This Jenkins is configured and managed 'as code'.
          securityRealm: local
        jenkinsAdminEmail: admin@example.org
        ingress:
          hostName: jenkins.example.com
          tls:
            - hosts:
                - jenkins.example.com
              secretName: tlsSecret
      agent:
        namespace: default
        containerCap: 22
        defaultsProviderTemplate: my-defaults
        kubernetesConnectTimeout: 11
        kubernetesReadTimeout: 12
        podName: my-agent
        sideContainerName: sideContainer
        alwaysPullImage: true
        command: /bin/command
        image: my-image/jnlp
        tag: v1.2.3
        privileged: true
        resources:
          limits:
            cpu: 1024m
            memory: 1Gi
          requests:
            cpu: 756m
            memory: 768Mi
        runAsUser: 2000
        runAsGroup: 2000
        TTYEnabled: true
        workingDir: /workdir
        envVars:
          - name: VAR
            value: value
        idleMinutes: 30
        imagePullSecretName: pullSecret
        nodeSelector:
          jenkins-agent: v1
          selector: abc
        podRetention: onFailure
        connectTimeout: 111
        volumes:
        - type: ConfigMap
          configMapName: myconfigmap
          mountPath: /var/myapp/myconfigmap
        - type: EmptyDir
          mountPath: /var/myapp/myemptydir
          memory: false
        - type: HostPath
          hostPath: /var/lib/containers
          mountPath: /var/myapp/myhostpath
        - type: Nfs
          mountPath: /var/myapp/mynfs
          readOnly: false
          serverAddress: "192.0.2.0"
          serverPath: /var/lib/containers
        - type: PVC
          claimName: mypvc
          mountPath: /var/myapp/mypvc
          readOnly: false
        - type: Secret
          defaultMode: "600"
          mountPath: /var/myapp/mysecret
          secretName: mysecret
        annotations:
          ci.jenkins-agent/test: "custom"
        yamlTemplate: |-
          apiVersion: v1
          kind: Pod
          spec:
            tolerations:
            - key: "key"
              operator: "Equal"
              value: "value"
        yamlMergeStrategy: merge
      serviceAccountAgent:
        name: agent-serviceaccount
    release:
      name: my-release
      namespace: other
    asserts:
      - hasDocuments:
          count: 2
      - documentIndex: 0
        isKind:
          of: ConfigMap
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - documentIndex: 0
        equal:
          path: metadata.name
          value: my-release-jenkins-jenkins-config-welcome-message
      - documentIndex: 0
        equal:
          path: metadata.namespace
          value: other
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - documentIndex: 1
        isKind:
          of: ConfigMap
      - documentIndex: 1
        equal:
          path: metadata.name
          value: my-release-jenkins-jenkins-jcasc-config
      - documentIndex: 1
        equal:
          path: metadata.namespace
          value: other
      - documentIndex: 0
        equal:
          path: metadata.labels.my-release-jenkins-jenkins-config
          value: "true"
      - documentIndex: 1
        equal:
          path: metadata.labels.my-release-jenkins-jenkins-config
          value: "true"
      - documentIndex: 0
        equal:
          path: data
          value:
            welcome-message.yaml: |-
              jenkins:
                systemMessage: Welcome to our CI\CD server.  This Jenkins is configured and managed 'as code'.
      - documentIndex: 1
        equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                globalMatrix:
                  permissions:
                    - "Overall/Read:anonymous"
              securityRealm:
                local
              disableRememberMe: true
              mode: EXCLUSIVE
              numExecutors: 1
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                rawHtml:
                  disableSyntaxHighlighting: true
              clouds:
              - kubernetes:
                  containerCapStr: "22"
                  defaultsProviderTemplate: "my-defaults"
                  connectTimeout: "11"
                  readTimeout: "12"
                  jenkinsUrl: "http://my-release-jenkins.other.svc.cluster.local:8080"
                  jenkinsTunnel: "my-release-jenkins-agent.other.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/my-release-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "my-agent"
                      namespace: "default"
                      annotations:
                      - key: ci.jenkins-agent/test
                        value: "custom"
                      id: 92000ebb9e31c9d9aa2d2e027689c250a56654ae91324129038586e9872d2c32
                      containers:
                      - name: "sideContainer"
                        alwaysPullImage: true
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command: /bin/command
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://my-release-jenkins.other.svc.cluster.local:8080/"
                        image: "my-image/jnlp:v1.2.3"
                        privileged: "true"
                        resourceLimitCpu: 1024m
                        resourceLimitMemory: 1Gi
                        resourceRequestCpu: 756m
                        resourceRequestMemory: 768Mi
                        runAsUser: 2000
                        runAsGroup: 2000
                        ttyEnabled: true
                        workingDir: /workdir
                      envVars:
                        - envVar:
                            key: VAR
                            value: value
                      idleMinutes: 30
                      instanceCap: 2147483647
                      imagePullSecrets:
                      - name: pullSecret
                      label: "my-release-jenkins-agent "
                      nodeSelector: jenkins-agent=v1,selector=abc
                      nodeUsageMode: "NORMAL"
                      podRetention: onFailure
                      showRawYaml: true
                      serviceAccount: "agent-serviceaccount"
                      slaveConnectTimeoutStr: "111"
                      volumes:
                        - configMapVolume:
                            configMapName: "myconfigmap"
                            mountPath: "/var/myapp/myconfigmap"
                        - emptyDirVolume:
                            memory: false
                            mountPath: "/var/myapp/myemptydir"
                        - hostPathVolume:
                            hostPath: "/var/lib/containers"
                            mountPath: "/var/myapp/myhostpath"
                        - nfsVolume:
                            mountPath: "/var/myapp/mynfs"
                            readOnly: false
                            serverAddress: "192.0.2.0"
                            serverPath: "/var/lib/containers"
                        - persistentVolumeClaim:
                            claimName: "mypvc"
                            mountPath: "/var/myapp/mypvc"
                            readOnly: false
                        - secretVolume:
                            defaultMode: "600"
                            mountPath: "/var/myapp/mysecret"
                            secretName: "mysecret"
                      yaml: |-
                        apiVersion: v1
                        kind: Pod
                        spec:
                          tolerations:
                          - key: "key"
                            operator: "Equal"
                            value: "value"
                      yamlMergeStrategy: merge
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress: admin@example.org
                url: https://jenkins.example.com
  - it: custom dynamic pvc workspace volume
    set:
      agent:
        workspaceVolume:
          type: "DynamicPVC"
          accessModes: "ReadWriteOnce"
          requestsSize: "2Gi"
          storageClassName: "gp2"
    release:
      namespace: default
    asserts:
      - isKind:
          of: ConfigMap
      - hasDocuments:
         count: 1
      - isNotEmpty:
          path: data.jcasc-default-config\.yaml
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 1ad31223960302cee30a36ce3d73e8017b8702e9b3100d9b3de3e11f00208958
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      workspaceVolume:
                        dynamicPVC:
                          accessModes: "ReadWriteOnce"
                          requestsSize: "2Gi"
                          storageClassName: "gp2"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: custom emptyDir workspace volume
    set:
      agent:
        workspaceVolume:
          type: "EmptyDir"
          memory: true
    release:
      namespace: default
    asserts:
      - isKind:
          of: ConfigMap
      - hasDocuments:
         count: 1
      - isNotEmpty:
          path: data.jcasc-default-config\.yaml
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 830b3c578ad439b24340052e51aec67362fd63992a9298acaa59bfda3e99391f
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      workspaceVolume:
                        emptyDirWorkspaceVolume:
                          memory: true
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: custom hostPath workspace volume
    set:
      agent:
        workspaceVolume:
          type: "HostPath"
          hostPath: "/data"
    release:
      namespace: default
    asserts:
      - isKind:
          of: ConfigMap
      - hasDocuments:
         count: 1
      - isNotEmpty:
          path: data.jcasc-default-config\.yaml
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: f57fed930c6aa9841be0c245fbe803cea2eda8e2c9f0526e17c76e3f8bbd15c1
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      workspaceVolume:
                        hostPathWorkspaceVolume:
                          hostPath: "/data"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: custom nfs workspace volume
    set:
      agent:
        workspaceVolume:
          type: "Nfs"
          readOnly: false
          serverAddress: "1.1.1.1"
          serverPath: "/data"
    release:
      namespace: default
    asserts:
      - isKind:
          of: ConfigMap
      - hasDocuments:
         count: 1
      - isNotEmpty:
          path: data.jcasc-default-config\.yaml
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 187b5b627e42eff0b4f267ba448c4d203ba08467233690bb00bf58d26045d689
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      workspaceVolume:
                        nfsWorkspaceVolume:
                          readOnly: false
                          serverAddress: "1.1.1.1"
                          serverPath: "/data"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: custom pvc workspace volume
    set:
      agent:
        workspaceVolume:
          type: "PVC"
          claimName: "my-claim"
          readOnly: false
    release:
      namespace: default
    asserts:
      - isKind:
          of: ConfigMap
      - hasDocuments:
         count: 1
      - isNotEmpty:
          path: data.jcasc-default-config\.yaml
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: e00d701466613fe20ab781b75a1926a4031a76bdd0c219460c2f51559f923704
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      workspaceVolume:
                        persistentVolumeClaimWorkspaceVolume:
                          claimName: "my-claim"
                          readOnly: false
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: custom other workspace volume
    set:
      agent:
        workspaceVolume:
          type: "persistentVolumeClaimWorkspaceVolume"
          claimName: "my-claim"
          readOnly: false
    release:
      namespace: default
    asserts:
      - isKind:
          of: ConfigMap
      - hasDocuments:
         count: 1
      - isNotEmpty:
          path: data.jcasc-default-config\.yaml
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: f07d9eb43cda17bd6c3f448332448bd4a3eff51936cde7c7afc44b02dff8e299
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      workspaceVolume:
                        persistentVolumeClaimWorkspaceVolume:
                          claimName: "my-claim"
                          readOnly: false
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: disable helm.sh label
    set:
      renderHelmLabels: false
    asserts:
      - equal:
          path: metadata.labels
          value:
            RELEASE-NAME-jenkins-jenkins-config: "true"
            app.kubernetes.io/component: jenkins-controller
            app.kubernetes.io/instance: RELEASE-NAME
            app.kubernetes.io/managed-by: Helm
            app.kubernetes.io/name: jenkins
  - it: disable agents
    release:
      namespace: controller-namespace
    set:
      agent.enabled: false
    asserts:
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.controller-namespace.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.controller-namespace.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "controller-namespace"
                  serverUrl: "https://kubernetes.default"
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: disable default config
    set:
      controller.JCasC.defaultConfig: false
    asserts:
      - hasDocuments:
         count: 0
  - it: custom jenkins label
    set:
      controller:
        customJenkinsLabels: ["testlabel"]
    release:
      namespace: default
    asserts:
      - isKind:
          of: ConfigMap
      - hasDocuments:
         count: 1
      - isNotEmpty:
          path: data.jcasc-default-config\.yaml
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: "testlabel"
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 474be7705ac6cddeedf68ad2962972dd9921f64c6e534967402794fbf06a21ec
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: adds custom labels on agent pods
    set:
      agent:
        podLabels:
          label-one: value-one
          label-two: true
    asserts:
      - isKind:
          of: ConfigMap
      - hasDocuments:
         count: 1
      - isNotEmpty:
          path: data.jcasc-default-config\.yaml
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.NAMESPACE.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.NAMESPACE.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "NAMESPACE"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  - key: "label-one"
                    value: "value-one"
                  - key: "label-two"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "NAMESPACE"
                      id: bb8414f0110939ce3d28b4c3ef67e5d80466a91db851c429e89951bd7c91882b
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.NAMESPACE.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: legacyRemotingSecurityEnabled = false
    release:
      namespace: default
    set:
      controller:
        legacyRemotingSecurityEnabled: false
    asserts:
    - isKind:
        of: ConfigMap
    - hasDocuments:
        count: 1
    - isNotEmpty:
        path: data.jcasc-default-config\.yaml
    - matchRegex:
        path: metadata.labels.helm\.sh/chart
        pattern: ^jenkins-
    - equal:
        path: data.jcasc-default-config\.yaml
        value: |-
          jenkins:
            authorizationStrategy:
              loggedInUsersCanDoAnything:
                allowAnonymousRead: false
            securityRealm:
              local:
                allowsSignup: false
                enableCaptcha: false
                users:
                - id: "${chart-admin-username}"
                  name: "Jenkins Admin"
                  password: "${chart-admin-password}"
            disableRememberMe: false
            mode: NORMAL
            numExecutors: 0
            labelString: ""
            projectNamingStrategy: "standard"
            markupFormatter:
              plainText
            clouds:
            - kubernetes:
                containerCapStr: "10"
                defaultsProviderTemplate: ""
                connectTimeout: "5"
                readTimeout: "15"
                jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                maxRequestsPerHostStr: "32"
                name: "kubernetes"
                namespace: "default"
                serverUrl: "https://kubernetes.default"
                podLabels:
                - key: "jenkins/RELEASE-NAME-jenkins-agent"
                  value: "true"
                templates:
                  - name: "default"
                    namespace: "default"
                    id: 474be7705ac6cddeedf68ad2962972dd9921f64c6e534967402794fbf06a21ec
                    containers:
                    - name: "jnlp"
                      alwaysPullImage: false
                      args: "^${computer.jnlpmac} ^${computer.name}"
                      command:
                      envVars:
                        - envVar:
                            key: "JENKINS_URL"
                            value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                      image: "jenkins/inbound-agent:4.11.2-4"
                      privileged: "false"
                      resourceLimitCpu: 512m
                      resourceLimitMemory: 512Mi
                      resourceRequestCpu: 512m
                      resourceRequestMemory: 512Mi
                      runAsUser:
                      runAsGroup:
                      ttyEnabled: false
                      workingDir: /home/jenkins/agent
                    idleMinutes: 0
                    instanceCap: 2147483647
                    label: "RELEASE-NAME-jenkins-agent "
                    nodeUsageMode: "NORMAL"
                    podRetention: Never
                    showRawYaml: true
                    serviceAccount: "default"
                    slaveConnectTimeoutStr: "100"
                    yamlMergeStrategy: override
            crumbIssuer:
              standard:
                excludeClientIPFromCrumb: true
          security:
            apiToken:
              creationOfLegacyTokenEnabled: false
              tokenGenerationOnCreationEnabled: false
              usageStatisticsEnabled: true
          unclassified:
            location:
              adminAddress:
              url: http://RELEASE-NAME-jenkins:8080
  - it: legacyRemotingSecurityEnabled = true
    release:
      namespace: default
    set:
      controller:
        legacyRemotingSecurityEnabled: true
    asserts:
    - isKind:
        of: ConfigMap
    - hasDocuments:
        count: 1
    - isNotEmpty:
        path: data.jcasc-default-config\.yaml
    - matchRegex:
        path: metadata.labels.helm\.sh/chart
        pattern: ^jenkins-
    - equal:
        path: data.jcasc-default-config\.yaml
        value: |-
          jenkins:
            authorizationStrategy:
              loggedInUsersCanDoAnything:
                allowAnonymousRead: false
            securityRealm:
              local:
                allowsSignup: false
                enableCaptcha: false
                users:
                - id: "${chart-admin-username}"
                  name: "Jenkins Admin"
                  password: "${chart-admin-password}"
            disableRememberMe: false
            remotingSecurity:
              enabled: true
            mode: NORMAL
            numExecutors: 0
            labelString: ""
            projectNamingStrategy: "standard"
            markupFormatter:
              plainText
            clouds:
            - kubernetes:
                containerCapStr: "10"
                defaultsProviderTemplate: ""
                connectTimeout: "5"
                readTimeout: "15"
                jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                maxRequestsPerHostStr: "32"
                name: "kubernetes"
                namespace: "default"
                serverUrl: "https://kubernetes.default"
                podLabels:
                - key: "jenkins/RELEASE-NAME-jenkins-agent"
                  value: "true"
                templates:
                  - name: "default"
                    namespace: "default"
                    id: 474be7705ac6cddeedf68ad2962972dd9921f64c6e534967402794fbf06a21ec
                    containers:
                    - name: "jnlp"
                      alwaysPullImage: false
                      args: "^${computer.jnlpmac} ^${computer.name}"
                      command:
                      envVars:
                        - envVar:
                            key: "JENKINS_URL"
                            value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                      image: "jenkins/inbound-agent:4.11.2-4"
                      privileged: "false"
                      resourceLimitCpu: 512m
                      resourceLimitMemory: 512Mi
                      resourceRequestCpu: 512m
                      resourceRequestMemory: 512Mi
                      runAsUser:
                      runAsGroup:
                      ttyEnabled: false
                      workingDir: /home/jenkins/agent
                    idleMinutes: 0
                    instanceCap: 2147483647
                    label: "RELEASE-NAME-jenkins-agent "
                    nodeUsageMode: "NORMAL"
                    podRetention: Never
                    showRawYaml: true
                    serviceAccount: "default"
                    slaveConnectTimeoutStr: "100"
                    yamlMergeStrategy: override
            crumbIssuer:
              standard:
                excludeClientIPFromCrumb: true
          security:
            apiToken:
              creationOfLegacyTokenEnabled: false
              tokenGenerationOnCreationEnabled: false
              usageStatisticsEnabled: true
          unclassified:
            location:
              adminAddress:
              url: http://RELEASE-NAME-jenkins:8080
  - it: empty projectNamingStrategy
    release:
      namespace: default
    set:
      controller:
        projectNamingStrategy:
    asserts:
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 474be7705ac6cddeedf68ad2962972dd9921f64c6e534967402794fbf06a21ec
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: non-string projectNamingStrategy
    release:
      namespace: default
    set:
      controller:
        projectNamingStrategy:
          myConfiguration:
            mySetting1: true
            mySetting2: something
    asserts:
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy:
                myConfiguration:
                  mySetting1: true
                  mySetting2: something
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 474be7705ac6cddeedf68ad2962972dd9921f64c6e534967402794fbf06a21ec
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: specify security settings without apiToken override
    release:
      namespace: default
    set:
      controller:
        JCasC:
          security:
            gitHostKeyVerificationConfiguration:
              sshHostKeyVerificationStrategy: "acceptFirstConnectionStrategy"
    asserts:
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 474be7705ac6cddeedf68ad2962972dd9921f64c6e534967402794fbf06a21ec
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
              gitHostKeyVerificationConfiguration:
                sshHostKeyVerificationStrategy: acceptFirstConnectionStrategy
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: specify security settings without apiToken override
    release:
      namespace: default
    set:
      controller:
        JCasC:
          security:
            apiToken: overridden
    asserts:
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 474be7705ac6cddeedf68ad2962972dd9921f64c6e534967402794fbf06a21ec
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken: overridden
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: specify additional container
    release:
      namespace: default
    set:
      agent:
        additionalContainers:
          - sideContainerName: dind
            image: docker
            tag: dind
            command: dockerd-entrypoint.sh
            args: ""
            privileged: true
    asserts:
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 566cced37b2c61da0c884c892e5c0a58834fce925c6f836de7b65313a94be9e3
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      - name: "dind"
                        alwaysPullImage: false
                        args: ""
                        command: dockerd-entrypoint.sh
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "docker:dind"
                        privileged: "true"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: specify additional container and overwrite in additional agent
    release:
      namespace: default
    set:
      agent:
        additionalContainers:
          - sideContainerName: dind
            image: docker
            tag: dind
            command: dockerd-entrypoint.sh
            args: ""
            privileged: true
      additionalAgents:
        additional-agent:
          podName: additional-agent
          additionalContainers:
            - sideContainerName: additional
              image: my-additional-container-image
              tag: latest
              command: entrypoint.sh
              args: arg1 arg2
    asserts:
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 566cced37b2c61da0c884c892e5c0a58834fce925c6f836de7b65313a94be9e3
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      - name: "dind"
                        alwaysPullImage: false
                        args: ""
                        command: dockerd-entrypoint.sh
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "docker:dind"
                        privileged: "true"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
                    - name: "additional-agent"
                      namespace: "default"
                      id: 0435d8506bd07c2eefccca326695b5a9a067849c450e3ee9fdcb13bede5c8e7b
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      - name: "additional"
                        alwaysPullImage: false
                        args: "arg1 arg2"
                        command: entrypoint.sh
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "my-additional-container-image:latest"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: specify additional container and clear in additional agent
    release:
      namespace: default
    set:
      agent:
        additionalContainers:
          - sideContainerName: dind
            image: docker
            tag: dind
            command: dockerd-entrypoint.sh
            args: ""
            privileged: true
      additionalAgents:
        additional-agent:
          podName: additional-agent
          additionalContainers: []
    asserts:
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 566cced37b2c61da0c884c892e5c0a58834fce925c6f836de7b65313a94be9e3
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      - name: "dind"
                        alwaysPullImage: false
                        args: ""
                        command: dockerd-entrypoint.sh
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "docker:dind"
                        privileged: "true"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
                    - name: "additional-agent"
                      namespace: "default"
                      id: 0024a08654abb917be24d9bb330a5fc2f6cc003c117e12f685922fceae4a7e93
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: configure hostnetworking to agent
    release:
      namespace: default
    set:
      agent:
        hostNetworking: true
    asserts:
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: 6afb0727de6aa635c049662e567ed2d245a99b8b58431273ba5698c3dcb30a1d
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      idleMinutes: 0
                      instanceCap: 2147483647
                      hostNetwork: true
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080
  - it: set secretEnvVars
    set:
      agent:
        secretEnvVars:
          - key: UNITTEST_PATH
            secretKey: UNITTEST_K8S_PATH
            secretName: k8s-unittest-secret-name
        envVars:
          - name: UNITTEST_ENV
            value: testvalue
    release:
      namespace: default
    asserts:
      - isKind:
          of: ConfigMap
      - hasDocuments:
         count: 1
      - isNotEmpty:
          path: data.jcasc-default-config\.yaml
      - matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - equal:
          path: data.jcasc-default-config\.yaml
          value: |-
            jenkins:
              authorizationStrategy:
                loggedInUsersCanDoAnything:
                  allowAnonymousRead: false
              securityRealm:
                local:
                  allowsSignup: false
                  enableCaptcha: false
                  users:
                  - id: "${chart-admin-username}"
                    name: "Jenkins Admin"
                    password: "${chart-admin-password}"
              disableRememberMe: false
              mode: NORMAL
              numExecutors: 0
              labelString: ""
              projectNamingStrategy: "standard"
              markupFormatter:
                plainText
              clouds:
              - kubernetes:
                  containerCapStr: "10"
                  defaultsProviderTemplate: ""
                  connectTimeout: "5"
                  readTimeout: "15"
                  jenkinsUrl: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080"
                  jenkinsTunnel: "RELEASE-NAME-jenkins-agent.default.svc.cluster.local:50000"
                  maxRequestsPerHostStr: "32"
                  name: "kubernetes"
                  namespace: "default"
                  serverUrl: "https://kubernetes.default"
                  podLabels:
                  - key: "jenkins/RELEASE-NAME-jenkins-agent"
                    value: "true"
                  templates:
                    - name: "default"
                      namespace: "default"
                      id: fda09c2a838ec94695b64700bb694959c5dd61bd9877d9da406ae93b1707200c
                      containers:
                      - name: "jnlp"
                        alwaysPullImage: false
                        args: "^${computer.jnlpmac} ^${computer.name}"
                        command:
                        envVars:
                          - envVar:
                              key: "JENKINS_URL"
                              value: "http://RELEASE-NAME-jenkins.default.svc.cluster.local:8080/"
                        image: "jenkins/inbound-agent:4.11.2-4"
                        privileged: "false"
                        resourceLimitCpu: 512m
                        resourceLimitMemory: 512Mi
                        resourceRequestCpu: 512m
                        resourceRequestMemory: 512Mi
                        runAsUser:
                        runAsGroup:
                        ttyEnabled: false
                        workingDir: /home/jenkins/agent
                      envVars:
                        - envVar:
                            key: UNITTEST_ENV
                            value: testvalue
                        - secretEnvVar:
                            key: UNITTEST_PATH
                            secretName: k8s-unittest-secret-name
                            secretKey: UNITTEST_K8S_PATH
                            optional: false
                      idleMinutes: 0
                      instanceCap: 2147483647
                      label: "RELEASE-NAME-jenkins-agent "
                      nodeUsageMode: "NORMAL"
                      podRetention: Never
                      showRawYaml: true
                      serviceAccount: "default"
                      slaveConnectTimeoutStr: "100"
                      yamlMergeStrategy: override
              crumbIssuer:
                standard:
                  excludeClientIPFromCrumb: true
            security:
              apiToken:
                creationOfLegacyTokenEnabled: false
                tokenGenerationOnCreationEnabled: false
                usageStatisticsEnabled: true
            unclassified:
              location:
                adminAddress:
                url: http://RELEASE-NAME-jenkins:8080