[JIRA] (JENKINS-56598) Unable to bind withCredentials variables inside running pod
Title: Message Title Jesse Glick resolved as Cannot Reproduce podTemplate(label: BUILD_TAG) { node (BUILD_TAG) { withCredentials([string(credentialsId: 'text', variable: 'SECRET')]) { sh 'env; env | tr "[a-z]" "[A-Z]"' } } } working for me. Jenkins / JENKINS-56598 Unable to bind withCredentials variables inside running pod Change By: Jesse Glick Status: Open Resolved Resolution: Cannot Reproduce Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails
[JIRA] (JENKINS-56598) Unable to bind withCredentials variables inside running pod
Title: Message Title Thomas Cooper updated an issue Jenkins / JENKINS-56598 Unable to bind withCredentials variables inside running pod Change By: Thomas Cooper When running via declarative pipeline, any variables bound via Credentials Binding plugin are empty and cannot be used on the running pod. The environment variable should be set via the `withCredentials` but never does. {code:java}pipeline { agent { label 'my-pod-label-from-config' } stages {...stage('Run Playbook') { steps { script { withCredentials([string(credentialsId: " ocp k8s - ${params.Environment}-ansible-sa- token -credential ", variable: 'K8S_AUTH_API_KEY')]) { sh "printenv" // K8S_AUTH_API_KEY env var is completely missing...ansiblePlaybook playbook: "playbooks/something.yml", extraVars: ... // the k8s Ansible module relies on K8S_AUTH_API_KEY being set and fails due to 401 UNAUTHORIZED{code}I've seen a number of PRs opened to address other environment variables set by Jenkins itself (ie. COMMIT_ID and other SCM related vars). However, no combination of withCredentials seems to work when running inside a pod. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from
[JIRA] (JENKINS-56598) Unable to bind withCredentials variables inside running pod
Title: Message Title Thomas Cooper updated an issue Jenkins / JENKINS-56598 Unable to bind withCredentials variables inside running pod Change By: Thomas Cooper When running via declarative pipeline, any variables bound via Credentials Binding plugin are empty and cannot be used on the running pod. The environment variable should be set via the `withCredentials` but never does. {code:java} pipeline { agent { label 'my-pod-label-from-config' } stages {... stage('Run Playbook') { steps { script { withCredentials([string(credentialsId: "ocp-${params.Environment}-ansible-sa-token", variable: 'K8S_AUTH_API_KEY')]) { sh "printenv" // K8S_AUTH_API_KEY env var is completely missing...ansiblePlaybook playbook: "playbooks/something.yml", extraVars: ... // the k8s Ansible module relies on K8S_AUTH_API_KEY being set and fails due to 401 UNAUTHORIZED{code}I've seen a number of PRs opened to address other environment variables set by Jenkins itself (ie. COMMIT_ID and other SCM related vars). However, no combination of withCredentials seems to work when running inside a pod. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsub
[JIRA] (JENKINS-56598) Unable to bind withCredentials variables inside running pod
Title: Message Title Thomas Cooper updated an issue Jenkins / JENKINS-56598 Unable to bind withCredentials variables inside running pod Change By: Thomas Cooper When running via declarative pipeline, any variables bound via Credentials Binding plugin are empty and cannot be used on the running pod. The environment variable should be set via the `withCredentials` but never does. {code:java}stage('Run Playbook') { steps { script { withCredentials([string(credentialsId: "ocp-${params.Environment}-ansible-sa-token", variable: 'K8S_AUTH_API_KEY')]) { sh "printenv" // K8S_AUTH_API_KEY env var is completely missing... ansiblePlaybook playbook: "playbooks / something.yml", extraVars: ... / Any steps relying on K8S_AUTH_API_KEY ( / the k8s Ansible module in this case) fails since that variable is never relies on K8S_AUTH_API_KEY being set . and fails due to 401 UNAUTHORIZED {code} I've seen a number of PRs opened to address other environment variables set by Jenkins itself (ie. COMMIT_ID and other SCM related vars). However, no combination of withCredentials seems to work when running inside a pod. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, s
[JIRA] (JENKINS-56598) Unable to bind withCredentials variables inside running pod
Title: Message Title Thomas Cooper updated an issue Jenkins / JENKINS-56598 Unable to bind withCredentials variables inside running pod Change By: Thomas Cooper Issue Type: Improvement Bug Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-56598) Unable to bind withCredentials variables inside running pod
Title: Message Title Thomas Cooper created an issue Jenkins / JENKINS-56598 Unable to bind withCredentials variables inside running pod Issue Type: Improvement Assignee: Carlos Sanchez Components: kubernetes-plugin Created: 2019-03-18 14:28 Environment: Jenkins 2.166 Kubernetes Plugin 1.14.8 Credentials Binding Plugin 1.18 Priority: Major Reporter: Thomas Cooper When running via declarative pipeline, any variables bound via Credentials Binding plugin are empty and cannot be used on the running pod. The environment variable should be set via the `withCredentials` but never does. stage('Run Playbook') { steps { script { withCredentials([string(credentialsId: "ocp-${params.Environment}-ansible-sa-token", variable: 'K8S_AUTH_API_KEY')]) { sh "printenv" // K8S_AUTH_API_KEY env var is completely missing ... // Any steps relying on K8S_AUTH_API_KEY (the k8s Ansible module in this case) fails since that variable is never set. I've seen a number of PRs opened to address other environment variables set by Jenkins itself (ie. COMMIT_ID and other SCM related vars). However, no combination of withCredentials seems to work when running inside a pod.