[node operator] ScalingGroup CRD definition

Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
Malte Poll 2022-06-27 11:22:57 +02:00 committed by Malte Poll
parent bfb9eaed3a
commit b36160e8a4
3 changed files with 109 additions and 13 deletions

View file

@ -5,22 +5,27 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
const (
// ConditionOutdated is used to signal outdated scaling groups.
ConditionOutdated = "Outdated"
)
// ScalingGroupSpec defines the desired state of ScalingGroup
type ScalingGroupSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
// Foo is an example field of ScalingGroup. Edit scalinggroup_types.go to remove/update
Foo string `json:"foo,omitempty"`
// NodeImage is the name of the NodeImage resource.
NodeImage string `json:"nodeImage,omitempty"`
// GroupID is the CSP specific, canonical identifier of a scaling group.
GroupID string `json:"groupId,omitempty"`
// Autoscaling specifies wether the scaling group should automatically scale using the cluster-autoscaler.
Autoscaling bool `json:"autoscaling,omitempty"`
}
// ScalingGroupStatus defines the observed state of ScalingGroup
type ScalingGroupStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
// ImageReference is the image currently used for newly created nodes in this scaling group.
ImageReference string `json:"imageReference,omitempty"`
// Conditions represent the latest available observations of an object's state.
Conditions []metav1.Condition `json:"conditions"`
}
//+kubebuilder:object:root=true

View file

@ -332,7 +332,7 @@ func (in *ScalingGroup) DeepCopyInto(out *ScalingGroup) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScalingGroup.
@ -403,6 +403,13 @@ func (in *ScalingGroupSpec) DeepCopy() *ScalingGroupSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ScalingGroupStatus) DeepCopyInto(out *ScalingGroupStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]metav1.Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScalingGroupStatus.