Skip to content

Conversation

@liwenwu-amazon
Copy link
Contributor

@liwenwu-amazon liwenwu-amazon commented Mar 2, 2023

Issue #73 , if available:

Description of changes:

Here the description on this enhancement

Here are all the updated unit tests and manual end-to-end test(s) we have done

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@liwenwu-amazon liwenwu-amazon changed the title Allow to create multiple service networks (work-in-progress) Allow to create multiple service networks Mar 2, 2023
glog.V(6).Infof("updateGatewayStatus: updating last transition time \n")
gw.Status.Conditions[0].LastTransitionTime = metav1.NewTime(time.Now())
if gw.Status.Conditions[0].LastTransitionTime == eventhandlers.ZeroTransitionTime {
gw.Status.Conditions[0].LastTransitionTime = metav1.NewTime(time.Now())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic seems wrong. Don't you want to change this every time the condition transitions? Right now, it only checks when it goes from unset -> set. Is it ever possible for this condition to be false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we reset it whenever there is a change and need controller to reconcile it

@liwenwu-amazon liwenwu-amazon requested a review from ellistarn March 3, 2023 19:23
case vpclattice.ServiceNetworkVpcAssociationStatusDeleteInProgress:
return latticemodel.ServiceNetworkStatus{ServiceNetworkARN: "", ServiceNetworkID: ""}, errors.New(LATTICE_RETRY)
} else {
if isServiceNetworkAssociatedWithVPC == true {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the idea, that if service_network.Spec.AssociateToVPC=false, and ServiceNetwork is currently AssociatedWithVPC, we want to disassociate vpcAndServiceNetwork. I feel it is a bit wired that this is doing delete work while in create section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, the associationToVPC or disassociatefromVPC is kind of like an attribute of a service-network/gateway here. The K8S intend is to create gateway==servicenetwork, with attribute whether to associate/dis-associate to VPC

@liwenwu-amazon liwenwu-amazon merged commit 23b2371 into aws:main Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants