Skip to content

Commit d809757

Browse files
authored
Merge pull request #987 from oracle/owls-71460
Verify services deleted when cluster scales down
2 parents 1c04521 + d39866d commit d809757

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1506
-841
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ public interface LabelConstants {
2020
String CLUSTERRESTARTVERSION_LABEL = "weblogic.clusterRestartVersion";
2121
String SERVERRESTARTVERSION_LABEL = "weblogic.serverRestartVersion";
2222

23-
static String forDomainUid(String uid) {
23+
static String forDomainUidSelector(String uid) {
2424
return String.format("%s=%s", DOMAINUID_LABEL, uid);
2525
}
26+
27+
static String getCreatedbyOperatorSelector() {
28+
return String.format("%s=%s", CREATEDBYOPERATOR_LABEL, "true");
29+
}
2630
}

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018, 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

@@ -14,10 +14,6 @@
1414

1515
public interface DomainProcessor {
1616

17-
public static DomainProcessor getInstance() {
18-
return DomainProcessorImpl.INSTANCE;
19-
}
20-
2117
public void makeRightDomainPresence(
2218
DomainPresenceInfo info,
2319
boolean explicitRecheck,
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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
3+
// http://oss.oracle.com/licenses/upl.
4+
5+
package oracle.kubernetes.operator;
6+
7+
import java.util.concurrent.ScheduledFuture;
8+
import java.util.concurrent.TimeUnit;
9+
import oracle.kubernetes.operator.helpers.KubernetesVersion;
10+
import oracle.kubernetes.operator.work.FiberGate;
11+
import oracle.kubernetes.operator.work.Step;
12+
13+
/** A set of underlying services required during domain processing. */
14+
public interface DomainProcessorDelegate {
15+
/**
16+
* Returns the namespace associated with the operator itself.
17+
*
18+
* @return a namespace string
19+
*/
20+
String getOperatorNamespace();
21+
22+
/**
23+
* Returns a factory that creates a step to wait for a pod in the specified namespace to be ready.
24+
*
25+
* @param namespace the namespace for the pod
26+
* @return a step-creating factory
27+
*/
28+
PodAwaiterStepFactory getPodAwaiterStepFactory(String namespace);
29+
30+
/**
31+
* Returns true if the namespace is running.
32+
*
33+
* @param namespace the namespace to check
34+
* @return the 'running' state of the namespace
35+
*/
36+
boolean isNamespaceRunning(String namespace);
37+
38+
/**
39+
* Returns the version of the Kubernetes environment in which the operator is running
40+
*
41+
* @return an object that represents the Kubernetes version
42+
*/
43+
KubernetesVersion getVersion();
44+
45+
/**
46+
* Creates a new FiberGate.
47+
*
48+
* @return the created instance
49+
*/
50+
FiberGate createFiberGate();
51+
52+
/**
53+
* Runs a chain of steps
54+
*
55+
* @param firstStep the first step to run
56+
*/
57+
void runSteps(Step firstStep);
58+
59+
/**
60+
* Schedules the specified command to run periodically.
61+
*
62+
* @param command the command to run
63+
* @param initialDelay the number of time units to wait before running the command the first time
64+
* @param delay the number of time units to delay between successive runs
65+
* @param unit the time unit for the above delays
66+
* @return a future which indicates completion of the command
67+
*/
68+
ScheduledFuture<?> scheduleWithFixedDelay(
69+
Runnable command, long initialDelay, long delay, TimeUnit unit);
70+
}

0 commit comments

Comments
 (0)