File tree Expand file tree Collapse file tree 6 files changed +26
-8
lines changed
java/oracle/kubernetes/operator/helpers Expand file tree Collapse file tree 6 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 39
39
40
40
public abstract class BasePodStepContext extends StepContextBase {
41
41
42
+ public static final String KUBERNETES_PLATFORM_SYSTEM_PROPERTY = "kubernetesPlatform" ;
43
+
42
44
BasePodStepContext (DomainPresenceInfo info ) {
43
45
super (info );
44
46
}
Original file line number Diff line number Diff line change @@ -325,6 +325,9 @@ List<V1EnvVar> getConfiguredEnvVars(TuningParameters tuningParameters) {
325
325
addEnvVar (vars , IntrospectorJobEnvVars .ISTIO_ENABLED , Boolean .toString (isIstioEnabled ()));
326
326
addEnvVar (vars , IntrospectorJobEnvVars .ADMIN_CHANNEL_PORT_FORWARDING_ENABLED ,
327
327
Boolean .toString (isAdminChannelPortForwardingEnabled (getDomain ().getSpec ())));
328
+ Optional .ofNullable (getKubernetesPlatform ())
329
+ .ifPresent (v -> addEnvVar (vars , ServerEnvVars .KUBERNETES_PLATFORM , v ));
330
+
328
331
addEnvVar (vars , IntrospectorJobEnvVars .ISTIO_READINESS_PORT , Integer .toString (getIstioReadinessPort ()));
329
332
addEnvVar (vars , IntrospectorJobEnvVars .ISTIO_POD_NAMESPACE , getNamespace ());
330
333
if (isUseOnlineUpdate ()) {
@@ -391,6 +394,10 @@ List<V1EnvVar> getConfiguredEnvVars(TuningParameters tuningParameters) {
391
394
return vars ;
392
395
}
393
396
397
+ private String getKubernetesPlatform () {
398
+ return System .getProperty (KUBERNETES_PLATFORM_SYSTEM_PROPERTY );
399
+ }
400
+
394
401
}
395
402
396
403
static class DomainIntrospectorJobStep extends Step {
Original file line number Diff line number Diff line change @@ -1081,7 +1081,7 @@ private boolean mockWls() {
1081
1081
}
1082
1082
1083
1083
private String getKubernetesPlatform () {
1084
- return System .getProperty ("kubernetesPlatform" );
1084
+ return System .getProperty (KUBERNETES_PLATFORM_SYSTEM_PROPERTY );
1085
1085
}
1086
1086
1087
1087
private abstract class BaseStep extends Step {
Original file line number Diff line number Diff line change @@ -905,6 +905,10 @@ def generate(self):
905
905
self .close ()
906
906
907
907
def addDomainConfig (self ):
908
+ kubernetes_platform = self .env .getEnvOrDef ("KUBERNETES_PLATFORM" , "" )
909
+ if (str (kubernetes_platform ).upper () == 'OPENSHIFT' ):
910
+ os .system ("chmod -R g=u %s" % self .domain_home )
911
+
908
912
# Note: only config type is needed fmwconfig, security is excluded because it's in the primordial and contain
909
913
# all the many policies files
910
914
packcmd = "tar -pczf /tmp/domain.tar.gz %s/config/config.xml %s/config/jdbc/ %s/config/jms %s/config/coherence " \
Original file line number Diff line number Diff line change @@ -785,6 +785,12 @@ function createPrimordialDomain() {
785
785
local MII_PASSPHRASE=$( cat ${RUNTIME_ENCRYPTION_SECRET_PASSWORD} )
786
786
encrypt_decrypt_domain_secret " encrypt" ${DOMAIN_HOME} ${MII_PASSPHRASE}
787
787
788
+ if [[ " ${KUBERNETES_PLATFORM^^} " == " OPENSHIFT" ]]; then
789
+ # Operator running on Openshift platform - change file permissions in the DOMAIN_HOME dir to give
790
+ # group same permissions as user .
791
+ chmod -R g=u ${DOMAIN_HOME} || return 1
792
+ fi
793
+
788
794
tar -pczf ${LOCAL_PRIM_DOMAIN_ZIP} --exclude ${DOMAIN_HOME} /wlsdeploy --exclude ${DOMAIN_HOME} /sysman/log \
789
795
--exclude ${DOMAIN_HOME} /lib --exclude ${DOMAIN_HOME} /backup_config ${empath} ${DOMAIN_HOME} /*
790
796
Original file line number Diff line number Diff line change @@ -300,17 +300,16 @@ if [ ${DOMAIN_SOURCE_TYPE} != "FromModel" ]; then
300
300
copySitCfgWhileBooting /weblogic-operator/introspector ${DOMAIN_HOME} /optconfig/jms ' Sit-Cfg-JMS--'
301
301
copySitCfgWhileBooting /weblogic-operator/introspector ${DOMAIN_HOME} /optconfig/jdbc ' Sit-Cfg-JDBC--'
302
302
copySitCfgWhileBooting /weblogic-operator/introspector ${DOMAIN_HOME} /optconfig/diagnostics ' Sit-Cfg-WLDF--'
303
- else
304
- if [[ ${KUBERNETES_PLATFORM^^} == " OPENSHIFT" ]]; then
305
- # Operator running on Openshift platform - change file permissions in the DOMAIN_HOME dir to give
306
- # group same permissions as user .
307
- chmod -R g=u ${DOMAIN_HOME} || return 1
308
- fi
309
303
fi
310
304
311
- if [[ ${KUBERNETES_PLATFORM^^} == " OPENSHIFT" ]]; then
305
+ if [[ " ${KUBERNETES_PLATFORM^^} " == " OPENSHIFT" ]]; then
312
306
# When the Operator is running on Openshift platform, disable insecure file system warnings.
313
307
export JAVA_OPTIONS=" -Dweblogic.SecureMode.WarnOnInsecureFileSystem=false $JAVA_OPTIONS "
308
+ if [[ " ${DOMAIN_SOURCE_TYPE} " == " Image" ]]; then
309
+ # Change the file permissions in the DOMAIN_HOME dir to give group same permissions as user .
310
+ chmod -R g=u ${DOMAIN_HOME} || return 1
311
+ fi
312
+
314
313
fi
315
314
316
315
#
You can’t perform that action at this time.
0 commit comments