Skip to content

Commit

Permalink
feat(provider/kubernetes): Register v2 provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Wander committed Sep 30, 2017
1 parent 2ecf035 commit 7568e10
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/scripts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -21,4 +22,5 @@ module('netflix.spinnaker', [
require('./modules/dcos/dcos.module.js').name,
APPENGINE_MODULE,
CANARY_MODULE,
KUBERNETES_V2_MODULE,
]);
1 change: 1 addition & 0 deletions app/scripts/modules/kubernetes/kubernetes.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ module.exports = angular.module('spinnaker.kubernetes', [
cloudProviderRegistryProvider.registerProvider('kubernetes', {
name: 'Kubernetes',
providerVersion: 'v1',
defaultVersion: true,
cache: {
configurer: 'kubernetesCacheConfigurer',
},
Expand Down
25 changes: 25 additions & 0 deletions app/scripts/modules/kubernetes/v2/kubernetes.v2.module.ts
Original file line number Diff line number Diff line change
@@ -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'),
},
});
});

0 comments on commit 7568e10

Please sign in to comment.