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

Add next possible schedules and upgrade window metrics #104

Merged
merged 5 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions api/v1beta1/upgradeconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ type UpgradeConfigStatus struct {
// Also is increased when a job would have been created, but was not created due to the config being suspended.
// +optional
LastScheduledUpgrade *metav1.Time `json:"lastScheduledUpgrade,omitempty"`

// NextPossibleSchedules is a list of the next possible schedules for an upgrade.
NextPossibleSchedules []NextPossibleSchedule `json:"nextPossibleSchedules"`
}

// NextPossibleSchedule defines the next possible schedule for an upgrade
type NextPossibleSchedule struct {
// Time is the time of the next possible schedule
Time metav1.Time `json:"time"`
}

//+kubebuilder:object:root=true
Expand Down
8 changes: 8 additions & 0 deletions api/v1beta1/upgradesuspensionwindow_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ type UpgradeSuspensionWindowSpec struct {

// UpgradeSuspensionWindowStatus defines the observed state of UpgradeSuspensionWindow
type UpgradeSuspensionWindowStatus struct {
// MatchingConfigs are the UpgradeConfigs that are matched by the ConfigSelector.
MatchingConfigs []UpgradeSuspensionWindowStatusMatchingObject `json:"matchingConfigs,omitempty"`
// MatchingJobs are the UpgradeJobs that are matched by the JobSelector.
MatchingJobs []UpgradeSuspensionWindowStatusMatchingObject `json:"matchingJobs,omitempty"`
}

type UpgradeSuspensionWindowStatusMatchingObject struct {
Name string `json:"name"`
}

//+kubebuilder:object:root=true
Expand Down
50 changes: 49 additions & 1 deletion api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions config/crd/bases/managedupgrade.appuio.io_upgradeconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,23 @@ spec:
Also is increased when a job would have been created, but was not created due to the config being suspended.
format: date-time
type: string
nextPossibleSchedules:
description: NextPossibleSchedules is a list of the next possible
schedules for an upgrade.
items:
description: NextPossibleSchedule defines the next possible schedule
for an upgrade
properties:
time:
description: Time is the time of the next possible schedule
format: date-time
type: string
required:
- time
type: object
type: array
required:
- nextPossibleSchedules
type: object
required:
- spec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,29 @@ spec:
status:
description: UpgradeSuspensionWindowStatus defines the observed state
of UpgradeSuspensionWindow
properties:
matchingConfigs:
description: MatchingConfigs are the UpgradeConfigs that are matched
by the ConfigSelector.
items:
properties:
name:
type: string
required:
- name
type: object
type: array
matchingJobs:
description: MatchingJobs are the UpgradeJobs that are matched by
the JobSelector.
items:
properties:
name:
type: string
required:
- name
type: object
type: array
type: object
type: object
served: true
Expand Down
2 changes: 2 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,5 @@ rules:
- upgradesuspensionwindows/status
verbs:
- get
- patch
- update
Loading