Skip to content

Commit 30e61b5

Browse files
authored
Merge pull request #123 from jenkinsci/upgrade_base_requirements
upgrade minimal Jenkins version
2 parents 4a00d26 + fd956e7 commit 30e61b5

File tree

4 files changed

+31
-41
lines changed

4 files changed

+31
-41
lines changed

pom.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
23
<modelVersion>4.0.0</modelVersion>
34
<parent>
45
<groupId>org.jenkins-ci.plugins</groupId>
56
<artifactId>plugin</artifactId>
6-
<version>4.74</version>
7+
<version>5.7</version>
78
<relativePath />
89
</parent>
910

@@ -18,14 +19,13 @@
1819
<changelist>-SNAPSHOT</changelist>
1920
<hpi.compatibleSinceVersion>1.0.0</hpi.compatibleSinceVersion>
2021

21-
<!-- dependency versions -->
22-
<jenkins.version>2.401.3</jenkins.version>
23-
<bom.artifactId>bom-2.401.x</bom.artifactId>
24-
<bom.version>2555.v3190a_8a_c60c6</bom.version>
22+
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
23+
<jenkins.baseline>2.479</jenkins.baseline>
24+
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
2525

2626
<!-- jenkins plugins versions -->
2727
<jenkins-env-inject.version>2.3.0</jenkins-env-inject.version>
28-
28+
2929
<!-- maven plugins versions -->
3030
<maven-coveralls.version>4.3.0</maven-coveralls.version>
3131

@@ -41,7 +41,7 @@
4141
</developers>
4242

4343
<scm>
44-
<connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
44+
<connection>scm:git:https://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
4545
<developerConnection>scm:git:ssh://git@github.com/jenkinsci/${project.artifactId}-plugin.git</developerConnection>
4646
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
4747
<tag>${scmTag}</tag>
@@ -66,21 +66,21 @@
6666
<dependencies>
6767
<dependency>
6868
<groupId>io.jenkins.tools.bom</groupId>
69-
<artifactId>${bom.artifactId}</artifactId>
70-
<version>${bom.version}</version>
69+
<artifactId>bom-${jenkins.baseline}.x</artifactId>
70+
<version>3893.v213a_42768d35</version>
7171
<scope>import</scope>
7272
<type>pom</type>
7373
</dependency>
74-
<dependency>
75-
<groupId>org.jenkins-ci.plugins</groupId>
76-
<artifactId>authentication-tokens</artifactId>
77-
<version>1.53.v1c90fd9191a_b_</version>
78-
</dependency>
74+
<dependency>
75+
<groupId>org.jenkins-ci.plugins</groupId>
76+
<artifactId>authentication-tokens</artifactId>
77+
<version>1.119.v50285141b_7e1</version>
78+
</dependency>
7979
<!-- required to enforce dependency version -->
8080
<dependency>
8181
<groupId>org.jenkins-ci.plugins</groupId>
8282
<artifactId>kubernetes-client-api</artifactId>
83-
<version>6.8.1-224.vd388fca_4db_3b_</version>
83+
<version>6.10.0-240.v57880ce8b_0b_2</version>
8484
</dependency>
8585
</dependencies>
8686
</dependencyManagement>

src/test/java/org/jenkinsci/plugins/kubernetes/cli/KubectlBuildStepTest.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,6 @@ public void testUnsupportedCredential() throws Exception {
121121
b);
122122
}
123123

124-
@Test
125-
public void testInvalidCertificate() throws Exception {
126-
CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(),
127-
DummyCredentials.brokenCertificateCredential("test-credentials"));
128-
129-
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "testWithBrokenCertificate");
130-
p.setDefinition(
131-
new CpsFlowDefinition(TestResourceLoader.loadAsString("withKubeConfigPipelineEchoPath.groovy"), true));
132-
WorkflowRun b = p.scheduleBuild2(0).waitForStart();
133-
134-
assertNotNull(b);
135-
assertBuildStatus(b, Result.FAILURE);
136-
r.assertLogContains("ERROR: Uninitialized keystore", b);
137-
}
138-
139124
@Test
140125
public void testEnvVariableFormat() throws Exception {
141126
Folder folder = new Folder(r.jenkins.getItemGroup(), "test-folder");

src/test/java/org/jenkinsci/plugins/kubernetes/cli/helpers/DummyCredentials.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.cloudbees.plugins.credentials.impl.CertificateCredentialsImpl;
99
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
1010

11+
import hudson.model.Descriptor.FormException;
1112
import org.jenkinsci.plugins.plaincredentials.FileCredentials;
1213
import org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl;
1314
import org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl;
@@ -30,25 +31,28 @@ public static BaseStandardCredentials secretCredential(String credentialId) {
3031

3132
public static BaseStandardCredentials certificateCredential(String credentialId) {
3233
byte[] storeFile = TestResourceLoader.loadAsByteArray("kubernetes.pkcs12");
33-
CertificateCredentialsImpl.KeyStoreSource keyStoreSource = new CertificateCredentialsImpl.UploadedKeyStoreSource(null,
34-
SecretBytes.fromBytes(storeFile));
34+
CertificateCredentialsImpl.KeyStoreSource keyStoreSource = new CertificateCredentialsImpl.UploadedKeyStoreSource(
35+
null,
36+
SecretBytes.fromRawBytes(storeFile));
3537
return new CertificateCredentialsImpl(CredentialsScope.GLOBAL, credentialId, "sample", PASSPHRASE,
3638
keyStoreSource);
3739
}
3840

3941
public static BaseStandardCredentials brokenCertificateCredential(String credentialId) {
4042
byte[] storeFile = TestResourceLoader.loadAsByteArray("kubernetes.pkcs12");
41-
CertificateCredentialsImpl.KeyStoreSource keyStoreSource = new CertificateCredentialsImpl.UploadedKeyStoreSource(null,
42-
SecretBytes.fromBytes(storeFile));
43+
CertificateCredentialsImpl.KeyStoreSource keyStoreSource = new CertificateCredentialsImpl.UploadedKeyStoreSource(
44+
null,
45+
SecretBytes.fromRawBytes(storeFile));
4346
return new CertificateCredentialsImpl(CredentialsScope.GLOBAL, credentialId, "sample", "bad-passphrase",
4447
keyStoreSource);
4548
}
4649

47-
public static BaseStandardCredentials usernamePasswordCredential(String credentialId) {
50+
public static BaseStandardCredentials usernamePasswordCredential(String credentialId) throws FormException {
4851
return new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialId, "sample", USERNAME, PASSWORD);
4952
}
5053

51-
public static BaseStandardCredentials usernamePasswordCredentialWithSpace(String credentialId) {
54+
public static BaseStandardCredentials usernamePasswordCredentialWithSpace(String credentialId)
55+
throws FormException {
5256
return new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialId, "sample", USERNAME_WITH_SPACE,
5357
PASSWORD_WITH_SPACE);
5458
}
@@ -62,7 +66,7 @@ public static FileCredentials fileCredential(String credentialId, String cluster
6266
credentialId,
6367
"sample",
6468
"file-name",
65-
SecretBytes.fromBytes(("---\n" +
69+
SecretBytes.fromRawBytes(("---\n" +
6670
"apiVersion: \"v1\"\n" +
6771
"clusters:\n" +
6872
"- cluster:\n" +
@@ -79,7 +83,7 @@ public static FileCredentials fileCredential(String credentialId, String cluster
7983
"- name: \"" + userName + "\"\n").getBytes(StandardCharsets.UTF_8)));
8084
}
8185

82-
public static DummyTokenCredentialImpl tokenCredential(String credentialId) {
86+
public static DummyTokenCredentialImpl tokenCredential(String credentialId) throws FormException {
8387
return new DummyTokenCredentialImpl(CredentialsScope.GLOBAL, credentialId, "a-description", USERNAME, PASSWORD);
8488
}
8589

src/test/java/org/jenkinsci/plugins/kubernetes/cli/helpers/DummyTokenCredentialImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.cloudbees.plugins.credentials.CredentialsScope;
44
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
5+
import hudson.model.Descriptor.FormException;
56

67
import org.jenkinsci.plugins.kubernetes.credentials.TokenProducer;
78

@@ -13,12 +14,12 @@ public class DummyTokenCredentialImpl extends UsernamePasswordCredentialsImpl im
1314
private static final long serialVersionUID = 1L;
1415

1516
public DummyTokenCredentialImpl(CredentialsScope scope, String id, String description, String username,
16-
String password) {
17+
String password) throws FormException {
1718
super(scope, id, description, username, password);
1819
}
1920

2021
@Override
2122
public String getToken(String serviceAddress, String caCertData, boolean skipTlsVerify) {
2223
return "faketoken:" + this.getUsername() + ":" + this.getPassword();
2324
}
24-
}
25+
}

0 commit comments

Comments
 (0)