@@ -64,17 +64,18 @@ define(['models/wkt-project', 'utils/script-generator-base', 'utils/k8s-domain-c
6464 this . adapter . addVariableDefinition ( 'PULL_SECRET_PASS' , this . credentialMask ) ;
6565 this . adapter . addEmptyLine ( ) ;
6666
67- this . adapter . addVariableDefinition ( 'TARGET_DOMAIN_LOCATION' , this . project . settings . targetDomainLocation . value ) ;
68- this . adapter . addVariableDefinition ( 'RUNTIME_SECRET_NAME' , this . project . k8sDomain . runtimeSecretName . value ) ;
69- this . adapter . addVariableDefinition ( 'RUNTIME_SECRET_PASS' , this . project . k8sDomain . runtimeSecretValue . value ) ;
70- this . adapter . addEmptyLine ( ) ;
67+ if ( this . isModelInImage ( ) ) {
68+ this . adapter . addVariableDefinition ( 'RUNTIME_SECRET_NAME' , this . project . k8sDomain . runtimeSecretName . value ) ;
69+ this . adapter . addVariableDefinition ( 'RUNTIME_SECRET_PASS' , this . project . k8sDomain . runtimeSecretValue . value ) ;
70+ this . adapter . addEmptyLine ( ) ;
71+ }
7172
7273 this . adapter . addVariableDefinition ( 'DOMAIN_SECRET_NAME' , this . project . k8sDomain . credentialsSecretName . value ) ;
7374 this . adapter . addVariableDefinition ( 'DOMAIN_SECRET_USER' , this . credentialMask ) ;
7475 this . adapter . addVariableDefinition ( 'DOMAIN_SECRET_PASS' , this . credentialMask ) ;
7576 this . adapter . addEmptyLine ( ) ;
7677
77- if ( this . project . k8sDomain . secrets . value && this . project . k8sDomain . secrets . value . length > 0 ) {
78+ if ( this . isModelInImage ( ) && this . project . k8sDomain . secrets . value && this . project . k8sDomain . secrets . value . length > 0 ) {
7879 for ( const secretEntry of this . project . k8sDomain . secrets . value ) {
7980 const name = secretEntry . name ;
8081 const user = this . credentialMask ;
@@ -86,7 +87,7 @@ define(['models/wkt-project', 'utils/script-generator-base', 'utils/k8s-domain-c
8687 }
8788 }
8889
89- if ( this . configMapGenerator . shouldCreateConfigMap ( ) ) {
90+ if ( this . isModelInImage ( ) && this . configMapGenerator . shouldCreateConfigMap ( ) ) {
9091 this . adapter . addVariableDefinition ( 'DOMAIN_CONFIG_MAP_YAML' , this . fillInFileNameMask ) ;
9192 }
9293 this . adapter . addVariableDefinition ( 'DOMAIN_RESOURCE_YAML' , this . fillInFileNameMask ) ;
@@ -144,17 +145,19 @@ define(['models/wkt-project', 'utils/script-generator-base', 'utils/k8s-domain-c
144145 this . adapter . addCreatePullSecretBlock ( comment , kubectlExe , pullSecretName , k8sDomainNamespace , pullSecretData ,
145146 createErrorMessage , deleteErrorMessage , replaceMessage , pullRequiresAuthentication , useExistingPullSecret ) ;
146147
147- comment = [ 'Create runtime encryption secret, if needed.' ] ;
148- const targetDomainLocation = this . adapter . getVariableReference ( 'TARGET_DOMAIN_LOCATION' ) ;
149- const runtimeSecretName = this . adapter . getVariableReference ( 'RUNTIME_SECRET_NAME' ) ;
150- const runtimeSecretData = {
151- password : this . adapter . getVariableReference ( 'RUNTIME_SECRET_PASS' )
152- } ;
153- createErrorMessage = `Failed to create runtime encryption secret ${ runtimeSecretName } in namespace ${ k8sDomainNamespace } ` ;
154- replaceMessage = `Replacing existing runtime encryption secret ${ runtimeSecretName } in namespace ${ k8sDomainNamespace } ` ;
155- deleteErrorMessage = `Failed to delete runtime encryption secret ${ runtimeSecretName } in namespace ${ k8sDomainNamespace } ` ;
156- this . adapter . addCreateRuntimeSecretBlock ( comment , kubectlExe , targetDomainLocation , runtimeSecretName ,
157- k8sDomainNamespace , runtimeSecretData , createErrorMessage , deleteErrorMessage , replaceMessage ) ;
148+ if ( this . isModelInImage ( ) ) {
149+ comment = [ 'Create runtime encryption secret, if needed.' ] ;
150+ const targetDomainLocation = this . adapter . getVariableReference ( 'TARGET_DOMAIN_LOCATION' ) ;
151+ const runtimeSecretName = this . adapter . getVariableReference ( 'RUNTIME_SECRET_NAME' ) ;
152+ const runtimeSecretData = {
153+ password : this . adapter . getVariableReference ( 'RUNTIME_SECRET_PASS' )
154+ } ;
155+ createErrorMessage = `Failed to create runtime encryption secret ${ runtimeSecretName } in namespace ${ k8sDomainNamespace } ` ;
156+ replaceMessage = `Replacing existing runtime encryption secret ${ runtimeSecretName } in namespace ${ k8sDomainNamespace } ` ;
157+ deleteErrorMessage = `Failed to delete runtime encryption secret ${ runtimeSecretName } in namespace ${ k8sDomainNamespace } ` ;
158+ this . adapter . addCreateRuntimeSecretBlock ( comment , kubectlExe , targetDomainLocation , runtimeSecretName ,
159+ k8sDomainNamespace , runtimeSecretData , createErrorMessage , deleteErrorMessage , replaceMessage ) ;
160+ }
158161
159162 comment = [ 'Create WebLogic domain credentials secret.' ] ;
160163 const domainSecretName = this . adapter . getVariableReference ( 'DOMAIN_SECRET_NAME' ) ;
@@ -168,7 +171,7 @@ define(['models/wkt-project', 'utils/script-generator-base', 'utils/k8s-domain-c
168171 this . adapter . addCreateGenericSecretBlock ( comment , kubectlExe , domainSecretName , k8sDomainNamespace ,
169172 domainSecretData , createErrorMessage , deleteErrorMessage , replaceMessage ) ;
170173
171- if ( this . project . k8sDomain . secrets . value && this . project . k8sDomain . secrets . value . length > 0 ) {
174+ if ( this . isModelInImage ( ) && this . project . k8sDomain . secrets . value && this . project . k8sDomain . secrets . value . length > 0 ) {
172175 for ( const secretEntry of this . project . k8sDomain . secrets . value ) {
173176 const name = this . adapter . getVariableReference ( getSecretVariableName ( secretEntry . name , 'NAME' ) ) ;
174177 const data = {
@@ -184,7 +187,7 @@ define(['models/wkt-project', 'utils/script-generator-base', 'utils/k8s-domain-c
184187 }
185188 }
186189
187- if ( this . configMapGenerator . shouldCreateConfigMap ( ) ) {
190+ if ( this . isModelInImage ( ) && this . configMapGenerator . shouldCreateConfigMap ( ) ) {
188191 const configMapName = this . project . k8sDomain . modelConfigMapName . value ;
189192 const yamlFile = this . adapter . getVariableReference ( 'DOMAIN_CONFIG_MAP_YAML' ) ;
190193 const errorMessage = `Failed to create domain ConfigMap ${ configMapName } ` ;
0 commit comments