Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Multitenancy]: Add PodNetwork CRD #2133

Merged
merged 18 commits into from
Aug 15, 2023
Merged

Conversation

aggarwal0009
Copy link
Contributor

Reason for Change:

This CRD is added to enable VNET multitenancy – which will be watched and managed by the control plane.
These represent a Cx subnet already delegated by the customer to the Orchestrator RP

Issue Fixed:

Requirements:

Notes:

@aggarwal0009 aggarwal0009 requested a review from a team as a code owner August 10, 2023 16:28
@aggarwal0009 aggarwal0009 self-assigned this Aug 10, 2023
// customer vnet guid
Network string `json:"network,omitempty"`
// customer subnet name
Subnet string `json:"subnet,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I would call the whole Subnet ResourceId here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So should I rename it SubnetID? SubnetResourceID?

Copy link
Contributor

Choose a reason for hiding this comment

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

@neaggarwMS would subnet resource id have vnet guid? If so, maybe we can drop vnetGUID and just have subnet resource id

Copy link
Contributor

Choose a reason for hiding this comment

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

nevermind, it would not have vnet guid, confirmed it with vipin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to SubnetResourceID

type PodNetworkSpec struct {
// +kubebuilder:validation:Optional
// customer vnet guid
Network string `json:"network,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

For Azure Naming, lets call it VnetGuid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@aggarwal0009 aggarwal0009 requested a review from a team as a code owner August 10, 2023 16:40
neaggarwMS
neaggarwMS previously approved these changes Aug 10, 2023
miguelgoms
miguelgoms previously approved these changes Aug 10, 2023
@aggarwal0009 aggarwal0009 force-pushed the ankaggar/ankaggar/PN-CRD branch from 2eeb0a7 to aa0761d Compare August 10, 2023 23:29
@aggarwal0009 aggarwal0009 requested a review from rbtr August 10, 2023 23:31
@aggarwal0009 aggarwal0009 dismissed stale reviews from neaggarwMS and miguelgoms via 7d37430 August 11, 2023 00:12
neaggarwMS
neaggarwMS previously approved these changes Aug 11, 2023
type Status string

const (
Nil Status = "Nil"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a Nil status? Conceptually, what is the difference between "Nil" and ""?

Copy link
Contributor

Choose a reason for hiding this comment

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

no, we don't need nil as an enum value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

type PodNetworkStatus struct {
// +kubebuilder:validation:Optional
Status Status `json:"status,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we were going to use events on the object to convey error messages instead of putting it into the object. It's kind of an anti-pattern to have a field for error message in a resource (can't think of any other k8s resource that has a field like this)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we agreed to use enum values on status for known error categories => actionable repair item. (e.g.: subnet is not delegated to this service => revalidate and create the SAL)

For error debug details we discussed having the error message, but agreed that can just go into events if the status enum is informative enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed errorMessage field in favor or events.

@aggarwal0009 aggarwal0009 requested a review from a team as a code owner August 14, 2023 16:07
@aggarwal0009 aggarwal0009 force-pushed the ankaggar/ankaggar/PN-CRD branch from a16fd3c to 1d78feb Compare August 14, 2023 16:14
thatmattlong
thatmattlong previously approved these changes Aug 14, 2023
Copy link
Contributor

@rbtr rbtr left a comment

Choose a reason for hiding this comment

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

couple nits, otherwise lgtm

@aggarwal0009 aggarwal0009 requested a review from rbtr August 14, 2023 19:00
@aggarwal0009 aggarwal0009 merged commit 3b7c365 into master Aug 15, 2023
@aggarwal0009 aggarwal0009 deleted the ankaggar/ankaggar/PN-CRD branch August 15, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants