From d0a01cdfd900c4a4bb93e3d560813866875912b4 Mon Sep 17 00:00:00 2001 From: Sandesh <30489233+j-sandy@users.noreply.github.com> Date: Wed, 10 Apr 2024 21:39:12 +0530 Subject: [PATCH] fix(google): introduce explicit constructor and initialization of inner class members (#6184) This change is to fix the issue https://github.com/spinnaker/spinnaker/issues/6939. --- .../google/model/GoogleApplication.groovy | 15 ++- .../google/model/GoogleCluster.groovy | 18 ++-- .../google/model/GoogleHealthCheck.groovy | 42 ++++++--- .../google/model/GoogleInstance.groovy | 63 +++++++++---- .../google/model/GoogleServerGroup.groovy | 92 +++++++++++++------ .../health/GoogleLoadBalancerHealth.groovy | 8 +- .../GoogleHttpLoadBalancer.groovy | 48 +++++++--- .../GoogleInternalLoadBalancer.groovy | 54 +++++++---- .../GoogleNetworkLoadBalancer.groovy | 45 ++++++--- .../GoogleSslLoadBalancer.groovy | 42 ++++++--- .../GoogleTcpLoadBalancer.groovy | 39 +++++--- 11 files changed, 319 insertions(+), 147 deletions(-) diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleApplication.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleApplication.groovy index 56d6e69dc50..34f4ef97c43 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleApplication.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleApplication.groovy @@ -27,19 +27,26 @@ class GoogleApplication { String name View getView() { - new View() + new View(this) } @Canonical class View implements Application { - String name = GoogleApplication.this.name - Map attributes = [:] + String name + Map attributes /** * Account name -> cluster names */ - Map> clusterNames = [:].withDefault {[] as Set} + Map> clusterNames List> instances + + View(GoogleApplication googleApplication){ + name = googleApplication.name + attributes = [:] + clusterNames = [:].withDefault {[] as Set} + instances = [[:] as Map] + } } } diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleCluster.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleCluster.groovy index 7b0d2d1581b..cb7ce567ddc 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleCluster.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleCluster.groovy @@ -33,20 +33,26 @@ class GoogleCluster { @JsonIgnore View getView() { - new View() + new View(this) } @Canonical class View implements Cluster { - View() {} + View(GoogleCluster googleCluster) { + name = googleCluster.name + accountName = googleCluster.accountName + + serverGroups = [] as Set + loadBalancers = [] as Set + } final String type = GoogleCloudProvider.ID - String name = GoogleCluster.this.name - String accountName = GoogleCluster.this.accountName + String name + String accountName - Set serverGroups = [] as Set - Set loadBalancers = [] as Set + Set serverGroups + Set loadBalancers } } diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleHealthCheck.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleHealthCheck.groovy index f0538d1f244..a34e15dbcb7 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleHealthCheck.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleHealthCheck.groovy @@ -57,7 +57,7 @@ class GoogleHealthCheck { @JsonIgnore View getView() { - new View() + new View(this) } /** @@ -98,18 +98,34 @@ class GoogleHealthCheck { @Canonical class View implements Serializable { - String name = GoogleHealthCheck.this.name - HealthCheckType healthCheckType = GoogleHealthCheck.this.healthCheckType - int interval = GoogleHealthCheck.this.checkIntervalSec - int timeout = GoogleHealthCheck.this.timeoutSec - int unhealthyThreshold = GoogleHealthCheck.this.unhealthyThreshold - int healthyThreshold = GoogleHealthCheck.this.healthyThreshold - int port = GoogleHealthCheck.this.port - String requestPath = GoogleHealthCheck.this.requestPath - String selfLink = GoogleHealthCheck.this.selfLink - String kind = GoogleHealthCheck.this.kind - String target = GoogleHealthCheck.this.target - String region = GoogleHealthCheck.this.region + String name + HealthCheckType healthCheckType + int interval + int timeout + int unhealthyThreshold + int healthyThreshold + int port + String requestPath + String selfLink + String kind + String target + String region + + View(GoogleHealthCheck googleHealthCheck){ + name = googleHealthCheck.name + healthCheckType = googleHealthCheck.healthCheckType + interval = googleHealthCheck.checkIntervalSec + timeout = googleHealthCheck.timeoutSec + unhealthyThreshold = googleHealthCheck.unhealthyThreshold + healthyThreshold = googleHealthCheck.healthyThreshold + port = googleHealthCheck.port + requestPath = googleHealthCheck.requestPath + selfLink = googleHealthCheck.selfLink + kind = googleHealthCheck.kind + target = googleHealthCheck.target + region = googleHealthCheck.region + } + } static enum HealthCheckType { diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleInstance.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleInstance.groovy index ea253173b89..76eaaf670c6 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleInstance.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleInstance.groovy @@ -71,7 +71,7 @@ class GoogleInstance implements GoogleLabeledResource { @JsonIgnore View getView() { - new View() + new View(this) } @Canonical @@ -80,27 +80,50 @@ class GoogleInstance implements GoogleLabeledResource { final String providerType = GoogleCloudProvider.ID final String cloudProvider = GoogleCloudProvider.ID - String name = GoogleInstance.this.name - String gceId = GoogleInstance.this.gceId - String instanceId = GoogleInstance.this.name - String instanceType = GoogleInstance.this.instanceType - String cpuPlatform = GoogleInstance.this.cpuPlatform - Long launchTime = GoogleInstance.this.launchTime - String zone = GoogleInstance.this.zone - String region = GoogleInstance.this.region - Map placement = ["availabilityZone": GoogleInstance.this.zone] - List networkInterfaces = GoogleInstance.this.networkInterfaces - Metadata metadata = GoogleInstance.this.metadata - List disks = GoogleInstance.this.disks - List serviceAccounts = GoogleInstance.this.serviceAccounts - String selfLink = GoogleInstance.this.selfLink - String serverGroup = GoogleInstance.this.serverGroup - Tags tags = GoogleInstance.this.tags - Map labels = GoogleInstance.this.labels - ConsulNode consulNode = GoogleInstance.this.consulNode + String name + String gceId + String instanceId + String instanceType + String cpuPlatform + Long launchTime + String zone + String region + Map placement + List networkInterfaces + Metadata metadata + List disks + List serviceAccounts + String selfLink + String serverGroup + Tags tags + Map labels + ConsulNode consulNode + List securityGroups + + View(GoogleInstance googleInstance){ + name = googleInstance.name + gceId = googleInstance.gceId + instanceId = googleInstance.name + instanceType = googleInstance.instanceType + cpuPlatform = googleInstance.cpuPlatform + launchTime = googleInstance.launchTime + zone = googleInstance.zone + region = googleInstance.region + placement = ["availabilityZone": googleInstance.zone] + networkInterfaces = googleInstance.networkInterfaces + metadata = googleInstance.metadata + disks = googleInstance.disks + serviceAccounts = googleInstance.serviceAccounts + selfLink = googleInstance.selfLink + serverGroup = googleInstance.serverGroup + tags = googleInstance.tags + labels = googleInstance.labels + consulNode = googleInstance.consulNode + securityGroups = googleInstance.securityGroups + } List> getSecurityGroups() { - GoogleInstance.this.securityGroups.collect { + securityGroups.collect { ["groupName": it, "groupId": it] } } diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleServerGroup.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleServerGroup.groovy index 020ff26ca49..a9cbd234248 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleServerGroup.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/GoogleServerGroup.groovy @@ -88,7 +88,7 @@ class GoogleServerGroup implements GoogleLabeledResource { @JsonIgnore View getView() { - new View() + new View(this) } @Override @@ -103,35 +103,67 @@ class GoogleServerGroup implements GoogleLabeledResource { final String type = GoogleCloudProvider.ID final String cloudProvider = GoogleCloudProvider.ID - String name = GoogleServerGroup.this.name - String region = GoogleServerGroup.this.region - Boolean regional = GoogleServerGroup.this.regional - String zone = GoogleServerGroup.this.zone - Set zones = GoogleServerGroup.this.zones - Set instances = GoogleServerGroup.this.instances.collect { it?.view } - Map asg = GoogleServerGroup.this.asg - Map launchConfig = GoogleServerGroup.this.launchConfig - Map namedPorts = GoogleServerGroup.this.namedPorts - Set securityGroups = GoogleServerGroup.this.securityGroups - Map buildInfo = GoogleServerGroup.this.buildInfo - Boolean disabled = GoogleServerGroup.this.disabled - String networkName = GoogleServerGroup.this.networkName - Boolean canIpForward = GoogleServerGroup.this.canIpForward - Boolean enableSecureBoot = GoogleServerGroup.this.enableSecureBoot - Boolean enableVtpm = GoogleServerGroup.this.enableVtpm - Boolean enableIntegrityMonitoring = GoogleServerGroup.this.enableIntegrityMonitoring - Set instanceTemplateTags = GoogleServerGroup.this.instanceTemplateTags - Set instanceTemplateServiceAccounts = GoogleServerGroup.this.instanceTemplateServiceAccounts - Map instanceTemplateLabels = GoogleServerGroup.this.instanceTemplateLabels - String selfLink = GoogleServerGroup.this.selfLink - Boolean discovery = GoogleServerGroup.this.discovery - InstanceGroupManagerActionsSummary currentActions = GoogleServerGroup.this.currentActions - GoogleAutoscalingPolicy autoscalingPolicy = GoogleServerGroup.this.autoscalingPolicy - StatefulPolicy statefulPolicy = GoogleServerGroup.this.statefulPolicy - List autoscalingMessages = GoogleServerGroup.this.autoscalingMessages - InstanceGroupManagerAutoHealingPolicy autoHealingPolicy = GoogleServerGroup.this.autoHealingPolicy - GoogleDistributionPolicy distributionPolicy = GoogleServerGroup.this.distributionPolicy - Boolean selectZones = GoogleServerGroup.this.selectZones + String name + String region + Boolean regional + String zone + Set zones + Set instances + Map asg + Map launchConfig + Map namedPorts + Set securityGroups + Map buildInfo + Boolean disabled + String networkName + Boolean canIpForward + Boolean enableSecureBoot + Boolean enableVtpm + Boolean enableIntegrityMonitoring + Set instanceTemplateTags + Set instanceTemplateServiceAccounts + Map instanceTemplateLabels + String selfLink + Boolean discovery + InstanceGroupManagerActionsSummary currentActions + GoogleAutoscalingPolicy autoscalingPolicy + StatefulPolicy statefulPolicy + List autoscalingMessages + InstanceGroupManagerAutoHealingPolicy autoHealingPolicy + GoogleDistributionPolicy distributionPolicy + Boolean selectZones + + View(GoogleServerGroup googleServerGroup){ + name = googleServerGroup.name + region = googleServerGroup.region + regional = googleServerGroup.regional + zone = googleServerGroup.zone + zones = googleServerGroup.zones + instances = googleServerGroup.instances.collect { it?.view } + asg = googleServerGroup.asg + launchConfig = googleServerGroup.launchConfig + namedPorts = googleServerGroup.namedPorts + securityGroups = googleServerGroup.securityGroups + buildInfo = googleServerGroup.buildInfo + disabled = googleServerGroup.disabled + networkName = googleServerGroup.networkName + canIpForward = googleServerGroup.canIpForward + enableSecureBoot = googleServerGroup.enableSecureBoot + enableVtpm = googleServerGroup.enableVtpm + enableIntegrityMonitoring = googleServerGroup.enableIntegrityMonitoring + instanceTemplateTags = googleServerGroup.instanceTemplateTags + instanceTemplateServiceAccounts = googleServerGroup.instanceTemplateServiceAccounts + instanceTemplateLabels = googleServerGroup.instanceTemplateLabels + selfLink = googleServerGroup.selfLink + discovery = googleServerGroup.discovery + currentActions = googleServerGroup.currentActions + autoscalingPolicy = googleServerGroup.autoscalingPolicy + statefulPolicy = googleServerGroup.statefulPolicy + autoscalingMessages = googleServerGroup.autoscalingMessages + autoHealingPolicy = googleServerGroup.autoHealingPolicy + distributionPolicy = googleServerGroup.distributionPolicy + selectZones = googleServerGroup.selectZones + } @Override Moniker getMoniker() { diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/health/GoogleLoadBalancerHealth.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/health/GoogleLoadBalancerHealth.groovy index 3b14c4f460e..26aa06d7510 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/health/GoogleLoadBalancerHealth.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/health/GoogleLoadBalancerHealth.groovy @@ -74,14 +74,18 @@ class GoogleLoadBalancerHealth { @JsonIgnore View getView() { - new View() + new View(this) } class View extends GoogleHealth implements Health { final Type type = Type.LoadBalancer final HealthClass healthClass = null - List loadBalancers = GoogleLoadBalancerHealth.this.lbHealthSummaries + List loadBalancers + + View(GoogleLoadBalancerHealth googleLoadBalancerHealth){ + loadBalancers = googleLoadBalancerHealth.lbHealthSummaries + } HealthState getState() { GoogleLoadBalancerHealth.this.status?.toHeathState() diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleHttpLoadBalancer.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleHttpLoadBalancer.groovy index ae6b4989f91..3afa9f6cfd7 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleHttpLoadBalancer.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleHttpLoadBalancer.groovy @@ -58,27 +58,45 @@ class GoogleHttpLoadBalancer extends GoogleLoadBalancer { @JsonIgnore GoogleLoadBalancerView getView() { - new View() + new View(this) } @Canonical class View extends GoogleLoadBalancerView { - GoogleLoadBalancerType loadBalancerType = GoogleHttpLoadBalancer.this.type - GoogleLoadBalancingScheme loadBalancingScheme = GoogleHttpLoadBalancer.this.loadBalancingScheme + GoogleLoadBalancerType loadBalancerType + GoogleLoadBalancingScheme loadBalancingScheme - String name = GoogleHttpLoadBalancer.this.name - String account = GoogleHttpLoadBalancer.this.account - String region = GoogleHttpLoadBalancer.this.region - Long createdTime = GoogleHttpLoadBalancer.this.createdTime - String ipAddress = GoogleHttpLoadBalancer.this.ipAddress - String ipProtocol = GoogleHttpLoadBalancer.this.ipProtocol - String portRange = GoogleHttpLoadBalancer.this.portRange + String name + String account + String region + Long createdTime + String ipAddress + String ipProtocol + String portRange - GoogleBackendService defaultService = GoogleHttpLoadBalancer.this.defaultService - List hostRules = GoogleHttpLoadBalancer.this.hostRules - String certificate = GoogleHttpLoadBalancer.this.certificate - String urlMapName = GoogleHttpLoadBalancer.this.urlMapName + GoogleBackendService defaultService + List hostRules + String certificate + String urlMapName + + Set serverGroups + + View(GoogleHttpLoadBalancer googleHttpLoadBalancer){ + loadBalancerType = googleHttpLoadBalancer.type + loadBalancingScheme = googleHttpLoadBalancer.loadBalancingScheme + name = googleHttpLoadBalancer.name + account = googleHttpLoadBalancer.account + region = googleHttpLoadBalancer.region + createdTime = googleHttpLoadBalancer.createdTime + ipAddress = googleHttpLoadBalancer.ipAddress + ipProtocol = googleHttpLoadBalancer.ipProtocol + portRange = googleHttpLoadBalancer.portRange + defaultService = googleHttpLoadBalancer.defaultService + hostRules = googleHttpLoadBalancer.hostRules + certificate = googleHttpLoadBalancer.certificate + urlMapName = googleHttpLoadBalancer.urlMapName + serverGroups = new HashSet<>() + } - Set serverGroups = new HashSet<>() } } diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleInternalLoadBalancer.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleInternalLoadBalancer.groovy index cfe214c8ef1..8479d505721 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleInternalLoadBalancer.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleInternalLoadBalancer.groovy @@ -34,26 +34,44 @@ class GoogleInternalLoadBalancer extends GoogleLoadBalancer { @JsonIgnore GoogleLoadBalancerView getView() { - new View() + new View(this) } class View extends GoogleLoadBalancerView { - GoogleLoadBalancerType loadBalancerType = GoogleInternalLoadBalancer.this.type - GoogleLoadBalancingScheme loadBalancingScheme = GoogleInternalLoadBalancer.this.loadBalancingScheme - - String name = GoogleInternalLoadBalancer.this.name - String account = GoogleInternalLoadBalancer.this.account - String region = GoogleInternalLoadBalancer.this.region - Long createdTime = GoogleInternalLoadBalancer.this.createdTime - String ipAddress = GoogleInternalLoadBalancer.this.ipAddress - String ipProtocol = GoogleInternalLoadBalancer.this.ipProtocol - String portRange = GoogleInternalLoadBalancer.this.portRange - - List ports = GoogleInternalLoadBalancer.this.ports - String network = GoogleInternalLoadBalancer.this.network - String subnet = GoogleInternalLoadBalancer.this.subnet - GoogleBackendService backendService = GoogleInternalLoadBalancer.this.backendService - - Set serverGroups = new HashSet<>() + GoogleLoadBalancerType loadBalancerType + GoogleLoadBalancingScheme loadBalancingScheme + + String name + String account + String region + Long createdTime + String ipAddress + String ipProtocol + String portRange + + List ports + String network + String subnet + GoogleBackendService backendService + + Set serverGroups + + View(GoogleInternalLoadBalancer googleInternalLoadBalancer){ + loadBalancerType = googleInternalLoadBalancer.type + loadBalancingScheme = googleInternalLoadBalancer.loadBalancingScheme + name = googleInternalLoadBalancer.name + account = googleInternalLoadBalancer.account + region = googleInternalLoadBalancer.region + createdTime = googleInternalLoadBalancer.createdTime + ipAddress = googleInternalLoadBalancer.ipAddress + ipProtocol = googleInternalLoadBalancer.ipProtocol + portRange = googleInternalLoadBalancer.portRange + ports = googleInternalLoadBalancer.ports + network = googleInternalLoadBalancer.network + subnet = googleInternalLoadBalancer.subnet + backendService = googleInternalLoadBalancer.backendService + serverGroups = new HashSet<>() + } + } } diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleNetworkLoadBalancer.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleNetworkLoadBalancer.groovy index 32892291c29..ddf6706589a 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleNetworkLoadBalancer.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleNetworkLoadBalancer.groovy @@ -35,26 +35,43 @@ class GoogleNetworkLoadBalancer extends GoogleLoadBalancer { @JsonIgnore GoogleLoadBalancerView getView() { - new View() + new View(this) } class View extends GoogleLoadBalancerView { - GoogleLoadBalancerType loadBalancerType = GoogleNetworkLoadBalancer.this.type - GoogleLoadBalancingScheme loadBalancingScheme = GoogleNetworkLoadBalancer.this.loadBalancingScheme + GoogleLoadBalancerType loadBalancerType + GoogleLoadBalancingScheme loadBalancingScheme - String name = GoogleNetworkLoadBalancer.this.name - String account = GoogleNetworkLoadBalancer.this.account - String region = GoogleNetworkLoadBalancer.this.region - Long createdTime = GoogleNetworkLoadBalancer.this.createdTime - String ipAddress = GoogleNetworkLoadBalancer.this.ipAddress - String ipProtocol = GoogleNetworkLoadBalancer.this.ipProtocol - String portRange = GoogleNetworkLoadBalancer.this.portRange + String name + String account + String region + Long createdTime + String ipAddress + String ipProtocol + String portRange - String targetPool = GoogleNetworkLoadBalancer.this.targetPool - String sessionAffinity = GoogleNetworkLoadBalancer.this.sessionAffinity + String targetPool + String sessionAffinity - GoogleHealthCheck.View healthCheck = GoogleNetworkLoadBalancer.this.healthCheck?.view + GoogleHealthCheck.View healthCheck + + Set serverGroups + + View(GoogleNetworkLoadBalancer googleNetworkLoadBalancer){ + loadBalancerType = googleNetworkLoadBalancer.type + loadBalancingScheme = googleNetworkLoadBalancer.loadBalancingScheme + name = googleNetworkLoadBalancer.name + account = googleNetworkLoadBalancer.account + region = googleNetworkLoadBalancer.region + createdTime = googleNetworkLoadBalancer.createdTime + ipAddress = googleNetworkLoadBalancer.ipAddress + ipProtocol = googleNetworkLoadBalancer.ipProtocol + portRange = googleNetworkLoadBalancer.portRange + targetPool = googleNetworkLoadBalancer.targetPool + sessionAffinity = googleNetworkLoadBalancer.sessionAffinity + healthCheck = googleNetworkLoadBalancer.healthCheck?.view + serverGroups = new HashSet<>() + } - Set serverGroups = new HashSet<>() } } diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleSslLoadBalancer.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleSslLoadBalancer.groovy index ed4990bc8cc..90109e5d1b2 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleSslLoadBalancer.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleSslLoadBalancer.groovy @@ -32,24 +32,40 @@ class GoogleSslLoadBalancer extends GoogleLoadBalancer { @JsonIgnore GoogleLoadBalancerView getView() { - new View() + new View(this) } class View extends GoogleLoadBalancerView { - GoogleLoadBalancerType loadBalancerType = GoogleSslLoadBalancer.this.type - GoogleLoadBalancingScheme loadBalancingScheme = GoogleSslLoadBalancer.this.loadBalancingScheme + GoogleLoadBalancerType loadBalancerType + GoogleLoadBalancingScheme loadBalancingScheme - String name = GoogleSslLoadBalancer.this.name - String account = GoogleSslLoadBalancer.this.account - String region = GoogleSslLoadBalancer.this.region - Long createdTime = GoogleSslLoadBalancer.this.createdTime - String ipAddress = GoogleSslLoadBalancer.this.ipAddress - String ipProtocol = GoogleSslLoadBalancer.this.ipProtocol - String portRange = GoogleSslLoadBalancer.this.portRange + String name + String account + String region + Long createdTime + String ipAddress + String ipProtocol + String portRange - String certificate = GoogleSslLoadBalancer.this.certificate - GoogleBackendService backendService = GoogleSslLoadBalancer.this.backendService + String certificate + GoogleBackendService backendService + + Set serverGroups + + View(GoogleSslLoadBalancer googleSslLoadBalancer){ + loadBalancerType = googleSslLoadBalancer.type + loadBalancingScheme = googleSslLoadBalancer.loadBalancingScheme + name = googleSslLoadBalancer.name + account = googleSslLoadBalancer.account + region = googleSslLoadBalancer.region + createdTime = googleSslLoadBalancer.createdTime + ipAddress = googleSslLoadBalancer.ipAddress + ipProtocol = googleSslLoadBalancer.ipProtocol + portRange = googleSslLoadBalancer.portRange + certificate = googleSslLoadBalancer.certificate + backendService = googleSslLoadBalancer.backendService + serverGroups = new HashSet<>() + } - Set serverGroups = new HashSet<>() } } diff --git a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleTcpLoadBalancer.groovy b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleTcpLoadBalancer.groovy index a696b0da2e5..1e05db8b6cd 100644 --- a/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleTcpLoadBalancer.groovy +++ b/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/model/loadbalancing/GoogleTcpLoadBalancer.groovy @@ -31,23 +31,38 @@ class GoogleTcpLoadBalancer extends GoogleLoadBalancer { @JsonIgnore GoogleLoadBalancerView getView() { - new View() + new View(this) } class View extends GoogleLoadBalancerView { - GoogleLoadBalancerType loadBalancerType = GoogleTcpLoadBalancer.this.type - GoogleLoadBalancingScheme loadBalancingScheme = GoogleTcpLoadBalancer.this.loadBalancingScheme + GoogleLoadBalancerType loadBalancerType + GoogleLoadBalancingScheme loadBalancingScheme - String name = GoogleTcpLoadBalancer.this.name - String account = GoogleTcpLoadBalancer.this.account - String region = GoogleTcpLoadBalancer.this.region - Long createdTime = GoogleTcpLoadBalancer.this.createdTime - String ipAddress = GoogleTcpLoadBalancer.this.ipAddress - String ipProtocol = GoogleTcpLoadBalancer.this.ipProtocol - String portRange = GoogleTcpLoadBalancer.this.portRange + String name + String account + String region + Long createdTime + String ipAddress + String ipProtocol + String portRange - GoogleBackendService backendService = GoogleTcpLoadBalancer.this.backendService + GoogleBackendService backendService + + Set serverGroups + + View(GoogleTcpLoadBalancer googleTcpLoadBalancer){ + loadBalancerType = googleTcpLoadBalancer.type + loadBalancingScheme = googleTcpLoadBalancer.loadBalancingScheme + name = googleTcpLoadBalancer.name + account = googleTcpLoadBalancer.account + region = googleTcpLoadBalancer.region + createdTime = googleTcpLoadBalancer.createdTime + ipAddress = googleTcpLoadBalancer.ipAddress + ipProtocol = googleTcpLoadBalancer.ipProtocol + portRange = googleTcpLoadBalancer.portRange + backendService = googleTcpLoadBalancer.backendService + serverGroups = new HashSet<>() + } - Set serverGroups = new HashSet<>() } }