-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If namespace is not provided nor autoconfigured should use default #234
Conversation
8cae67a
to
7ef867d
Compare
Otherwise it will fail with io.fabric8.kubernetes.client.KubernetesClientException: Namespace not specified. But operation requires namespace. Test pod creation on global config page
7ef867d
to
8e40b05
Compare
.withNewMetadata().withGenerateName("kubernetes-plugin-").endMetadata() // | ||
.withNewSpec() // | ||
.withContainers( // | ||
new ContainerBuilder().withName("alpine").withImage("alpine").withCommand("cat") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail if no "alpine" image is available.
Jenkins might be running in a closed build environment which does not have access to dockerhub, but only to a private registry with custom images. May happen in an enterprise setting..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should should the correct error in that case
client.pods().withName(podName).waitUntilReady(30, TimeUnit.SECONDS); | ||
client.pods().withName(podName).delete(); | ||
|
||
return FormValidation.ok("Connection test successful"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really just a "connection test" if we actually create a pod? The button also says "test connection"..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any other suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point 😄 .
I would only have stupid suggestions, write "test connection and creating pods" on the button, or remove the "creating pods" check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed pod creation
all good now @marvinthepa ? |
Otherwise it will fail with
Test pod creation on global config page