diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.js index b5d3316e..a0ab4354 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.js @@ -33,6 +33,7 @@ 'horizon.dashboard.container-infra.cluster-templates.details' ]) .constant('horizon.dashboard.container-infra.cluster-templates.events', events()) + .constant('horizon.dashboard.container-infra.cluster-templates.distros', distros()) .constant( 'horizon.dashboard.container-infra.cluster-templates.resourceType', 'OS::Magnum::ClusterTemplate') @@ -52,6 +53,16 @@ }; } + /** + * @ngdoc constant + * @name distros + * @return [distros] available image distros + * @description A list available image distros for magnum + */ + function distros() { + return ["fedora-atomic", "coreos", "ubuntu"]; + } + run.$inject = [ 'horizon.framework.conf.resource-type-registry.service', 'horizon.dashboard.container-infra.cluster-templates.service', diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/workflow/workflow.service.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/workflow/workflow.service.js index 0fe472f5..0b3aebf2 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/workflow/workflow.service.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/workflow/workflow.service.js @@ -30,10 +30,20 @@ 'horizon.framework.util.i18n.gettext', 'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.nova', - 'horizon.app.core.openstack-service-api.glance' + 'horizon.app.core.openstack-service-api.glance', + 'horizon.dashboard.container-infra.cluster-templates.distros' ]; - function ClusterTemplateWorkflow($q, basePath, workflowService, gettext, magnum, nova, glance) { + function ClusterTemplateWorkflow( + $q, + basePath, + workflowService, + gettext, + magnum, + nova, + glance, + distros + ) { var workflow = { init: init, update: update @@ -512,7 +522,10 @@ function onGetImages(response) { images = [{value:"", name: gettext("Choose an Image")}]; angular.forEach(response.data.items, function(item) { - images.push({value: item.name, name: item.name}); + if (!angular.isUndefined(item.properties) && + distros.indexOf(item.properties.os_distro) >= 0) { + images.push({value: item.name, name: item.name}); + } }); form[0].tabs[1].items[0].items[0].items[0].titleMap = images; var deferred = $q.defer();