Skip to content

Commit 994de44

Browse files
committed
Add the constants necessary to update the unit tests, finish writing the input file version tests
1 parent 62487a7 commit 994de44

File tree

6 files changed

+22
-3
lines changed

6 files changed

+22
-3
lines changed

kubernetes/internal/voyager-ingress-template.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ metadata:
44
name: %DOMAIN_UID%-voyager
55
namespace: %NAMESPACE%
66
labels:
7+
weblogic.resourceVersion: voyager-load-balancer/v1
78
weblogic.domainUID: %DOMAIN_UID%
89
weblogic.domainName: %DOMAIN_NAME%
910
annotations:
@@ -27,6 +28,7 @@ metadata:
2728
namespace: %NAMESPACE%
2829
labels:
2930
app: %DOMAIN_UID%-voyager-stats
31+
weblogic.resourceVersion: voyager-load-balancer/v1
3032
weblogic.domainUID: %DOMAIN_UID%
3133
weblogic.domainName: %DOMAIN_NAME%
3234
spec:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
public interface LabelConstants {
77

8+
public static final String RESOURCE_VERSION_LABEL = "weblogic.resourceVersion";
89
public static final String DOMAINUID_LABEL = "weblogic.domainUID";
910
public static final String DOMAINNAME_LABEL = "weblogic.domainName";
1011
public static final String SERVERNAME_LABEL = "weblogic.serverName";
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2018, 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+
package oracle.kubernetes.operator;
5+
6+
public interface VersionConstants {
7+
public static final String CREATE_WEBLOGIC_OPERATOR_INPUTS_V1 = "create-weblogic-operator-inputs/v1";
8+
public static final String CREATE_WEBLOGIC_DOMAIN_INPUTS_V1 = "create-weblogic-domain-inputs/v1";
9+
public static final String OPERATOR_V1 = "operator/v1";
10+
public static final String DOMAIN_V1 = "domain/v1";
11+
public static final String VOYAGER_LOAD_BALANCER_V1 = "voyager-load-balancer/v1";
12+
public static final String APACHE_LOAD_BALANCER_V1 = "apache-load-balancer/v1";
13+
public static final String TRAEFIK_LOAD_BALANCER_V1 = "traefik-load-balancer/v1";
14+
}

operator/src/test/java/oracle/kubernetes/operator/create/CreateDomainInputsFileTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.junit.After;
1111
import org.junit.Before;
1212
import org.junit.Test;
13+
import static oracle.kubernetes.operator.VersionConstants.*;
1314
import static oracle.kubernetes.operator.create.CreateDomainInputs.*;
1415
import static oracle.kubernetes.operator.create.ExecCreateDomain.*;
1516
import static oracle.kubernetes.operator.create.ExecResultMatcher.*;
@@ -43,6 +44,7 @@ public void defaultInputsFile_hasCorrectContents() throws Exception {
4344
assertThat(
4445
readDefaultInputsFile(),
4546
yamlEqualTo((new CreateDomainInputs())
47+
.version(CREATE_WEBLOGIC_DOMAIN_INPUTS_V1)
4648
.adminNodePort("30701")
4749
.adminPort("7001")
4850
.adminServerName("admin-server")

operator/src/test/java/oracle/kubernetes/operator/create/CreateOperatorInputsFileTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import java.nio.file.Path;
1212
import java.util.List;
1313

14+
import static oracle.kubernetes.operator.VersionConstants.*;
1415
import static oracle.kubernetes.operator.create.CreateOperatorInputs.*;
1516
import static oracle.kubernetes.operator.create.ExecCreateOperator.execCreateOperator;
1617
import static oracle.kubernetes.operator.create.ExecResultMatcher.succeedsAndPrints;
@@ -46,6 +47,7 @@ public void defaultInputsFile_hasCorrectContents() throws Exception {
4647
assertThat(
4748
readDefaultInputsFile(),
4849
yamlEqualTo((new CreateOperatorInputs())
50+
.version(CREATE_WEBLOGIC_OPERATOR_INPUTS_V1)
4951
.elkIntegrationEnabled("false")
5052
.externalDebugHttpPort("30999")
5153
.externalOperatorCert("")

operator/src/test/java/oracle/kubernetes/operator/create/CreateOperatorInputsValidationTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import org.junit.Before;
88
import org.junit.Test;
99

10+
import static oracle.kubernetes.operator.create.CreateOperatorInputs.*;
1011
import static oracle.kubernetes.operator.create.ExecResultMatcher.errorRegexp;
1112
import static oracle.kubernetes.operator.create.ExecResultMatcher.failsAndPrints;
1213
import static org.hamcrest.MatcherAssert.assertThat;
1314

14-
import static oracle.kubernetes.operator.create.CreateOperatorInputs.*;
1515

1616
/**
1717
* Tests that create-weblogic-operator.sh properly validates the parameters
@@ -51,8 +51,6 @@ public void tearDown() throws Exception {
5151
private static final String PARAM_JAVA_LOGGING_LEVEL = "javaLoggingLevel";
5252
private static final String PARAM_ELK_INTEGRATION_ENABLED = "elkIntegrationEnabled";
5353

54-
private static final String VERSION_V1 = "create-weblogic-operator-inputs/v1";
55-
5654
@Test
5755
public void createOperator_with_missingVersion_failsAndReturnsError() throws Exception {
5856
assertThat(

0 commit comments

Comments
 (0)