Skip to content

Commit 7a7dd1f

Browse files
committed
clean up
1 parent 356a9ea commit 7a7dd1f

File tree

5 files changed

+7
-22
lines changed

5 files changed

+7
-22
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ private static boolean isDeprecatedDedicated() {
570570
public static String getIntrospectorJobNameSuffix() {
571571
return Optional.ofNullable(tuningAndConfig()
572572
.get(LegalNames.INTROSPECTOR_JOB_NAME_SUFFIX_PARAM))
573-
.orElse(LegalNames.DOMAIN_INTROSPECTOR_JOB_SUFFIX);
573+
.orElse(LegalNames.DEFAULT_INTROSPECTOR_JOB_NAME_SUFFIX);
574574
}
575575

576576
/**
@@ -580,7 +580,7 @@ public static String getIntrospectorJobNameSuffix() {
580580
public static String getExternalServiceNameSuffix() {
581581
return Optional.ofNullable(tuningAndConfig()
582582
.get(LegalNames.EXTERNAL_SERVICE_NAME_SUFFIX_PARAM))
583-
.orElse(LegalNames.EXTERNAL_SERVICE_SUFFIX);
583+
.orElse(LegalNames.DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX);
584584
}
585585

586586
/**

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
import oracle.kubernetes.operator.watcher.WatchListener;
3939
import oracle.kubernetes.operator.work.Step;
4040

41-
import static oracle.kubernetes.operator.helpers.LegalNames.DOMAIN_INTROSPECTOR_JOB_SUFFIX;
42-
4341
/**
4442
* Watches for changes to pods.
4543
*/
@@ -163,7 +161,7 @@ public void receivedResponse(Watch.Response<V1Pod> item) {
163161
switch (item.type) {
164162
case "ADDED":
165163
case "MODIFIED":
166-
if (getPodName(pod).contains(DOMAIN_INTROSPECTOR_JOB_SUFFIX) && isFailed(pod)) {
164+
if (getPodName(pod).contains(Main.Namespaces.getIntrospectorJobNameSuffix()) && isFailed(pod)) {
167165
LOGGER.info(MessageKeys.INTROSPECTOR_POD_FAILED, getPodName(pod), getPodNamespace(pod), pod.getStatus());
168166
}
169167
copyOf(getOnModifiedCallbacks(getPodName(pod))).forEach(c -> c.accept(pod));

operator/src/main/java/oracle/kubernetes/operator/helpers/LegalNames.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
/** A class to create DNS-1123 legal names for Kubernetes objects. */
1616
public class LegalNames {
1717

18-
public static final String EXTERNAL_SERVICE_SUFFIX = "-ext";
18+
public static final String DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX = "-ext";
1919
private static final String SERVER_PATTERN = "%s-%s";
2020
private static final String CLUSTER_SERVICE_PATTERN = "%s-cluster-%s";
21-
public static final String DOMAIN_INTROSPECTOR_JOB_SUFFIX = "-introspector";
21+
public static final String DEFAULT_INTROSPECTOR_JOB_NAME_SUFFIX = "-introspector";
2222
private static final String DOMAIN_INTROSPECTOR_JOB_PATTERN = "%s%s";
2323
private static final String EXTERNAL_SERVICE_PATTERN = "%s-%s%s";
2424

operator/src/main/java/oracle/kubernetes/weblogic/domain/model/Domain.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
import oracle.kubernetes.operator.ProcessingConstants;
3535
import oracle.kubernetes.operator.helpers.LegalNames;
3636
import oracle.kubernetes.operator.helpers.SecretType;
37-
import oracle.kubernetes.operator.logging.LoggingFacade;
38-
import oracle.kubernetes.operator.logging.LoggingFactory;
3937
import oracle.kubernetes.operator.wlsconfig.WlsDomainConfig;
4038
import oracle.kubernetes.operator.wlsconfig.WlsServerConfig;
4139
import oracle.kubernetes.operator.work.Packet;
@@ -116,8 +114,6 @@ public class Domain implements KubernetesObject {
116114
@Description("The current status of the operation of the WebLogic domain. Updated automatically by the operator.")
117115
private DomainStatus status;
118116

119-
private static final LoggingFacade LOGGER = LoggingFactory.getLogger("Operator", "Operator");
120-
121117
@SuppressWarnings({"rawtypes"})
122118
static List sortOrNull(List list) {
123119
return sortOrNull(list, null);
@@ -664,9 +660,6 @@ List<String> getValidationFailures(KubernetesResourceLookup kubernetesResources)
664660

665661
private void verifyIntrospectorJobName() {
666662
// K8S adds a 5 character suffix to an introspector job name
667-
LOGGER.fine("XXX verifyIntrospectorJobName: domain UID = " + getDomainUid()
668-
+ " spec = " + getSpec()
669-
+ "generatedName = " + LegalNames.toJobIntrospectorName(getDomainUid()));
670663
if (LegalNames.toJobIntrospectorName(getDomainUid()).length()
671664
> LegalNames.LEGAL_DNS_LABEL_NAME_MAX_LENGTH - 5) {
672665
failures.add(DomainValidationMessages.exceedMaxIntrospectorJobName(getDomainUid()));
@@ -706,19 +699,13 @@ private void checkGeneratedExternalServiceName(String adminServerName) {
706699
}
707700

708701
private void checkGeneratedServerServiceName(String serverName) {
709-
LOGGER.fine("XXX checkGeneratedServerServiceName: domain UID = " + getDomainUid()
710-
+ " serverName = " + serverName
711-
+ "generatedName = " + LegalNames.toServerServiceName(getDomainUid(), serverName));
712702
if (LegalNames.toServerServiceName(getDomainUid(), serverName).length()
713703
> LegalNames.LEGAL_DNS_LABEL_NAME_MAX_LENGTH) {
714704
failures.add(DomainValidationMessages.exceedMaxServerServiceName(getDomainUid(), serverName));
715705
}
716706
}
717707

718708
private void checkGeneratedClusterServiceName(String clusterName) {
719-
LOGGER.fine("XXX checkGeneratedServerServiceName: domain UID = " + getDomainUid()
720-
+ " clusterName = " + clusterName
721-
+ "generatedName = " + LegalNames.toServerServiceName(getDomainUid(), clusterName));
722709
if (LegalNames.toClusterServiceName(getDomainUid(), clusterName).length()
723710
> LegalNames.LEGAL_DNS_LABEL_NAME_MAX_LENGTH) {
724711
failures.add(DomainValidationMessages.exceedMaxClusterServiceName(getDomainUid(), clusterName));

operator/src/test/java/oracle/kubernetes/operator/PodWatcherTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
import static oracle.kubernetes.operator.LabelConstants.CREATEDBYOPERATOR_LABEL;
3434
import static oracle.kubernetes.operator.LabelConstants.DOMAINUID_LABEL;
35-
import static oracle.kubernetes.operator.helpers.LegalNames.DOMAIN_INTROSPECTOR_JOB_SUFFIX;
35+
import static oracle.kubernetes.operator.helpers.LegalNames.DEFAULT_INTROSPECTOR_JOB_NAME_SUFFIX;
3636
import static oracle.kubernetes.operator.logging.MessageKeys.INTROSPECTOR_POD_FAILED;
3737
import static oracle.kubernetes.utils.LogMatcher.containsInfo;
3838
import static org.hamcrest.Matchers.both;
@@ -123,7 +123,7 @@ private V1Pod createPod() {
123123
}
124124

125125
private V1Pod createIntrospectorPod() {
126-
return new V1Pod().metadata(new V1ObjectMeta().namespace(NS).name(NAME + DOMAIN_INTROSPECTOR_JOB_SUFFIX));
126+
return new V1Pod().metadata(new V1ObjectMeta().namespace(NS).name(NAME + DEFAULT_INTROSPECTOR_JOB_NAME_SUFFIX));
127127
}
128128

129129
@Test

0 commit comments

Comments
 (0)