Commit 3b5dc97f authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '205691-mg-fix-knative-install-error' into 'master'

Use less cryptic error message for missing Knative domain

Closes #205691

See merge request gitlab-org/gitlab!32799
parents 130168ba 97c28112
...@@ -468,6 +468,11 @@ export default class Clusters { ...@@ -468,6 +468,11 @@ export default class Clusters {
return; return;
} }
if (appId === KNATIVE && !params.hostname && !params.pages_domain_id) {
reject(s__('ClusterIntegration|You must specify a domain before you can install Knative.'));
return;
}
resolve(); resolve();
}); });
} }
...@@ -520,6 +525,7 @@ export default class Clusters { ...@@ -520,6 +525,7 @@ export default class Clusters {
this.store.updateAppProperty(appId, 'isEditingDomain', true); this.store.updateAppProperty(appId, 'isEditingDomain', true);
this.store.updateAppProperty(appId, 'hostname', domain); this.store.updateAppProperty(appId, 'hostname', domain);
this.store.updateAppProperty(appId, 'pagesDomain', domainId ? { id: domainId, domain } : null); this.store.updateAppProperty(appId, 'pagesDomain', domainId ? { id: domainId, domain } : null);
this.store.updateAppProperty(appId, 'validationError', null);
} }
setCrossplaneProviderStack(data) { setCrossplaneProviderStack(data) {
......
...@@ -82,6 +82,9 @@ export default { ...@@ -82,6 +82,9 @@ export default {
showDomainsDropdown() { showDomainsDropdown() {
return this.availableDomains.length > 0; return this.availableDomains.length > 0;
}, },
validationError() {
return this.knative.validationError;
},
}, },
watch: { watch: {
knativeUpdateSuccessful(updateSuccessful) { knativeUpdateSuccessful(updateSuccessful) {
...@@ -157,6 +160,8 @@ export default { ...@@ -157,6 +160,8 @@ export default {
type="text" type="text"
class="form-control js-knative-domainname" class="form-control js-knative-domainname"
/> />
<span v-if="validationError" class="gl-field-error">{{ validationError }}</span>
</div> </div>
<template v-if="knativeInstalled"> <template v-if="knativeInstalled">
......
...@@ -5368,6 +5368,9 @@ msgstr "" ...@@ -5368,6 +5368,9 @@ msgstr ""
msgid "ClusterIntegration|You must have an RBAC-enabled cluster to install Knative." msgid "ClusterIntegration|You must have an RBAC-enabled cluster to install Knative."
msgstr "" msgstr ""
msgid "ClusterIntegration|You must specify a domain before you can install Knative."
msgstr ""
msgid "ClusterIntegration|You should select at least two subnets" msgid "ClusterIntegration|You should select at least two subnets"
msgstr "" msgstr ""
......
...@@ -268,13 +268,18 @@ describe('Clusters', () => { ...@@ -268,13 +268,18 @@ describe('Clusters', () => {
cluster.store.state.applications[applicationId].status = INSTALLABLE; cluster.store.state.applications[applicationId].status = INSTALLABLE;
const params = {};
if (applicationId === 'knative') {
params.hostname = 'test-example.com';
}
// eslint-disable-next-line promise/valid-params // eslint-disable-next-line promise/valid-params
cluster cluster
.installApplication({ id: applicationId }) .installApplication({ id: applicationId, params })
.then(() => { .then(() => {
expect(cluster.store.state.applications[applicationId].status).toEqual(INSTALLING); expect(cluster.store.state.applications[applicationId].status).toEqual(INSTALLING);
expect(cluster.store.state.applications[applicationId].requestReason).toEqual(null); expect(cluster.store.state.applications[applicationId].requestReason).toEqual(null);
expect(cluster.service.installApplication).toHaveBeenCalledWith(applicationId, undefined); expect(cluster.service.installApplication).toHaveBeenCalledWith(applicationId, params);
done(); done();
}) })
.catch(); .catch();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment