Skip to content

Commit

Permalink
Merge dbe031f into 389027d
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlaverse committed Feb 24, 2019
2 parents 389027d + dbe031f commit f3ce9b2
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -10,10 +10,10 @@ cache:
- $HOME/.m2

env:
- KUBECTL_VERSION=v1.13.1
- KUBECTL_VERSION=v1.12.4
- KUBECTL_VERSION=v1.11.6
- KUBECTL_VERSION=v1.10.12
- KUBECTL_VERSION=v1.13.3
- KUBECTL_VERSION=v1.12.5
- KUBECTL_VERSION=v1.11.7
- KUBECTL_VERSION=v1.10.13
- KUBECTL_VERSION=v1.9.11
- KUBECTL_VERSION=v1.8.15

Expand Down
Expand Up @@ -91,7 +91,7 @@ public String writeKubeConfig() throws IOException, InterruptedException {
if (this.wasServerUrlProvided()) {
launcher.getListener().getLogger().println("the serverUrl will be ignored as a raw kubeconfig file was provided");
}

if (wasClusterProvided()) {
setCluster(configFile.getRemote(), this.clusterName);
}
Expand All @@ -102,8 +102,8 @@ public String writeKubeConfig() throws IOException, InterruptedException {
useContext(configFile.getRemote(), getContextNameOrDefault());
}

if (wasNamespaceProvided()){
setNamespace(configFile.getRemote(),namespace);
if (wasNamespaceProvided()) {
setNamespace(configFile.getRemote(), namespace);
}


Expand Down Expand Up @@ -331,7 +331,7 @@ private StandardCredentials getCredentials(Run<?, ?> build) throws AbortExceptio
private boolean wasContextProvided() {
return this.contextName != null && !this.contextName.isEmpty();
}

/**
* Return whether or not a clusterName was provided
*
Expand All @@ -355,7 +355,9 @@ private boolean wasServerUrlProvided() {
*
* @return true if a namespace was provided to the plugin.
*/
private boolean wasNamespaceProvided() { return this.namespace != null && !this.namespace.isEmpty(); }
private boolean wasNamespaceProvided() {
return this.namespace != null && !this.namespace.isEmpty();
}

/**
* Returns a contextName
Expand Down
Expand Up @@ -22,6 +22,6 @@ public static KubeConfigWriter get(@Nonnull String serverUrl, @Nonnull String cr
Run<?, ?> run = context.get(Run.class);
FilePath workspace = context.get(FilePath.class);
Launcher launcher = context.get(Launcher.class);
return new KubeConfigWriter(serverUrl, credentialsId, caCertificate, clusterName, contextName,namespace, workspace, launcher, run);
return new KubeConfigWriter(serverUrl, credentialsId, caCertificate, clusterName, contextName, namespace, workspace, launcher, run);
}
}
@@ -1,19 +1,19 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:c="/lib/credentials">

<f:entry field="credentialsId" title="${%Credentials or kubeconfig file}">
<f:entry field="credentialsId" title="${%Credentials}">
<c:select/>
</f:entry>

<f:entry field="serverUrl" title="${%Kubernetes API endpoint}">
<f:textbox/>
</f:entry>

<f:entry field="contextName" title="${%Context name}">
<f:entry field="clusterName" title="${%Cluster name}">
<f:textbox/>
</f:entry>

<f:entry field="clusterName" title="${%Cluster name}">
<f:entry field="contextName" title="${%Context name}">
<f:textbox/>
</f:entry>

Expand Down
Expand Up @@ -9,11 +9,11 @@
<f:textbox/>
</f:entry>

<f:entry field="contextName" title="${%Context name}">
<f:entry field="clusterName" title="${%Cluster name}">
<f:textbox/>
</f:entry>

<f:entry field="clusterName" title="${%Cluster name}">
<f:entry field="contextName" title="${%Context name}">
<f:textbox/>
</f:entry>

Expand Down
@@ -1,4 +1,4 @@
<div>
The base64 encoded certificate of the certificate authority (CA). It is used to verify the server certificate.
The certificate of the certificate authority (CA). It's used to validate the API server certificate.
<p>Leaving this field empty will skip the certificate verification.</p>
</div>
@@ -1,3 +1,3 @@
<div>
Credentials to use for authentication or raw kubeconfig file.
Credentials to use for authentication or raw KubeConfig file.
</div>
Expand Up @@ -49,7 +49,7 @@ public void testBasicWithCa() throws Exception {
assertThat(configDumpContent, containsString("certificate-authority-data: " + encodedCertificate));
assertThat(configDumpContent, containsString("server: " + SERVER_URL));
}

@Test
public void testBasicWithCluster() throws Exception {
CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), usernamePasswordCredential(CREDENTIAL_ID));
Expand Down

0 comments on commit f3ce9b2

Please sign in to comment.