Skip to content

OTA-1339: UpdateStatus: API to expose information about update progress & health #2233

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fa96c46
`update`: Extract `ClusterVersionProgressInsight` into top-level CRD
petr-muller Mar 4, 2025
36bcd79
`update`: Extract `ClusterOperatorProgressInsight` to top-level CRD
petr-muller Mar 12, 2025
4c9fc23
`status`: Extract `MachineConfigPoolProgressInsight` to a top-level CRD
petr-muller Mar 13, 2025
ed7df2a
`status`: Extract `NodeProgressInsight` to a top-level CRD
petr-muller Mar 13, 2025
9e49a50
`status`: Extract `HealthInsight` to a top-level CRD
petr-muller Mar 13, 2025
349c93c
`update`: enforce comment policy
petr-muller Mar 5, 2025
2007f0b
`make update`
petr-muller Mar 4, 2025
d21f519
update: enforce known reasons on COs
petr-muller Mar 18, 2025
a0dda9f
update: remove .resource on CO
petr-muller Mar 18, 2025
c8b2161
update: remove .resource on CV
petr-muller Mar 18, 2025
d2fe18b
update: "status insights" -> "progress insights" on CV
petr-muller Mar 18, 2025
cf96c72
update: known condition validation on CV
petr-muller Mar 18, 2025
e5fa6b6
update: better godoc for CV.versions.previous
petr-muller Mar 18, 2025
e211267
update: move ScopeType to a common file
petr-muller Mar 18, 2025
00bf4e2
update: improve godocs on CV insight
petr-muller Mar 18, 2025
9f8c9b2
update: validate .metadata.name == .status.name
petr-muller Mar 19, 2025
4c4861c
update: add TODOs for tightening conditions
petr-muller Mar 19, 2025
ed52c95
update: describe assessment fields as human-oriented summaries of con…
petr-muller Mar 19, 2025
fbc85b9
update: clean up conditions on CV and MCP
petr-muller Mar 19, 2025
ce0219e
update: remove .resource on MCP progress insight
petr-muller Mar 19, 2025
e1bfa53
update: move `ResourceRef to types_common.go
petr-muller Mar 19, 2025
12cf2c0
update: improve .version godoc on Node insight
petr-muller Mar 19, 2025
6914025
update: completion->completionPercentage
petr-muller Mar 19, 2025
d6145a3
update: tweak versions to allow empty previous if cluster was never u…
petr-muller Mar 19, 2025
c136b72
update: validation tweaks
petr-muller Mar 19, 2025
42bbcc8
update: describe node -> OCP version bettero
petr-muller Mar 19, 2025
482e89c
update: validation tweaks
petr-muller Mar 19, 2025
a3e03b4
update: test adjustments to changes
petr-muller Mar 20, 2025
cbaced5
update: enforce .metadata.name == .status.name
petr-muller Mar 20, 2025
f79d421
`make update`
petr-muller Mar 19, 2025
e16ca33
update: remove `patchMerge*` markers
petr-muller Mar 27, 2025
3720f05
make update
petr-muller Mar 27, 2025
bb998d9
make update
petr-muller Mar 27, 2025
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
1,231 changes: 1,231 additions & 0 deletions openapi/generated_openapi/zz_generated.openapi.go

Large diffs are not rendered by default.

715 changes: 715 additions & 0 deletions openapi/openapi.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions update/.codegen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
swaggerdocs:
commentPolicy: Enforce
26 changes: 26 additions & 0 deletions update/install.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package config

import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"

updatev1alpha1 "github.com/openshift/api/update/v1alpha1"
)

const (
GroupName = "update.openshift.io"
)

var (
schemeBuilder = runtime.NewSchemeBuilder(updatev1alpha1.Install)
// Install is a function which adds every version of this group to a scheme
Install = schemeBuilder.AddToScheme
)

func Resource(resource string) schema.GroupResource {
return schema.GroupResource{Group: GroupName, Resource: resource}
}

func Kind(kind string) schema.GroupKind {
return schema.GroupKind{Group: GroupName, Kind: kind}
}
3 changes: 3 additions & 0 deletions update/v1alpha1/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.PHONY: test
test:
make -C ../../tests test GINKGO_EXTRA_ARGS=--focus="update.openshift.io/v1alpha1"
7 changes: 7 additions & 0 deletions update/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// +k8s:deepcopy-gen=package,register
// +k8s:defaulter-gen=TypeMeta
// +k8s:openapi-gen=true

// +groupName=update.openshift.io
// Package v1alpha1 is the v1alpha1 version of the API.
package v1alpha1
46 changes: 46 additions & 0 deletions update/v1alpha1/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)

var (
GroupName = "update.openshift.io"
GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
// Install is a function which adds this version to a scheme
Install = schemeBuilder.AddToScheme

// SchemeGroupVersion generated code relies on this name
// Deprecated
SchemeGroupVersion = GroupVersion
// AddToScheme exists solely to keep the old generators creating valid code
// DEPRECATED
AddToScheme = schemeBuilder.AddToScheme
)

// Resource generated code relies on this being here, but it logically belongs to the group
// DEPRECATED
func Resource(resource string) schema.GroupResource {
return schema.GroupResource{Group: GroupName, Resource: resource}
}

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(GroupVersion,
&ClusterVersionProgressInsight{},
&ClusterVersionProgressInsightList{},
&ClusterOperatorProgressInsight{},
&ClusterOperatorProgressInsightList{},
&MachineConfigPoolProgressInsight{},
&MachineConfigPoolProgressInsightList{},
&NodeProgressInsight{},
&NodeProgressInsightList{},
&HealthInsight{},
&HealthInsightList{},
)
metav1.AddToGroupVersion(scheme, GroupVersion)
return nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "ClusterOperatorProgressInsight"
crdName: clusteroperatorprogressinsights.update.openshift.io
featureGate: UpgradeStatus
tests:
onCreate:
- name: Should be able to create a minimal ClusterOperatorProgressInsight
initial: |
apiVersion: update.openshift.io/v1alpha1
kind: ClusterOperatorProgressInsight
spec: {} # No spec is required for a ClusterOperatorProgressInsight
expected: |
apiVersion: update.openshift.io/v1alpha1
kind: ClusterOperatorProgressInsight
spec: {}
onUpdate:
- name: ClusterOperatorProgressInsight example
initial: |
apiVersion: update.openshift.io/v1alpha1
kind: ClusterOperatorProgressInsight
metadata:
name: authentication
spec: {}
updated: |
apiVersion: update.openshift.io/v1alpha1
kind: ClusterOperatorProgressInsight
metadata:
name: authentication
spec: {}
status:
name: authentication
conditions:
- type: Updating
status: "False"
lastTransitionTime: "2021-01-01T00:00:00Z"
reason: Pending
message: "Installing version 4.18.0"
- type: Healthy
status: "False"
lastTransitionTime: "2021-01-01T00:00:00Z"
reason: Degraded
message: "Authentication operator is not healthy"
expected: |
apiVersion: update.openshift.io/v1alpha1
kind: ClusterOperatorProgressInsight
metadata:
name: authentication
spec: {}
status:
name: authentication
conditions:
- type: Updating
status: "False"
lastTransitionTime: "2021-01-01T00:00:00Z"
reason: Pending
message: "Installing version 4.18.0"
- type: Healthy
status: "False"
lastTransitionTime: "2021-01-01T00:00:00Z"
reason: Degraded
message: "Authentication operator is not healthy"
- name: Name and .status.name must match
initial: |
apiVersion: update.openshift.io/v1alpha1
kind: ClusterOperatorProgressInsight
metadata:
name: etcd
spec: {}
updated: |
apiVersion: update.openshift.io/v1alpha1
kind: ClusterOperatorProgressInsight
metadata:
name: etcd
spec: {}
status:
name: not-etc
conditions:
- type: Updating
status: "False"
lastTransitionTime: "2021-01-01T00:00:00Z"
reason: Pending
message: "Installing version 4.18.0"
- type: Healthy
status: "False"
lastTransitionTime: "2021-01-01T00:00:00Z"
reason: Degraded
message: "Authentication operator is not healthy"
expected: |
apiVersion: update.openshift.io/v1alpha1
kind: ClusterOperatorProgressInsight
spec: {}
expectedStatusError: "Invalid value: \"object\": When status is present, .status must match .metadata.name"

Loading