Skip to content

Commit a9d33df

Browse files
committed
Merge branch 'develop' of https://github.com/oracle/weblogic-kubernetes-operator into develop-REST-cert-chain-tests
2 parents 888bbc6 + dbd1966 commit a9d33df

File tree

19 files changed

+218
-77
lines changed

19 files changed

+218
-77
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Oracle WebLogic Server Kubernetes Operator
22

3-
Built with [Wercker](http://www.wercker.com)
3+
Built with [Jenkins](http://build.weblogick8s.org:8080/job/weblogic-kubernetes-operator/)
44

5-
[![wercker status](https://app.wercker.com/status/68ce42623fce7fb2e52d304de8ea7530/m/develop "wercker status")](https://app.wercker.com/project/byKey/68ce42623fce7fb2e52d304de8ea7530)
5+
[![Build Status](http://build.weblogick8s.org:8080/buildStatus/icon?job=weblogic-kubernetes-operator)](http://build.weblogick8s.org:8080/job/weblogic-kubernetes-operator/)
66

77
Oracle is finding ways for organizations using WebLogic Server to run important workloads, to move those workloads into the cloud. By certifying on industry standards, such as Docker and Kubernetes, WebLogic now runs in a cloud neutral infrastructure. In addition, we've provided an open-source Oracle WebLogic Server Kubernetes Operator (the “operator”) which has several key features to assist you with deploying and managing WebLogic domains in a Kubernetes environment. You can:
88

build-tools/src/main/resources/weblogic-kubernetes-operator/checkstyle/customized_google_checks.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
<property name="tokens"
5454
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
5555
</module>
56-
<module name="NeedBraces"/>
5756
<module name="LeftCurly"/>
5857
<module name="RightCurly">
5958
<property name="id" value="RightCurlySame"/>
@@ -192,10 +191,9 @@
192191
<module name="OverloadMethodsDeclarationOrder"/>
193192
<module name="VariableDeclarationUsageDistance"/>
194193
<module name="CustomImportOrder">
195-
<property name="specialImportsRegExp" value="com.oracle"/>
196194
<property name="sortImportsInGroupAlphabetically" value="true"/>
197195
<property name="separateLineBetweenGroups" value="true"/>
198-
<property name="customImportOrderRules" value="STATIC###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/>
196+
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
199197
</module>
200198
<module name="MethodParamPad"/>
201199
<module name="NoWhitespaceBefore">
@@ -254,5 +252,4 @@
254252
</module>
255253
<module name="CommentsIndentation"/>
256254
</module>
257-
</module>
258-
255+
</module>

buildtime-reports/pom.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>operator-parent</artifactId>
7+
<groupId>oracle.kubernetes</groupId>
8+
<version>2.1-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>buildtime-reports</artifactId>
13+
<packaging>pom</packaging>
14+
<name>Project Reports</name>
15+
16+
<profiles>
17+
<profile>
18+
<id>reports</id>
19+
<activation>
20+
<property>
21+
<name>!no-reports</name>
22+
</property>
23+
</activation>
24+
<build>
25+
<plugins>
26+
<plugin>
27+
<groupId>org.jacoco</groupId>
28+
<artifactId>jacoco-maven-plugin</artifactId>
29+
<version>${jacoco.version}</version>
30+
<executions>
31+
<execution>
32+
<phase>verify</phase>
33+
<goals>
34+
<goal>report-aggregate</goal>
35+
</goals>
36+
</execution>
37+
</executions>
38+
</plugin>
39+
</plugins>
40+
</build>
41+
</profile>
42+
</profiles>
43+
44+
<dependencies>
45+
<dependency>
46+
<groupId>${project.groupId}</groupId>
47+
<artifactId>operator-model</artifactId>
48+
<version>${project.version}</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>${project.groupId}</groupId>
52+
<artifactId>weblogic-kubernetes-operator</artifactId>
53+
<version>${project.version}</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>${project.groupId}</groupId>
57+
<artifactId>operator-integration-tests</artifactId>
58+
<version>${project.version}</version>
59+
</dependency>
60+
</dependencies>
61+
</project>

integration-tests/src/test/java/oracle/kubernetes/operator/ITOperator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class ITOperator extends BaseTest {
3535
private static final String opForDelYamlFile1 = "operator_del1.yaml";
3636
private static final String opForDelYamlFile2 = "operator_del2.yaml";
3737
private static final String opForBackwardCompatibility = "operator_bc.yaml";
38+
private static final String opForRESTCertChain = "operator_chain.yaml";
3839

3940
// property file used to customize domain properties for domain inputs yaml
4041
private static String domain1YamlFile = "domain1.yaml";
@@ -62,6 +63,7 @@ public class ITOperator extends BaseTest {
6263
private static Operator operatorForDel2;
6364

6465
private static Operator operatorForBackwardCompatibility;
66+
private static Operator operatorForRESTCertChain;
6567

6668
private static boolean QUICKTEST;
6769
private static boolean SMOKETEST;
@@ -404,7 +406,7 @@ public void test8CreateDomainOnExistingDir() throws Exception {
404406
*
405407
* @throws Exception
406408
*/
407-
// @Test
409+
// //@DisabledTest
408410
public void testACreateDomainApacheLB() throws Exception {
409411
Assume.assumeFalse(QUICKTEST);
410412

@@ -620,13 +622,11 @@ public void testOperatorRESTUsingCertificateChain() throws Exception {
620622

621623
logTestBegin("testOperatorRESTUsingCertificateChain");
622624
logger.info("Checking if operatorForBackwardCompatibility is running, if not creating");
623-
if (operatorForBackwardCompatibility == null) {
624-
operatorForBackwardCompatibility =
625-
TestUtils.createOperator(opForBackwardCompatibility, RESTCertType.CHAIN);
625+
if (operatorForRESTCertChain == null) {
626+
operatorForRESTCertChain = TestUtils.createOperator(opForRESTCertChain, RESTCertType.CHAIN);
626627
}
627-
operatorForBackwardCompatibility.verifyOperatorExternalRESTEndpoint();
628+
operatorForRESTCertChain.verifyOperatorExternalRESTEndpoint();
628629
logger.info("Operator using legacy REST identity created successfully");
629-
operatorForBackwardCompatibility.destroy();
630630
logger.info("SUCCESS - testOperatorRESTUsingCertificateChain");
631631
}
632632

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Operator.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,6 @@ private void generateInputYaml() throws Exception {
308308
sb.append(operatorNS);
309309
break;
310310
}
311-
if (RESTCertType.LEGACY.equals(restCertType)) {
312-
} else {
313-
}
314311
sb.append(" DNS:");
315312
sb.append(TestUtils.getHostName());
316313
sb.append(" >> ");
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
3+
4+
#any property can be provided here from kubernetes/charts/weblogic-operator/values.yaml
5+
releaseName: op4
6+
serviceAccount: weblogic-operator
7+
namespace: weblogic-operator-cert-chain
8+
domainNamespaces: [ "domain-operator-cert-chain"]
9+
externalRestEnabled: true
10+
externalRestHttpsPort: 32005
11+
javaLoggingLevel: FINE

integration-tests/src/test/resources/scripts/generate-external-rest-identity-chain.sh

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ keytool \
122122
-validity 10000 \
123123
-keyalg RSA \
124124
-keysize 2048 \
125-
-ext bc:c \
126125
-keystore ${ROOT_JKS} \
127126
-keypass ${TEMP_PW} \
128127
-storepass ${TEMP_PW}
@@ -134,7 +133,6 @@ keytool \
134133
-validity 10000 \
135134
-keyalg RSA \
136135
-keysize 2048 \
137-
-ext bc:c \
138136
-keystore ${CA_JKS} \
139137
-keypass ${TEMP_PW} \
140138
-storepass ${TEMP_PW}
@@ -149,6 +147,13 @@ keytool \
149147
-storepass ${TEMP_PW} \
150148
> ${OP_ROOT_PEM}
151149

150+
keytool \
151+
-keystore ${CA_JKS} \
152+
-storepass ${TEMP_PW} \
153+
-importcert \
154+
-noprompt \
155+
-alias ${ROOT_ALIAS} \
156+
-file ${OP_ROOT_PEM}
152157
# generate a certificate for operator-ca signed by operator-root (operator-root -> operator-ca)
153158

154159
keytool \
@@ -167,15 +172,6 @@ keytool \
167172
> ${OP_CA_PEM}
168173

169174
# import operator-ca cert chain into operator-ca.jks
170-
171-
keytool \
172-
-keystore ${CA_JKS} \
173-
-storepass ${TEMP_PW} \
174-
-importcert \
175-
-trustcacerts \
176-
-noprompt \
177-
-alias ${ROOT_ALIAS} \
178-
-file ${OP_ROOT_PEM}
179175

180176
keytool \
181177
-keystore ${CA_JKS} \
@@ -184,7 +180,7 @@ keytool \
184180
-alias ${CA_ALIAS} \
185181
-file ${OP_CA_PEM}
186182

187-
# generate private keys (for server)
183+
# generate private keys (for operator)
188184

189185
keytool \
190186
-genkeypair \
@@ -200,7 +196,7 @@ keytool \
200196
-ext SAN="${SANS}" \
201197
2> /dev/null
202198

203-
# generate a certificate for server signed by operator-ca (operator-root -> operator-ca -> weblogic-operator)
199+
# generate a certificate for operator signed by operator-ca (operator-root -> operator-ca -> weblogic-operator)
204200

205201
keytool \
206202
-keystore ${OP_JKS} \

operator/src/main/java/oracle/kubernetes/operator/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017, 2018, Oracle Corporation and/or its affiliates. All rights reserved.
1+
// Copyright 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
22
// Licensed under the Universal Permissive License v 1.0 as shown at
33
// http://oss.oracle.com/licenses/upl.
44

@@ -478,7 +478,7 @@ public void run() {
478478
try {
479479
shutdownSignal.acquire();
480480
} catch (InterruptedException ignore) {
481-
// ignoring
481+
Thread.currentThread().interrupt();
482482
}
483483

484484
isNamespaceStopping.forEach(

operator/src/main/java/oracle/kubernetes/operator/ServerStatusReader.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018,2019 Oracle Corporation and/or its affiliates. All rights reserved.
1+
// Copyright 2018, 2019 Oracle Corporation and/or its affiliates. All rights reserved.
22
// Licensed under the Universal Permissive License v 1.0 as shown at
33
// http://oss.oracle.com/licenses/upl.
44

@@ -162,7 +162,9 @@ public NextAction apply(Packet packet) {
162162
state = CharStreams.toString(reader);
163163
}
164164
}
165-
} catch (IOException | ApiException | InterruptedException e) {
165+
} catch (InterruptedException ignore) {
166+
Thread.currentThread().interrupt();
167+
} catch (IOException | ApiException e) {
166168
LOGGER.warning(MessageKeys.EXCEPTION, e);
167169
} finally {
168170
helper.recycle(client);

operator/src/main/java/oracle/kubernetes/operator/Watcher.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ void waitForExit() {
7878
if (thread != null) {
7979
thread.join();
8080
}
81-
} catch (InterruptedException ignored) {
81+
} catch (InterruptedException e) {
82+
Thread.currentThread().interrupt();
8283
}
8384
}
8485

@@ -128,6 +129,7 @@ private void watchForEvents() {
128129
Thread.sleep(delay);
129130
} catch (InterruptedException ex) {
130131
LOGGER.warning(MessageKeys.EXCEPTION, ex);
132+
Thread.currentThread().interrupt();
131133
}
132134
lastInitialize = System.currentTimeMillis();
133135
} else {

0 commit comments

Comments
 (0)