Skip to content

Commit

Permalink
Regenerate code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jont828 committed Nov 15, 2021
1 parent e8a206b commit 78d1c1d
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 33 deletions.
69 changes: 52 additions & 17 deletions azure/services/natgateways/mock_natgateways/client_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 77 additions & 2 deletions azure/services/natgateways/mock_natgateways/natgateways_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions azure/services/natgateways/natgateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,6 @@ func (s *Service) Reconcile(ctx context.Context) error {
}
subnetSpec.NatGateway = *natGatewayInfraV1Spec
s.Scope.SetSubnet(subnetSpec)

// natGateway := infrav1.NatGateway{
// ID: azure.NatGatewayID(s.Scope.SubscriptionID(), s.Scope.ResourceGroup(), natGatewaySpec.Name),
// Name: natGatewaySpec.ResourceName(),
// NatGatewayIP: infrav1.PublicIPSpec{
// Name: natGatewaySpec.NatGatewayIP.Name,
// },
// }
// natGatewaySpec.Subnet.NatGateway = natGateway
// s.Scope.SetSubnet(natGatewaySpec.Subnet)
}
}

Expand Down
6 changes: 2 additions & 4 deletions azure/services/natgateways/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (s *NatGatewaySpec) ResourceGroupName() string {
return s.ResourceGroup
}

// OwnerResourceName is a no-op for Nat Gateways.
// OwnerResourceName returns the name of the associated subnet.
func (s *NatGatewaySpec) OwnerResourceName() string {
return s.Subnet.Name
}
Expand All @@ -66,12 +66,10 @@ func (s *NatGatewaySpec) Parameters(existing interface{}) (interface{}, error) {
s.Subnet.NatGateway.ID = existingNatGateway.ID
if existingNatGateway.NatGatewayIP.Name == s.NatGatewayIP.Name {
// Skip update for Nat Gateway as it exists with expected values
// TODO: consider refactoring this assignment since it's not apparent that this function should mutate the spec
s.Subnet.NatGateway = *existingNatGateway
// s.Scope.SetSubnet(s.Subnet)
return nil, nil
}
// s.Scope.V(2).Info("updating NAT gateway IP name to match the spec", "old name", existingNatGateway.NatGatewayIP.Name, "desired name", s.NatGatewayIP.Name)

}

natGatewayToCreate := network.NatGateway{
Expand Down

0 comments on commit 78d1c1d

Please sign in to comment.