Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(provider/kubernetes): Move v1 code into v1 module #4211

Merged
merged 1 commit into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/scripts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module('netflix.spinnaker', [
require('./modules/ecs/ecs.module.js').name,
require('./modules/cloudfoundry/cf.module.js').name,
require('./modules/azure/azure.module.js').name,
require('./modules/kubernetes/kubernetes.module.js').name,
require('./modules/kubernetes/v1/kubernetes.v1.module.js').name,
require('./modules/openstack/openstack.module.js').name,
DOCKER_MODULE,
require('./modules/oracle/oraclebmcs.module.js').name,
Expand Down
108 changes: 0 additions & 108 deletions app/scripts/modules/kubernetes/kubernetes.module.js

This file was deleted.

108 changes: 108 additions & 0 deletions app/scripts/modules/kubernetes/v1/kubernetes.v1.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
'use strict';

const angular = require('angular');

import { CLOUD_PROVIDER_REGISTRY, DeploymentStrategyRegistry } from '@spinnaker/core';

import { KUBERNETES_KEY_VALUE_DETAILS } from '../common/keyValueDetails.component';
import { KUBERNETES_SECURITY_CONTEXT_SELECTOR } from '../container/securityContext/securityContextSelector.component';
import { KUBERNETES_HELP } from '../help/kubernetes.help';

import '../logo/kubernetes.logo.less';

// load all templates into the $templateCache
var templates = require.context('./', true, /\.html$/);
templates.keys().forEach(function(key) {
templates(key);
});

module.exports = angular.module('spinnaker.kubernetes.v1', [
require('../autoscaler/autoscaler.write.service.js').name,
require('../cache/configurer.service.js').name,
require('../cluster/cluster.kubernetes.module.js').name,
require('../container/configurer.directive.js').name,
require('../container/probe.directive.js').name,
require('../event/event.directive.js').name,
require('../instance/details/details.kubernetes.module.js').name,
CLOUD_PROVIDER_REGISTRY,
KUBERNETES_KEY_VALUE_DETAILS,
KUBERNETES_SECURITY_CONTEXT_SELECTOR,
KUBERNETES_HELP,
require('../loadBalancer/configure/configure.kubernetes.module.js').name,
require('../loadBalancer/details/details.kubernetes.module.js').name,
require('../loadBalancer/transformer.js').name,
require('../namespace/multiSelectField.component.js').name,
require('../namespace/selectField.directive.js').name,
require('../pipeline/stages/destroyAsg/kubernetesDestroyAsgStage.js').name,
require('../pipeline/stages/disableAsg/kubernetesDisableAsgStage.js').name,
require('../pipeline/stages/disableCluster/kubernetesDisableClusterStage.js').name,
require('../pipeline/stages/enableAsg/kubernetesEnableAsgStage.js').name,
require('../pipeline/stages/findAmi/kubernetesFindAmiStage.js').name,
require('../pipeline/stages/resizeAsg/resizeStage.js').name,
require('../pipeline/stages/runJob/runJobStage.js').name,
require('../pipeline/stages/scaleDownCluster/scaleDownClusterStage.js').name,
require('../pipeline/stages/shrinkCluster/shrinkClusterStage.js').name,
require('../proxy/ui.service.js').name,
require('../search/resultFormatter.js').name,
require('../securityGroup/configure/configure.kubernetes.module.js').name,
require('../securityGroup/details/details.kubernetes.module.js').name,
require('../securityGroup/reader.js').name,
require('../securityGroup/transformer.js').name,
require('../serverGroup/configure/CommandBuilder.js').name,
require('../serverGroup/configure/configure.kubernetes.module.js').name,
require('../serverGroup/details/details.kubernetes.module.js').name,
require('../serverGroup/paramsMixin.js').name,
require('../serverGroup/transformer.js').name,
require('../validation/applicationName.validator.js').name,
])
.config(function(cloudProviderRegistryProvider) {
cloudProviderRegistryProvider.registerProvider('kubernetes', {
name: 'Kubernetes',
providerVersion: 'v1',
defaultVersion: true,
cache: {
configurer: 'kubernetesCacheConfigurer',
},
search: {
resultFormatter: 'kubernetesSearchResultFormatter',
},
logo: {
path: require('../logo/kubernetes.logo.png'),
},
image: {
reader: 'kubernetesImageReader',
},
instance: {
detailsTemplateUrl: require('../instance/details/details.html'),
detailsController: 'kubernetesInstanceDetailsController',
},
loadBalancer: {
transformer: 'kubernetesLoadBalancerTransformer',
detailsTemplateUrl: require('../loadBalancer/details/details.html'),
detailsController: 'kubernetesLoadBalancerDetailsController',
createLoadBalancerTemplateUrl: require('../loadBalancer/configure/wizard/createWizard.html'),
createLoadBalancerController: 'kubernetesUpsertLoadBalancerController',
},
securityGroup: {
reader: 'kubernetesSecurityGroupReader',
transformer: 'kubernetesSecurityGroupTransformer',
detailsTemplateUrl: require('../securityGroup/details/details.html'),
detailsController: 'kubernetesSecurityGroupDetailsController',
createSecurityGroupTemplateUrl: require('../securityGroup/configure/wizard/createWizard.html'),
createSecurityGroupController: 'kubernetesUpsertSecurityGroupController',
},
serverGroup: {
skipUpstreamStageCheck: true,
transformer: 'kubernetesServerGroupTransformer',
detailsTemplateUrl: require('../serverGroup/details/details.html'),
detailsController: 'kubernetesServerGroupDetailsController',
cloneServerGroupController: 'kubernetesCloneServerGroupController',
cloneServerGroupTemplateUrl: require('../serverGroup/configure/wizard/wizard.html'),
commandBuilder: 'kubernetesServerGroupCommandBuilder',
configurationService: 'kubernetesServerGroupConfigurationService',
paramsMixin: 'kubernetesServerGroupParamsMixin',
},
});
});

DeploymentStrategyRegistry.registerProvider('kubernetes', ['custom', 'redblack']);
2 changes: 1 addition & 1 deletion app/scripts/modules/kubernetes/v2/kubernetes.v2.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ templates.keys().forEach(function (key) {
templates(key);
});

export const KUBERNETES_V2_MODULE = 'spinnaker.v2.kubernetes';
export const KUBERNETES_V2_MODULE = 'spinnaker.kubernetes.v2';

module(KUBERNETES_V2_MODULE, [
CLOUD_PROVIDER_REGISTRY,
Expand Down