You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stage('Check service from external method') {
steps {
getServiceDescription cluster: "${OPENSHIFT_CLUSTER}", project: "${OPENSHIFT_PROJECT}", service: "${OPENSHIFT_SERVICE}"
}
}
the resulting error/stacktrace is:
java.nio.file.NoSuchFileException: /var/run/secrets/kubernetes.io/serviceaccount/token
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at hudson.FilePath.read(FilePath.java:1771)
at org.jenkinsci.plugins.workflow.steps.ReadFileStep$Execution.run(ReadFileStep.java:96)
at org.jenkinsci.plugins.workflow.steps.ReadFileStep$Execution.run(ReadFileStep.java:86)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
at hudson.security.ACL.impersonate(ACL.java:260)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Any help would be appreciated.
The text was updated successfully, but these errors were encountered:
Hey @antoinedube - the expected and actual values of your cluster and project params/env vars when you run the different permutations are needed for me to fully help.
I can tell you that if the plugin sees empty values for the cluster parameter, it will go with among other things the default location of the jenkins service account token mounted in a pod, where the plugin will assume you are running in a jenkins pod.
My guess is that:
a) you are not running jenkins in an openshift pod based on the exception
b) and value for the cluster you expect to be passed into openshift.withCluster is not getting passed in, but rather the empty string is
I am trying to extract a part of code that I will be reusing in different script. Currently, it is directly in the Jenkinsfile. For example:
This is working as expected.
When extracting code in a groovy method (file vars/getServiceDescription.groovy):
and calling it from my Jenkinsfile:
the resulting error/stacktrace is:
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: