-
Notifications
You must be signed in to change notification settings - Fork 242
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 NodeInfo crd #2113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably need to copy the embed
boilerplate from the nnc/css pkgs also since these are supposed to be installed by the controlplane
Are we going to need a client for this CRD? |
@aggarwal0009 please make sure you add label to PR that you open in github indicating which component it is |
Added |
I think we will. Added |
crd/nodeinfo/client.go
Outdated
} | ||
|
||
// SetOwnerRef sets the controller of the NodeInfo to the given object atomically, using HTTP Patch. | ||
// Deprecated: SetOwnerRef is deprecated, use the more correctly named SetControllerRef. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not add new funcs that are immediately deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
crd/nodeinfo/client.go
Outdated
} | ||
|
||
// PatchSpec performs a server-side patch of the passed NodeInfoSpec to the NodeInfo specified by the NamespacedName. | ||
func (c *Client) PatchSpec(ctx context.Context, key types.NamespacedName, spec *v1alpha1.NodeInfoSpec, fieldManager string) (*v1alpha1.NodeInfo, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary as we will not be patching the spec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
crd/nodeinfo/client.go
Outdated
|
||
// UpdateSpec does a fetch, deepcopy, and update of the NodeInfo with the passed spec. | ||
// Deprecated: UpdateSpec is deprecated and usage should migrate to PatchSpec. | ||
func (c *Client) UpdateSpec(ctx context.Context, key types.NamespacedName, spec *v1alpha1.NodeInfoSpec) (*v1alpha1.NodeInfo, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary as we will not be updating the spec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
crd/nodeinfo/client.go
Outdated
} | ||
|
||
// SetControllerRef sets the controller of the NodeInfo to the given object atomically, using HTTP Patch. | ||
func (c *Client) SetControllerRef(ctx context.Context, key types.NamespacedName, owner metav1.Object, fieldManager string) (*v1alpha1.NodeInfo, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not needed, client can just create the NodeInfo CRD with ownership at time of creation, don't need these funcs which mutate the ownership over time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
crd/nodeinfo/client.go
Outdated
return obj, nil | ||
} | ||
|
||
func genPatchSkel(key types.NamespacedName) *v1alpha1.NodeInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
// +kubebuilder:resource:scope=Namespaced | ||
// +kubebuilder:resource:shortName=ni | ||
// +kubebuilder:resource:path=nodeinfo | ||
// +kubebuilder:subresource:status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status subresource not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right. removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits except for the embed doc.go which is blocking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs CRD regen then lgtm
Co-authored-by: Evan Baker <[email protected]>
Co-authored-by: Evan Baker <[email protected]>
Co-authored-by: Evan Baker <[email protected]>
163c254
to
228cc09
Compare
65464a1
Signed-off-by: aggarwal0009 <[email protected]>
Fixed |
Reason for Change:
This CRD is added to enable VNET multitenancy – which will be watched and managed by the control plane.
NodeInfo objects are created by CNS as part of the node registration flow, and is used to pass any metadata from the VM needed by control plane.
Issue Fixed:
Requirements:
Notes: