@@ -64,17 +64,18 @@ define(['models/wkt-project', 'utils/script-generator-base', 'utils/k8s-domain-c
64
64
this . adapter . addVariableDefinition ( 'PULL_SECRET_PASS' , this . credentialMask ) ;
65
65
this . adapter . addEmptyLine ( ) ;
66
66
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
+ }
71
72
72
73
this . adapter . addVariableDefinition ( 'DOMAIN_SECRET_NAME' , this . project . k8sDomain . credentialsSecretName . value ) ;
73
74
this . adapter . addVariableDefinition ( 'DOMAIN_SECRET_USER' , this . credentialMask ) ;
74
75
this . adapter . addVariableDefinition ( 'DOMAIN_SECRET_PASS' , this . credentialMask ) ;
75
76
this . adapter . addEmptyLine ( ) ;
76
77
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 ) {
78
79
for ( const secretEntry of this . project . k8sDomain . secrets . value ) {
79
80
const name = secretEntry . name ;
80
81
const user = this . credentialMask ;
@@ -86,7 +87,7 @@ define(['models/wkt-project', 'utils/script-generator-base', 'utils/k8s-domain-c
86
87
}
87
88
}
88
89
89
- if ( this . configMapGenerator . shouldCreateConfigMap ( ) ) {
90
+ if ( this . isModelInImage ( ) && this . configMapGenerator . shouldCreateConfigMap ( ) ) {
90
91
this . adapter . addVariableDefinition ( 'DOMAIN_CONFIG_MAP_YAML' , this . fillInFileNameMask ) ;
91
92
}
92
93
this . adapter . addVariableDefinition ( 'DOMAIN_RESOURCE_YAML' , this . fillInFileNameMask ) ;
@@ -144,17 +145,19 @@ define(['models/wkt-project', 'utils/script-generator-base', 'utils/k8s-domain-c
144
145
this . adapter . addCreatePullSecretBlock ( comment , kubectlExe , pullSecretName , k8sDomainNamespace , pullSecretData ,
145
146
createErrorMessage , deleteErrorMessage , replaceMessage , pullRequiresAuthentication , useExistingPullSecret ) ;
146
147
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
+ }
158
161
159
162
comment = [ 'Create WebLogic domain credentials secret.' ] ;
160
163
const domainSecretName = this . adapter . getVariableReference ( 'DOMAIN_SECRET_NAME' ) ;
@@ -168,7 +171,7 @@ define(['models/wkt-project', 'utils/script-generator-base', 'utils/k8s-domain-c
168
171
this . adapter . addCreateGenericSecretBlock ( comment , kubectlExe , domainSecretName , k8sDomainNamespace ,
169
172
domainSecretData , createErrorMessage , deleteErrorMessage , replaceMessage ) ;
170
173
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 ) {
172
175
for ( const secretEntry of this . project . k8sDomain . secrets . value ) {
173
176
const name = this . adapter . getVariableReference ( getSecretVariableName ( secretEntry . name , 'NAME' ) ) ;
174
177
const data = {
@@ -184,7 +187,7 @@ define(['models/wkt-project', 'utils/script-generator-base', 'utils/k8s-domain-c
184
187
}
185
188
}
186
189
187
- if ( this . configMapGenerator . shouldCreateConfigMap ( ) ) {
190
+ if ( this . isModelInImage ( ) && this . configMapGenerator . shouldCreateConfigMap ( ) ) {
188
191
const configMapName = this . project . k8sDomain . modelConfigMapName . value ;
189
192
const yamlFile = this . adapter . getVariableReference ( 'DOMAIN_CONFIG_MAP_YAML' ) ;
190
193
const errorMessage = `Failed to create domain ConfigMap ${ configMapName } ` ;
0 commit comments