fix consuming cluster template with localClusterAuthEndpoint

This commit is contained in:
Westly Wright 2019-07-16 12:23:33 -07:00
parent c580bcc753
commit 1b89c54bc9
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
2 changed files with 10 additions and 11 deletions

View File

@ -4,19 +4,18 @@
{{t "authorizedEndpoint.enabled.label"}}
{{#if clusterTemplateCreate}}
<ClusterTemplateOverrideToggle
@path="localClusterAuthEndpoint"
@path="localClusterAuthEndpoint.enabled"
@configVariable={{enableLocalClusterAuthEndpoint}}
@addOverride={{addOverride}}
@questions={{clusterTemplateRevision.questions}}
/>
{{/if}}
</label>
<CheckComputedOverride
<CheckOverrideAllowed
@paramName="localClusterAuthEndpoint.enabled"
@questions={{clusterTemplateRevision.questions}}
@clusterTemplateRevision={{clusterTemplateRevision.clusterConfig}}
@applyClusterTemplate={{applyClusterTemplate}}
@clusterTemplateCreate={{clusterTemplateCreate}}
@computedOverrideAllowed={{enableLocalClusterAuthEndpointAvailable}}
@enableLocalClusterAuthEndpoint={{mut enableLocalClusterAuthEndpoint}}
@computedState={{enableLocalClusterAuthEndpoint}}
>
<div class="radio">
<label>
@ -36,7 +35,7 @@
{{t "generic.disabled"}}
</label>
</div>
</CheckComputedOverride>
</CheckOverrideAllowed>
</div>
</div>
@ -55,8 +54,8 @@
{{/if}}
</label>
<CheckOverrideAllowed
@questions={{clusterTemplateRevision.questions}}
@paramName="localClusterAuthEndpoint.fqdn"
@questions={{clusterTemplateRevision.questions}}
@clusterTemplateRevision={{clusterTemplateRevision.clusterConfig}}
@applyClusterTemplate={{applyClusterTemplate}}
>

View File

@ -684,7 +684,9 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
willSave() {
const { cluster, configField: field } = this;
if (typeOf(cluster.clearProvidersExcept) === 'function') {
this.checkKubernetesVersionSemVer();
if (typeOf(cluster.clearProvidersExcept) === 'function' || this.applyClusterTemplate && typeOf(cluster.buildClusterAnswersFromConfig) === 'function') {
if (this.applyClusterTemplate) {
// need to add overrides + user entry to answers on cluster, drop rkeconfig
let answers = this.buildClusterAnswersFromConfig(cluster, get(this, 'model.clusterTemplateRevision.questions'));
@ -704,8 +706,6 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
}
}
this.checkKubernetesVersionSemVer();
set(this, 'errors', null);
// return this.validate();