@spinnaker/google 0.2.4 → 0.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,61 +20,62 @@ module(GOOGLE_LOADBALANCER_CONFIGURE_HTTP_LISTENERS_LISTENER_COMPONENT, [GCE_ADD
20
20
  },
21
21
  templateUrl: require('./listener.component.html'),
22
22
  controller: function () {
23
- this.certificates = this.command.backingData.certificates;
24
- const loadBalancerMap = this.command.backingData.loadBalancerMap;
23
+ this.$onInit = () => {
24
+ this.certificates = this.command.backingData.certificates;
25
+ const loadBalancerMap = this.command.backingData.loadBalancerMap;
25
26
 
26
- this.getName = (listener, applicationName) => {
27
- const listenerName = [applicationName, listener.stack || '', listener.detail || ''].join('-');
28
- return _.trimEnd(listenerName, '-');
29
- };
27
+ this.getName = (listener, applicationName) => {
28
+ const listenerName = [applicationName, listener.stack || '', listener.detail || ''].join('-');
29
+ return _.trimEnd(listenerName, '-');
30
+ };
30
31
 
31
- this.getCertificates = () => {
32
- return this.command.backingData.certificates
33
- .filter((certificate) => certificate.account === this.command.loadBalancer.credentials)
34
- .map((certificate) => certificate.name);
35
- };
32
+ this.getCertificates = () => {
33
+ return this.command.backingData.certificates
34
+ .filter((certificate) => certificate.account === this.command.loadBalancer.credentials)
35
+ .map((certificate) => certificate.name);
36
+ };
36
37
 
37
- this.getSubnets = () => {
38
- const ret = this.command.backingData.subnetMap[this.command.loadBalancer.network]
39
- .filter((subnet) => subnet.region === this.command.loadBalancer.region)
40
- .map((subnet) => subnet.name);
41
- return _.uniq(ret);
42
- };
38
+ this.getSubnets = () => {
39
+ const ret = this.command.backingData.subnetMap[this.command.loadBalancer.network]
40
+ .filter((subnet) => subnet.region === this.command.loadBalancer.region)
41
+ .map((subnet) => subnet.name);
42
+ return _.uniq(ret);
43
+ };
43
44
 
44
- this.getInternalAddresses = () => {
45
- const ret = this.command.backingData.addresses.filter(
46
- (address) =>
47
- address.addressType === 'INTERNAL' && address.subnetwork.split('/').pop() === this.listener.subnet,
48
- );
49
- return ret;
50
- };
45
+ this.getInternalAddresses = () => {
46
+ return this.command.backingData.addresses.filter(
47
+ (address) =>
48
+ address.addressType === 'INTERNAL' && address.subnetwork.split('/').pop() === this.listener.subnet,
49
+ );
50
+ };
51
51
 
52
- this.updateName = (listener, appName) => {
53
- listener.name = this.getName(listener, appName);
54
- };
52
+ this.updateName = (listener, appName) => {
53
+ listener.name = this.getName(listener, appName);
54
+ };
55
55
 
56
- this.localListenerHasSameName = () => {
57
- return (
58
- this.command.loadBalancer.listeners.filter((listener) => listener.name === this.listener.name).length > 1
59
- );
60
- };
61
-
62
- this.existingListenerNames = () => {
63
- return _.get(loadBalancerMap, [this.command.loadBalancer.credentials, 'listeners']);
64
- };
56
+ this.localListenerHasSameName = () => {
57
+ return (
58
+ this.command.loadBalancer.listeners.filter((listener) => listener.name === this.listener.name).length > 1
59
+ );
60
+ };
65
61
 
66
- this.isHttps = (port) => port === 443 || port === '443';
62
+ this.existingListenerNames = () => {
63
+ return _.get(loadBalancerMap, [this.command.loadBalancer.credentials, 'listeners']);
64
+ };
67
65
 
68
- if (!this.listener.name) {
69
- this.updateName(this.listener, this.application.name);
70
- }
66
+ this.isHttps = (port) => port === 443 || port === '443';
71
67
 
72
- this.onAddressSelect = (address) => {
73
- if (address) {
74
- this.listener.ipAddress = address.address;
75
- } else {
76
- this.listener.ipAddress = null;
68
+ if (!this.listener.name) {
69
+ this.updateName(this.listener, this.application.name);
77
70
  }
71
+
72
+ this.onAddressSelect = (address) => {
73
+ if (address) {
74
+ this.listener.ipAddress = address.address;
75
+ } else {
76
+ this.listener.ipAddress = null;
77
+ }
78
+ };
78
79
  };
79
80
  },
80
81
  },
@@ -12,16 +12,18 @@ module(GOOGLE_LOADBALANCER_DETAILS_LOADBALANCERTYPE_LOADBALANCERTYPE_COMPONENT,
12
12
  loadBalancer: '=',
13
13
  },
14
14
  controller: function () {
15
- this.type = (function (lb) {
16
- if (lb.loadBalancerType === 'HTTP') {
17
- if (_.isString(lb.certificate)) {
18
- return 'HTTPS';
15
+ this.$onInit = () => {
16
+ this.type = (function (lb) {
17
+ if (lb.loadBalancerType === 'HTTP') {
18
+ if (_.isString(lb.certificate)) {
19
+ return 'HTTPS';
20
+ } else {
21
+ return 'HTTP';
22
+ }
19
23
  } else {
20
- return 'HTTP';
24
+ return lb.loadBalancerType;
21
25
  }
22
- } else {
23
- return lb.loadBalancerType;
24
- }
25
- })(this.loadBalancer);
26
+ })(this.loadBalancer);
27
+ };
26
28
  },
27
29
  });