From 7568e10ae31d14db7c8b0439aef32242919442a3 Mon Sep 17 00:00:00 2001 From: Lars Wander Date: Fri, 29 Sep 2017 13:05:14 -0400 Subject: [PATCH] feat(provider/kubernetes): Register v2 provider --- app/scripts/app.ts | 2 ++ .../modules/kubernetes/kubernetes.module.js | 1 + .../kubernetes/v2/kubernetes.v2.module.ts | 25 +++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 app/scripts/modules/kubernetes/v2/kubernetes.v2.module.ts diff --git a/app/scripts/app.ts b/app/scripts/app.ts index 1d2a8097923..a7fa1856a78 100644 --- a/app/scripts/app.ts +++ b/app/scripts/app.ts @@ -6,6 +6,7 @@ import { AMAZON_MODULE } from '@spinnaker/amazon'; import { APPENGINE_MODULE } from './modules/appengine/appengine.module'; import { GOOGLE_MODULE } from '@spinnaker/google'; import { CANARY_MODULE } from './modules/canary/canary.module'; +import { KUBERNETES_V2_MODULE } from './modules/kubernetes/v2/kubernetes.v2.module'; module('netflix.spinnaker', [ CORE_MODULE, @@ -21,4 +22,5 @@ module('netflix.spinnaker', [ require('./modules/dcos/dcos.module.js').name, APPENGINE_MODULE, CANARY_MODULE, + KUBERNETES_V2_MODULE, ]); diff --git a/app/scripts/modules/kubernetes/kubernetes.module.js b/app/scripts/modules/kubernetes/kubernetes.module.js index c1f3270c334..17cff2e3d0a 100644 --- a/app/scripts/modules/kubernetes/kubernetes.module.js +++ b/app/scripts/modules/kubernetes/kubernetes.module.js @@ -59,6 +59,7 @@ module.exports = angular.module('spinnaker.kubernetes', [ cloudProviderRegistryProvider.registerProvider('kubernetes', { name: 'Kubernetes', providerVersion: 'v1', + defaultVersion: true, cache: { configurer: 'kubernetesCacheConfigurer', }, diff --git a/app/scripts/modules/kubernetes/v2/kubernetes.v2.module.ts b/app/scripts/modules/kubernetes/v2/kubernetes.v2.module.ts new file mode 100644 index 00000000000..829cd49c7df --- /dev/null +++ b/app/scripts/modules/kubernetes/v2/kubernetes.v2.module.ts @@ -0,0 +1,25 @@ +import { module } from 'angular'; + +import { CLOUD_PROVIDER_REGISTRY, CloudProviderRegistry } from '@spinnaker/core'; + +import '../logo/kubernetes.logo.less'; + +// load all templates into the $templateCache +const templates = require.context('./', true, /\.html$/); +templates.keys().forEach(function (key) { + templates(key); +}); + +export const KUBERNETES_V2_MODULE = 'spinnaker.v2.kubernetes'; + +module(KUBERNETES_V2_MODULE, [ + CLOUD_PROVIDER_REGISTRY, +]).config((cloudProviderRegistryProvider: CloudProviderRegistry) => { + cloudProviderRegistryProvider.registerProvider('kubernetes', { + name: 'Kubernetes', + providerVersion: 'v2', + logo: { + path: require('../logo/kubernetes.icon.svg'), + }, + }); + });