Skip to content

Conversation

@randytqwjp
Copy link
Collaborator

What this PR does / why we need it:

Create CRD for scheduledscaling

Which issue(s) this PR fixes:

#34

Fixes #

Special notes for your reviewer:

@sanposhiho
Copy link
Collaborator

@randytqwjp You have to run make manifests to solve the first CI's failure

Comment on lines +99 to +113
type ScheduledScaling struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ScheduledScalingSpec `json:"spec,omitempty"`
Status ScheduledScalingStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// ScheduledScalingList contains a list of ScheduledScaling
type ScheduledScalingList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ScheduledScaling `json:"items"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing protobuf

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

protobuf is missing in tortoise_types.go as well

Copy link
Collaborator

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

Sorry, I missed one point last time, other points LGTM

// start of schedule
StartAt *string `json:"startAt,omitempty" protobuf:"bytes,1,opt,name=startAt"`
// end of schedule
FinishAt *string `json:"finishAt,omitempty" protobuf:"bytes,2,name=finishAt"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

As proposal describes, it should be a required value. We don't want to allow users to keep increasing the resources.

# Must not empty. If empty, the validation webhook rejects the creation.

https://github.com/mercari/tortoise/blob/main/proposals/scheduled-scaling/README.md

// start of schedule
StartAt *string `json:"startAt,omitempty" protobuf:"bytes,1,name=startAt"`
// end of schedule
FinishAt *string `json:"finishAt,omitempty" protobuf:"bytes,2,name=finishAt"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
FinishAt *string `json:"finishAt,omitempty" protobuf:"bytes,2,name=finishAt"`
FinishAt *string `json:"finishAt" protobuf:"bytes,2,name=finishAt"`

Copy link
Collaborator

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

Also, you have to make manifests after updating api/v1alpha1/scheduledscaling_types.go so that all CRD spec is updated accordingly

type Schedule struct {
/// RFC3339 format e.g., "2006-01-02T15:04:05Z09:00"
// start of schedule
StartAt *string `json:"startAt" protobuf:"bytes,1,name=startAt"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

StartAt is required.

Suggested change
StartAt *string `json:"startAt" protobuf:"bytes,1,name=startAt"`
StartAt *string `json:"startAt,omitempty" protobuf:"bytes,1,opt,name=startAt"`

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.

2 participants