From 4aa0ad49a862e6dfad9e1980b3a7482b2f9b2286 Mon Sep 17 00:00:00 2001 From: loganhz Date: Tue, 8 May 2018 22:42:47 +0800 Subject: [PATCH 1/2] Support hidden group in catalog --- lib/shared/addon/components/input-answers/component.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/shared/addon/components/input-answers/component.js b/lib/shared/addon/components/input-answers/component.js index 919249299..14f0c3128 100644 --- a/lib/shared/addon/components/input-answers/component.js +++ b/lib/shared/addon/components/input-answers/component.js @@ -6,6 +6,8 @@ import { isSafari } from 'ui/utils/platform'; import { evaluate } from 'shared/utils/evaluate'; import layout from './template'; +const HIDDEN = 'Hidden'; + export default Component.extend({ layout, originQuestions: alias('selectedTemplate.questions'), @@ -119,6 +121,10 @@ export default Component.extend({ filterdQuestions.forEach((item) => { if ( item.group ) { + if ( item.group === HIDDEN ) { + return; + } + if ( !sections[item.group] ) { sections[item.group] = []; } From f2b9a572c497eeeda5dcfb516f7fbcc0bf8df35c Mon Sep 17 00:00:00 2001 From: loganhz Date: Tue, 8 May 2018 23:15:50 +0800 Subject: [PATCH 2/2] Show warning on ingress page for GKE cluster --- app/models/cluster.js | 3 ++- lib/shared/addon/components/new-catalog/component.js | 2 ++ lib/shared/addon/components/new-catalog/template.hbs | 9 +++++++++ .../addon/components/new-edit-ingress/component.js | 3 +++ .../addon/components/new-edit-ingress/template.hbs | 9 +++++++++ translations/en-us.yaml | 1 + 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/models/cluster.js b/app/models/cluster.js index c12b04c1e..3aa2baa48 100644 --- a/app/models/cluster.js +++ b/app/models/cluster.js @@ -4,7 +4,7 @@ import { inject as service } from '@ember/service'; import Resource from 'ember-api-store/models/resource'; import { hasMany } from 'ember-api-store/utils/denormalize'; import ResourceUsage from 'shared/mixins/resource-usage'; -import { alias } from '@ember/object/computed'; +import { equal, alias } from '@ember/object/computed'; import { resolve } from 'rsvp'; export default Resource.extend(ResourceUsage, { @@ -20,6 +20,7 @@ export default Resource.extend(ResourceUsage, { machines: alias('nodes'), clusterRoleTemplateBindings: hasMany('id', 'clusterRoleTemplateBinding', 'clusterId'), roleTemplateBindings: alias('clusterRoleTemplateBindings'), + isGKE: equal('driver', 'googleKubernetesEngine'), actions: { edit() { diff --git a/lib/shared/addon/components/new-catalog/component.js b/lib/shared/addon/components/new-catalog/component.js index abd132098..797bee039 100644 --- a/lib/shared/addon/components/new-catalog/component.js +++ b/lib/shared/addon/components/new-catalog/component.js @@ -21,6 +21,8 @@ export default Component.extend(NewOrEdit, { settings: service(), globalStore: service(), + isGKE: alias('scope.currentCluster.isGKE'), + namespaceErrors: null, allTemplates: null, templateResource: null, diff --git a/lib/shared/addon/components/new-catalog/template.hbs b/lib/shared/addon/components/new-catalog/template.hbs index 1011efb88..482c8bea3 100644 --- a/lib/shared/addon/components/new-catalog/template.hbs +++ b/lib/shared/addon/components/new-catalog/template.hbs @@ -186,6 +186,15 @@ {{/if}} + {{#if isGKE}} + + {{/if}} + {{#if errors.length}}
diff --git a/lib/shared/addon/components/new-edit-ingress/component.js b/lib/shared/addon/components/new-edit-ingress/component.js index c24ec3e94..ec9f6170c 100644 --- a/lib/shared/addon/components/new-edit-ingress/component.js +++ b/lib/shared/addon/components/new-edit-ingress/component.js @@ -9,6 +9,7 @@ import layout from './template'; export default Component.extend(NewOrEdit, { layout, intl: service(), + scope: service(), ingress: null, editing: null, @@ -16,6 +17,8 @@ export default Component.extend(NewOrEdit, { namespacedCertificates: null, certificates: null, + isGKE: alias('scope.currentCluster.isGKE'), + primaryResource: alias('ingress'), actions: { diff --git a/lib/shared/addon/components/new-edit-ingress/template.hbs b/lib/shared/addon/components/new-edit-ingress/template.hbs index c9a1f5f21..39399aff1 100644 --- a/lib/shared/addon/components/new-edit-ingress/template.hbs +++ b/lib/shared/addon/components/new-edit-ingress/template.hbs @@ -52,5 +52,14 @@ }} {{/accordion-list}} +{{#if isGKE}} + +{{/if}} + {{top-errors errors=errors}} {{save-cancel editing=true save="save" cancel="cancel"}} diff --git a/translations/en-us.yaml b/translations/en-us.yaml index 8d1433d75..9401c98ea 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -704,6 +704,7 @@ clustersPage: ingressPage: header: 'Ingress: {name}' + gkeIngressWarning: 'It may take a few minutes for Kubernetes Engine to allocate an external IP address and prepare the load balancer. In the meanwhile, you may get errors like HTTP 404 and HTTP 500 until the load balancer is ready to serve the traffic.' table: targets: label: Targets