Skip to content

Commit 3d09bba

Browse files
committed
Remove storage and update introspector and pod helpers
1 parent 744704e commit 3d09bba

File tree

18 files changed

+33
-1203
lines changed

18 files changed

+33
-1203
lines changed

model/src/main/java/oracle/kubernetes/weblogic/domain/DomainConfigurator.java

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import javax.annotation.Nonnull;
1313
import oracle.kubernetes.weblogic.domain.v2.Domain;
1414
import oracle.kubernetes.weblogic.domain.v2.DomainSpec;
15-
import oracle.kubernetes.weblogic.domain.v2.DomainStorage;
1615

1716
/**
1817
* Configures a domain, adding settings independently of the version of the domain representation.
@@ -128,62 +127,6 @@ public DomainConfigurator withLogHomeEnabled(boolean logHomeEnabled) {
128127
return this;
129128
}
130129

131-
/**
132-
* Configures the domain to use a persistent volume claim defined before the domain is created.
133-
*
134-
* @param claimName the name of the persistent volume claim
135-
* @return this object
136-
*/
137-
public DomainConfigurator withPredefinedClaim(String claimName) {
138-
getDomainSpec().setStorage(DomainStorage.createPredefinedClaim(claimName));
139-
return this;
140-
}
141-
142-
/**
143-
* Configures the domain to use storage in the local node.
144-
*
145-
* @param path the path to the storage
146-
* @return this object
147-
*/
148-
public DomainConfigurator withHostPathStorage(String path) {
149-
getDomainSpec().setStorage(DomainStorage.createHostPathStorage(path));
150-
return this;
151-
}
152-
153-
/**
154-
* Configures the domain to use storage on a remote server.
155-
*
156-
* @param server the server hosting the storage
157-
* @param path the path to the storage
158-
* @return this object
159-
*/
160-
public DomainConfigurator withNfsStorage(String server, String path) {
161-
getDomainSpec().setStorage(DomainStorage.createNfsStorage(server, path));
162-
return this;
163-
}
164-
165-
/**
166-
* Defines the amount of storage to allocate for the domain.
167-
*
168-
* @param size the size to allocate
169-
* @return this object
170-
*/
171-
public DomainConfigurator withStorageSize(String size) {
172-
getDomainSpec().getStorage().setStorageSize(size);
173-
return this;
174-
}
175-
176-
/**
177-
* Defines the amount of storage to allocate for the domain.
178-
*
179-
* @param policy the size to allocate
180-
* @return this object
181-
*/
182-
public DomainConfigurator withStorageReclaimPolicy(String policy) {
183-
getDomainSpec().getStorage().setStorageReclaimPolicy(policy);
184-
return this;
185-
}
186-
187130
/**
188131
* Sets the WebLogic configuration overrides configmap name for the domain
189132
*

model/src/main/java/oracle/kubernetes/weblogic/domain/v2/BaseConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ void setContainerSecurityContext(V1SecurityContext containerSecurityContext) {
171171
serverPod.setContainerSecurityContext(containerSecurityContext);
172172
}
173173

174-
List<V1Volume> getAdditionalVolumes() {
174+
public List<V1Volume> getAdditionalVolumes() {
175175
return serverPod.getAdditionalVolumes();
176176
}
177177

178178
void addAdditionalVolume(String name, String path) {
179179
serverPod.addAdditionalVolume(name, path);
180180
}
181181

182-
List<V1VolumeMount> getAdditionalVolumeMounts() {
182+
public List<V1VolumeMount> getAdditionalVolumeMounts() {
183183
return serverPod.getAdditionalVolumeMounts();
184184
}
185185

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

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import com.google.gson.annotations.Expose;
88
import com.google.gson.annotations.SerializedName;
99
import io.kubernetes.client.models.V1ObjectMeta;
10-
import io.kubernetes.client.models.V1PersistentVolume;
11-
import io.kubernetes.client.models.V1PersistentVolumeClaim;
1210
import io.kubernetes.client.models.V1SecretReference;
1311
import java.util.List;
1412
import java.util.Map;
@@ -26,9 +24,6 @@
2624
/** Domain represents a WebLogic domain and how it will be realized in the Kubernetes cluster. */
2725
@SuppressWarnings("deprecation")
2826
public class Domain {
29-
/** The pattern for computing the default persistent volume claim name. */
30-
private static final String PVC_NAME_PATTERN = "%s-weblogic-domain-pvc";
31-
3227
/** The pattern for computing the default shared logs directory. */
3328
private static final String LOG_HOME_DEFAULT_PATTERN = "/shared/logs/%s";
3429

@@ -353,42 +348,6 @@ public Map<String, String> getChannelServiceAnnotations(String channel) {
353348
return getEffectiveConfigurationFactory().getChannelServiceAnnotations(channel);
354349
}
355350

356-
/**
357-
* Returns the name of the persistent volume claim for the logs and PV-based domain.
358-
*
359-
* @return volume claim
360-
*/
361-
public String getPersistentVolumeClaimName() {
362-
return spec.getStorage() == null ? null : getConfiguredClaimName(spec.getStorage());
363-
}
364-
365-
private String getConfiguredClaimName(@Nonnull DomainStorage storage) {
366-
return Optional.ofNullable(storage.getPersistentVolumeClaimName())
367-
.orElse(String.format(PVC_NAME_PATTERN, getDomainUID()));
368-
}
369-
370-
/**
371-
* Returns the persistent volume that must be created for domain storage. May be null.
372-
*
373-
* @return a definition of the kubernetes resource to create
374-
*/
375-
public V1PersistentVolume getRequiredPersistentVolume() {
376-
return spec.getStorage() == null
377-
? null
378-
: spec.getStorage().getRequiredPersistentVolume(getDomainUID());
379-
}
380-
381-
/**
382-
* Returns the persistent volume claim that must be created for domain storage. May be null.
383-
*
384-
* @return a definition of the kubernetes resource to create
385-
*/
386-
public V1PersistentVolumeClaim getRequiredPersistentVolumeClaim() {
387-
return spec.getStorage() == null
388-
? null
389-
: spec.getStorage().getRequiredPersistentVolumeClaim(getDomainUID(), getNamespace());
390-
}
391-
392351
/**
393352
* Returns the name of the Kubernetes configmap that contains optional configuration overrides.
394353
*
@@ -407,10 +366,6 @@ public List<String> getConfigOverrideSecrets() {
407366
return spec.getConfigOverrideSecrets();
408367
}
409368

410-
private String getNamespace() {
411-
return getMetadata().getNamespace();
412-
}
413-
414369
@Override
415370
public String toString() {
416371
return new ToStringBuilder(this)

model/src/main/java/oracle/kubernetes/weblogic/domain/v2/DomainSpec.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,6 @@ public class DomainSpec extends BaseConfiguration {
127127
"True if this domain's home is defined in the docker image for the domain. Defaults to true")
128128
private Boolean domainHomeInImage;
129129

130-
/** The definition of the storage used for this domain. */
131-
@Description(
132-
"The storage used for this domain. "
133-
+ "Defaults to a predefined claim for a PVC whose name is "
134-
+ "the domain UID followed by '-weblogic-domain-pvc'")
135-
private DomainStorage storage;
136-
137130
/**
138131
* The name of the Kubernetes configmap used for optional WebLogic configuration overrides.
139132
*
@@ -417,24 +410,6 @@ public DomainSpec withReplicas(Integer replicas) {
417410
return this;
418411
}
419412

420-
/**
421-
* Specifies the storage for the domain.
422-
*
423-
* @param storage the definition of the domain storage.
424-
*/
425-
public void setStorage(DomainStorage storage) {
426-
this.storage = storage;
427-
}
428-
429-
/**
430-
* Returns the storage for the domain.
431-
*
432-
* @return the definition of the domain storage.
433-
*/
434-
public DomainStorage getStorage() {
435-
return storage;
436-
}
437-
438413
@Nullable
439414
String getConfigOverrides() {
440415
return configOverrides;
@@ -480,7 +455,6 @@ public String toString() {
480455
.append("adminSecret", adminSecret)
481456
.append("image", image)
482457
.append("imagePullPolicy", imagePullPolicy)
483-
.append("storage", storage)
484458
.append("imagePullSecrets", imagePullSecrets)
485459
.append("adminServer", adminServer)
486460
.append("managedServers", managedServers)
@@ -506,7 +480,6 @@ public int hashCode() {
506480
.append(adminSecret)
507481
.append(image)
508482
.append(imagePullPolicy)
509-
.append(storage)
510483
.append(imagePullSecrets)
511484
.append(adminServer)
512485
.append(managedServers)
@@ -535,7 +508,6 @@ public boolean equals(Object other) {
535508
.append(domainHomeInImage, rhs.domainHomeInImage)
536509
.append(adminSecret, rhs.adminSecret)
537510
.append(image, rhs.image)
538-
.append(storage, rhs.storage)
539511
.append(imagePullPolicy, rhs.imagePullPolicy)
540512
.append(imagePullSecrets, rhs.imagePullSecrets)
541513
.append(adminServer, rhs.adminServer)

0 commit comments

Comments
 (0)