Skip to content

Commit

Permalink
bugfix(nil): crossplane-contrib#1367 check for nil
Browse files Browse the repository at this point in the history
Signed-off-by: haarchri <chhaar30@googlemail.com>
  • Loading branch information
haarchri committed Jun 29, 2022
1 parent 2db1de6 commit 8cc8995
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/controller/ec2/vpcendpointserviceconfiguration/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ func DifferenceARN(local []*string, remote []*string) ([]*string, []*string) {
return createKey, removeKey
}

// GenerateObservation is used to produce v1beta1.ClusterObservation from
// ekstypes.Cluster.
// GenerateObservation is used to produce v1alpha1.vpcendpointserviceconfigurationObservation
func GenerateObservation(obj *svcsdk.ServiceConfiguration) *svcapitypes.ServiceConfiguration { // nolint:gocyclo
if obj == nil {
return &svcapitypes.ServiceConfiguration{}
Expand All @@ -283,15 +282,18 @@ func GenerateObservation(obj *svcsdk.ServiceConfiguration) *svcapitypes.ServiceC
BaseEndpointDNSNames: obj.BaseEndpointDnsNames,
ManagesVPCEndpoints: obj.ManagesVpcEndpoints,
PrivateDNSName: obj.PrivateDnsName,
PrivateDNSNameConfiguration: &svcapitypes.PrivateDNSNameConfiguration{
ServiceID: obj.ServiceId,
ServiceName: obj.ServiceName,
ServiceState: obj.ServiceState,
}

if obj.PrivateDnsNameConfiguration != nil {
o.PrivateDNSNameConfiguration = &svcapitypes.PrivateDNSNameConfiguration{
Name: obj.PrivateDnsNameConfiguration.Name,
State: obj.PrivateDnsNameConfiguration.State,
Value: obj.PrivateDnsNameConfiguration.Value,
Type: obj.PrivateDnsNameConfiguration.Type,
},
ServiceID: obj.ServiceId,
ServiceName: obj.ServiceName,
ServiceState: obj.ServiceState,
}
}

o.NetworkLoadBalancerARNs = append(o.NetworkLoadBalancerARNs, obj.NetworkLoadBalancerArns...)
Expand Down

0 comments on commit 8cc8995

Please sign in to comment.