k8supdates: label nodes with k8s component hash

This commit is contained in:
Leonard Cohnen 2022-12-06 18:48:01 +01:00 committed by 3u13r
parent 1466c12972
commit a1161ae05d
30 changed files with 869 additions and 18 deletions

View file

@ -0,0 +1,48 @@
/*
Copyright (c) Edgeless Systems GmbH
SPDX-License-Identifier: AGPL-3.0-only
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// JoiningNodeSpec defines the components hash which the node should be annotated with.
type JoiningNodeSpec struct {
// Name of the node expected to join.
Name string `json:"name,omitempty"`
// ComponentsHash is the hash of the components that were sent to the node by the join service.
ComponentsHash string `json:"componentshash,omitempty"`
}
// JoiningNodeStatus defines the observed state of JoiningNode.
type JoiningNodeStatus struct{}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster
// JoiningNode is the Schema for the joiningnodes API.
type JoiningNode struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec JoiningNodeSpec `json:"spec,omitempty"`
Status JoiningNodeStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// JoiningNodeList contains a list of JoiningNodes.
type JoiningNodeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []JoiningNode `json:"items"`
}
func init() {
SchemeBuilder.Register(&JoiningNode{}, &JoiningNodeList{})
}

View file

@ -107,6 +107,95 @@ func (in *AutoscalingStrategyStatus) DeepCopy() *AutoscalingStrategyStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JoiningNode) DeepCopyInto(out *JoiningNode) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoiningNode.
func (in *JoiningNode) DeepCopy() *JoiningNode {
if in == nil {
return nil
}
out := new(JoiningNode)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *JoiningNode) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JoiningNodeList) DeepCopyInto(out *JoiningNodeList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]JoiningNode, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoiningNodeList.
func (in *JoiningNodeList) DeepCopy() *JoiningNodeList {
if in == nil {
return nil
}
out := new(JoiningNodeList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *JoiningNodeList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JoiningNodeSpec) DeepCopyInto(out *JoiningNodeSpec) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoiningNodeSpec.
func (in *JoiningNodeSpec) DeepCopy() *JoiningNodeSpec {
if in == nil {
return nil
}
out := new(JoiningNodeSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JoiningNodeStatus) DeepCopyInto(out *JoiningNodeStatus) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoiningNodeStatus.
func (in *JoiningNodeStatus) DeepCopy() *JoiningNodeStatus {
if in == nil {
return nil
}
out := new(JoiningNodeStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeImage) DeepCopyInto(out *NodeImage) {
*out = *in