From 55131c897daf2ba93ea3693cd27104542883bde7 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Sat, 22 Jun 2024 18:15:32 +0200 Subject: [PATCH 01/45] `UpdateStatus`: Initial working draft --- config/v1alpha1/register.go | 2 + config/v1alpha1/types_update_status.go | 497 +++++++++++++++++++++++++ 2 files changed, 499 insertions(+) create mode 100644 config/v1alpha1/types_update_status.go diff --git a/config/v1alpha1/register.go b/config/v1alpha1/register.go index 4b30ea380b1..f917dc9a235 100644 --- a/config/v1alpha1/register.go +++ b/config/v1alpha1/register.go @@ -40,6 +40,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ImagePolicyList{}, &ClusterImagePolicy{}, &ClusterImagePolicyList{}, + &UpdateStatus{}, + &UpdateStatusList{}, ) metav1.AddToGroupVersion(scheme, GroupVersion) return nil diff --git a/config/v1alpha1/types_update_status.go b/config/v1alpha1/types_update_status.go new file mode 100644 index 00000000000..fdd002c715f --- /dev/null +++ b/config/v1alpha1/types_update_status.go @@ -0,0 +1,497 @@ +package v1alpha1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// UpdateStatus is the API about in-progress updates, kept populated by Update Status Controller by +// aggregating and summarizing UpdateInformers +// +// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=updatestatuses,scope=Cluster +// +kubebuilder:subresource:status +// +openshift:api-approved.openshift.io=TODO +// +openshift:file-pattern=cvoRunLevel=0000_00,operatorName=cluster-version-operator,operatorOrdering=02 +// +openshift:enable:FeatureGate=UpgradeStatus +// +openshift:compatibility-gen:level=4 +type UpdateStatus struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +kubebuilder:validation:Required + Spec UpdateStatusSpec `json:"spec"` + // +optional + Status UpdateStatusStatus `json:"status,omitempty"` +} + +// UpdateStatusSpec is empty for now, can possibly hold configuration for Update Status Controller in the future +type UpdateStatusSpec struct { +} + +// +k8s:deepcopy-gen=true + +// UpdateStatusStatus is the API about in-progress updates, kept populated by Update Status Controller by +// aggregating and summarizing UpdateInformers +type UpdateStatusStatus struct { + // ControlPlaneUpdateStatus contains a summary and insights related to the control plane update + ControlPlane ControlPlaneUpdateStatus `json:"controlPlane"` + + // WorkerPoolsUpdateStatus contains summaries and insights related to the worker pools update + WorkerPools []PoolUpdateStatus `json:"workerPools"` + + // Conditions provide details about Update Status Controller operational matters + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +type ControlPlaneConditionType string + +const ( + ControlPlaneConditionTypeUpdating ControlPlaneConditionType = "Updating" +) + +type ControlPlaneConditionUpdatingReason string + +const ( + ControlPlaneConditionUpdatingReasonClusterVersionProgressing ControlPlaneConditionUpdatingReason = "ClusterVersionProgressing" + ControlPlaneConditionUpdatingReasonClusterVersionNotProgressing ControlPlaneConditionUpdatingReason = "ClusterVersionNotProgressing" + ControlPlaneConditionUpdatingReasonClusterVersionProgressingUnknown ControlPlaneConditionUpdatingReason = "ClusterVersionProgressingUnknown" + ControlPlaneConditionUpdatingReasonClusterVersionWithoutProgressing ControlPlaneConditionUpdatingReason = "ClusterVersionWithoutProgressing" +) + +// ControlPlaneUpdateStatus contains a summary and insights related to the control plane update +type ControlPlaneUpdateStatus struct { + // Informers is a list of insight producers, each carries a list of insights + // +listType=map + // +listMapKey=name + Informers []UpdateInformer `json:"informers,omitempty"` + + // Conditions provides details about the control plane update + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// UpdateInformer is an insight producer identified by a name, carrying a list of insights it produced +type UpdateInformer struct { + // Name is the name of the insight producer + // +required + // +kubebuilder:validation:Required + Name string `json:"name"` + + // Insights is a list of insights produced by this producer + Insights []UpdateInsight `json:"insights,omitempty"` +} + +type ControlPlaneUpdateAssessment string + +const ( + ControlPlaneUpdateAssessmentProgressing ControlPlaneUpdateAssessment = "Progressing" + ControlPlaneUpdateAssessmentCompleted ControlPlaneUpdateAssessment = "Completed" + ControlPlaneUpdateAssessmentDegraded ControlPlaneUpdateAssessment = "Degraded" +) + +type ClusterVersionStatusInsightConditionType string + +const ( + ClusterVersionStatusInsightConditionTypeUpdating ClusterVersionStatusInsightConditionType = "Updating" +) + +type ClusterVersionStatusInsightUpdatingReason string + +const ( + ClusterVersionStatusInsightUpdatingReasonNoProgressing ClusterVersionStatusInsightUpdatingReason = "MissingProgressingCondition" +) + +// ControlPlaneUpdateVersions contains the original and target versions of the upgrade +type ControlPlaneUpdateVersions struct { + // Previous is the version of the control plane before the update + Previous string `json:"previous,omitempty"` + + // IsPreviousPartial is true if the update was initiated in a state where the previous upgrade (to the original version) + // was not fully completed + IsPreviousPartial bool `json:"previousPartial,omitempty"` + + // Target is the version of the control plane after the update + Target string `json:"target"` + + // IsTargetInstall is true if the current (or last completed) work is an installation, not an upgrade + IsTargetInstall bool `json:"targetInstall,omitempty"` +} + +type ClusterVersionStatusInsight struct { + // Resource is the ClusterVersion resource that represents the control plane + Resource ResourceRef `json:"resource"` + + // Assessment is the assessment of the control plane update process + Assessment ControlPlaneUpdateAssessment `json:"assessment"` + + // Versions contains the original and target versions of the upgrade + Versions ControlPlaneUpdateVersions `json:"versions"` + + // Completion is a percentage of the update completion (0-100) + Completion int32 `json:"completion"` + + // StartedAt is the time when the update started + StartedAt metav1.Time `json:"startedAt"` + + // CompletedAt is the time when the update completed + CompletedAt metav1.Time `json:"completedAt"` + + // EstimatedCompletedAt is the estimated time when the update will complete + EstimatedCompletedAt metav1.Time `json:"estimatedCompletedAt"` + + // Conditions provides details about the control plane update + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` +} +type ClusterOperatorStatusInsightConditionType string + +const ( + ClusterOperatorStatusInsightConditionTypeUpdating ClusterOperatorStatusInsightConditionType = "Updating" + ClusterOperatorStatusInsightConditionTypeHealthy ClusterOperatorStatusInsightConditionType = "Healthy" +) + +type ClusterOperatorStatusInsightUpdatingReason string + +const ( + ClusterOperatorStatusInsightUpdatingReasonUpdated ClusterOperatorStatusInsightUpdatingReason = "Updated" + ClusterOperatorStatusInsightUpdatingReasonPending ClusterOperatorStatusInsightUpdatingReason = "Pending" + ClusterOperatorStatusInsightUpdatingReasonProgressing ClusterOperatorStatusInsightUpdatingReason = "Progressing" + ClusterOperatorStatusInsightUpdatingReasonUnknownUpdate ClusterOperatorStatusInsightUpdatingReason = "UnclearClusterState" + ClusterOperatorStatusInsightUpdatingReasonUnknownVersion ClusterOperatorStatusInsightUpdatingReason = "UnknownVersion" +) + +type ClusterOperatorStatusInsightHealthyReason string + +const ( + ClusterOperatorUpdateStatusInsightHealthyReasonAllIsWell ClusterOperatorStatusInsightHealthyReason = "AllIsWell" + ClusterOperatorUpdateStatusInsightHealthyReasonUnavailable ClusterOperatorStatusInsightHealthyReason = "Unavailable" + ClusterOperatorUpdateStatusInsightHealthyReasonDegraded ClusterOperatorStatusInsightHealthyReason = "Degraded" + ClusterOperatorUpdateStatusInsightHealthyReasonMissingAvailable ClusterOperatorStatusInsightHealthyReason = "MissingAvailable" + ClusterOperatorUpdateStatusInsightHealthyReasonMissingDegraded ClusterOperatorStatusInsightHealthyReason = "MissingDegraded" +) + +type ClusterOperatorStatusInsight struct { + // Name is the name of the operator + Name string `json:"name"` + + // Resource is the ClusterOperator resource that represents the operator + Resource ResourceRef `json:"resource"` + + // Conditions provide details about the operator + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// PoolUpdateStatus contains a summary and insights related to a node pool update +type PoolUpdateStatus struct { + // Name is the name of the pool + Name string `json:"name"` + + // Resource is the resource that represents the pool + Resource PoolResourceRef `json:"resource"` + + // Informers is a list of insight producers, each carries a list of insights + // +listType=map + // +listMapKey=name + Informers []UpdateInformer `json:"informers,omitempty"` + + // Conditions provide details about the pool +} + +type PoolUpdateAssessment string + +const ( + PoolUpdateAssessmentPending PoolUpdateAssessment = "Pending" + PoolUpdateAssessmentCompleted PoolUpdateAssessment = "Completed" + PoolUpdateAssessmentDegraded PoolUpdateAssessment = "Degraded" + PoolUpdateAssessmentExcluded PoolUpdateAssessment = "Excluded" + PoolUpdateAssessmentProgressing PoolUpdateAssessment = "Progressing" +) + +type PoolNodesSummaryType string + +const ( + PoolNodesSummaryTypeTotal PoolNodesSummaryType = "Total" + PoolNodesSummaryTypeAvailable PoolNodesSummaryType = "Available" + PoolNodesSummaryTypeProgressing PoolNodesSummaryType = "Progressing" + PoolNodesSummaryTypeOutdated PoolNodesSummaryType = "Outdated" + PoolNodesSummaryTypeDraining PoolNodesSummaryType = "Draining" + PoolNodesSummaryTypeExcluded PoolNodesSummaryType = "Excluded" + PoolNodesSummaryTypeDegraded PoolNodesSummaryType = "Degraded" +) + +type PoolNodesUpdateSummary struct { + // Type is the type of the summary + // +required + // +kubebuilder:validation:Required + Type PoolNodesSummaryType `json:"type"` + + // Count is the number of nodes matching the criteria + Count int32 `json:"count"` +} + +type MachineConfigPoolStatusInsight struct { + // Name is the name of the machine config pool + Name string `json:"name"` + + // Resource is the MachineConfigPool resource that represents the pool + Resource ResourceRef `json:"resource"` + + // Scope describes whether the pool is a control plane or a worker pool + Scope ScopeType `json:"scopeType"` + + // Assessment is the assessment of the machine config pool update process + Assessment PoolUpdateAssessment `json:"assessment"` + + // Completion is a percentage of the update completion (0-100) + Completion int32 `json:"completion"` + + // Summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.) + // +listType=map + // +listMapKey=type + Summaries []PoolNodesUpdateSummary `json:"summaries,omitempty"` + + // Conditions provide details about the machine config pool + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +type NodeStatusInsightConditionType string + +const ( + NodeStatusInsightConditionTypeUpdating NodeStatusInsightConditionType = "Updating" + NodeStatusInsightConditionTypeDegraded NodeStatusInsightConditionType = "Degraded" + NodeStatusInsightConditionTypeAvailable NodeStatusInsightConditionType = "Available" +) + +type NodeStatusInsightUpdatingReason string + +const ( + // Updating=True reasons + + NodeStatusInsightUpdatingReasonDraining NodeStatusInsightUpdatingReason = "Draining" + NodeStatusInsightUpdatingReasonUpdating NodeStatusInsightUpdatingReason = "Updating" + NodeStatusInsightUpdatingReasonRebooting NodeStatusInsightUpdatingReason = "Rebooting" + + // Updating=False reasons + + NodeStatusInsightUpdatingReasonPaused NodeStatusInsightUpdatingReason = "Paused" + NodeStatusInsightUpdatingReasonPending NodeStatusInsightUpdatingReason = "Pending" + NodeStatusInsightUpdatingReasonCompleted NodeStatusInsightUpdatingReason = "Completed" +) + +type NodeStatusInsight struct { + // Name is the name of the node + Name string `json:"name"` + + // Resource is the Node resource that represents the node + Resource ResourceRef `json:"resource"` + + // PoolResource is the resource that represents the pool the node is a member of + PoolResource PoolResourceRef `json:"poolResource"` + + // Version is the version of the node, when known + Version string `json:"version,omitempty"` + + // EstToComplete is the estimated time to complete the update, when known + EstToComplete metav1.Duration `json:"estToComplete,omitempty"` + + // Message is a human-readable message about the node update status + Message string `json:"message,omitempty"` + + // Conditions provides details about the control plane update + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +type UpdateInsightType string + +const ( + UpdateInsightTypeClusterVersionStatusInsight UpdateInsightType = "ClusterVersion" + UpdateInsightTypeClusterOperatorStatusInsight UpdateInsightType = "ClusterOperator" + UpdateInsightTypeMachineConfigPoolStatusInsight UpdateInsightType = "MachineConfigPool" + UpdateInsightTypeNodeStatusInsight UpdateInsightType = "Node" + UpdateInsightTypeUpdateHealthInsight UpdateInsightType = "UpdateHealth" +) + +type UpdateInsight struct { + // +unionDiscriminator + Type UpdateInsightType `json:"type"` + + // UID identifies an insight over time + UID string `json:"uid"` + + // AcquiredAt is the time when the data was acquired by the producer + AcquiredAt metav1.Time `json:"acquisitionTime"` + + // ClusterVersionStatusInsight is a status insight about the state of a control plane update, where + // the control plane is represented by a ClusterVersion resource usually managed by CVO + // +optional + ClusterVersionStatusInsight *ClusterVersionStatusInsight `json:"cv,omitempty"` + + // ClusterOperatorStatusInsight is a status insight about the state of a control plane cluster operator update + // represented by a ClusterOperator resource + // +optional + ClusterOperatorStatusInsight *ClusterOperatorStatusInsight `json:"co,omitempty"` + + // MachineConfigPoolStatusInsight is a status insight about the state of a worker pool update, where the worker pool + // is represented by a MachineConfigPool resource + // +optional + MachineConfigPoolStatusInsight *MachineConfigPoolStatusInsight `json:"mcp,omitempty"` + + // NodeStatusInsight is a status insight about the state of a worker node update, where the worker node is represented + // by a Node resource + // +optional + NodeStatusInsight *NodeStatusInsight `json:"node,omitempty"` + + // UpdateHealthInsight is a generic health insight about the update. It does not represent a status of any specific + // resource but surfaces actionable information about the health of the cluster or an update + // +optional + UpdateHealthInsight *UpdateHealthInsight `json:"health,omitempty"` +} + +// UpdateHealthInsight is a piece of actionable information produced by an insight producer about the health +// of the cluster or an update +type UpdateHealthInsight struct { + // StartedAt is the time when the condition reported by the insight started + StartedAt metav1.Time `json:"startedAt"` + + // Scope is list of objects involved in the insight + // +optional + Scope UpdateInsightScope `json:"scope,omitempty"` + + // Impact describes the impact the reported condition has on the cluster or update + Impact UpdateInsightImpact `json:"impact"` + + // Remediation contains ... TODO + Remediation UpdateInsightRemediation `json:"remediation"` +} + +// ScopeType is one of ControlPlane or WorkerPool +// +kubebuilder:validation:Enum=ControlPlane;WorkerPool +type ScopeType string + +const ( + ScopeTypeControlPlane ScopeType = "ControlPlane" + ScopeTypeWorkerPool ScopeType = "WorkerPool" +) + +// UpdateInsightScope is a list of objects involved in the insight +type UpdateInsightScope struct { + // Type is either ControlPlane or WorkerPool + // +kubebuilder:validation:Required + Type ScopeType `json:"type"` + + // Resources is a list of resources involved in the insight + // +optional + Resources []ResourceRef `json:"resources,omitempty"` +} + +// ResourceRef is a reference to a kubernetes resource, typically involved in an +// insight +type ResourceRef struct { + // Kind of object being referenced + Kind string `json:"kind"` + + // APIGroup of the object being referenced + // +optional + APIGroup string `json:"apiGroup,omitempty"` + + // Name of the object being referenced + Name string `json:"name"` + + // Namespace of the object being referenced, if any + // +optional + Namespace string `json:"namespace,omitempty"` +} + +// InsightImpactLevel describes the severity of the impact the reported condition has on the cluster or update +// +kubebuilder:validation:Enum=info;warning;error;critical +type InsightImpactLevel string + +const ( + // InfoImpactLevel should be used for insights that are strictly informational or even positive (things go well or + // something recently healed) + InfoImpactLevel InsightImpactLevel = "info" + // WarningImpactLevel should be used for insights that explain a minor or transient problem. Anything that requires + // admin attention or manual action should not be a warning but at least an error. + WarningImpactLevel InsightImpactLevel = "warning" + // ErrorImpactLevel should be used for insights that inform about a problem that requires admin attention. Insights of + // level error and higher should be as actionable as possible, and should be accompanied by links to documentation, + // KB articles or other resources that help the admin to resolve the problem. + ErrorImpactLevel InsightImpactLevel = "error" + // CriticalInfoLevel should be used rarely, for insights that inform about a severe problem, threatening with data + // loss, destroyed cluster or other catastrophic consequences. Insights of this level should be accompanied by + // links to documentation, KB articles or other resources that help the admin to resolve the problem, or at least + // prevent the severe consequences from happening. + CriticalInfoLevel InsightImpactLevel = "critical" +) + +// InsightImpactType describes the type of the impact the reported condition has on the cluster or update +// +kubebuilder:validation:Enum=None;Unknown;API Availability;Cluster Capacity;Application Availability;Application Outage;Data Loss;Update Speed;Update Stalled +type InsightImpactType string + +const ( + NoneImpactType InsightImpactType = "None" + UnknownImpactType InsightImpactType = "Unknown" + ApiAvailabilityImpactType InsightImpactType = "API Availability" + ClusterCapacityImpactType InsightImpactType = "Cluster Capacity" + ApplicationAvailabilityImpactType InsightImpactType = "Application Availability" + ApplicationOutageImpactType InsightImpactType = "Application Outage" + DataLossImpactType InsightImpactType = "Data Loss" + UpdateSpeedImpactType InsightImpactType = "Update Speed" + UpdateStalledImpactType InsightImpactType = "Update Stalled" +) + +// UpdateInsightImpact describes the impact the reported condition has on the cluster or update +type UpdateInsightImpact struct { + // Level is the severity of the impact + Level InsightImpactLevel `json:"level"` + + // Type is the type of the impact + Type InsightImpactType `json:"type"` + + // Summary is a short summary of the impact + Summary string `json:"summary"` + + // Description is a human-oriented description of the condition reported by the insight + Description string `json:"description"` +} + +// UpdateInsightRemediation contains ... TODO +type UpdateInsightRemediation struct { + // Reference is a URL where administrators can find information to resolve or prevent the reported condition + Reference string `json:"reference"` + + // EstimatedFinish is the estimated time when the informer expects the condition to be resolved, if applicable. + // This should normally only be provided by system level insights (impact level=status) + EstimatedFinish metav1.Time `json:"estimatedFinish"` +} + +// PoolResourceRef is a reference to a kubernetes resource that represents a worker pool +type PoolResourceRef struct { + ResourceRef `json:",inline"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// UpdateStatusList is a list of UpdateStatus resources +// +// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. +// +openshift:compatibility-gen:level=4 +type UpdateStatusList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []UpdateStatus `json:"items"` +} From 03be4bde4c08ca6e5ebc7716306efa5a57753e76 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Wed, 28 Aug 2024 18:08:22 +0200 Subject: [PATCH 02/45] status: add conditions to pool --- config/v1alpha1/types_update_status.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/v1alpha1/types_update_status.go b/config/v1alpha1/types_update_status.go index fdd002c715f..b2ca72f7ad5 100644 --- a/config/v1alpha1/types_update_status.go +++ b/config/v1alpha1/types_update_status.go @@ -204,6 +204,9 @@ type PoolUpdateStatus struct { Informers []UpdateInformer `json:"informers,omitempty"` // Conditions provide details about the pool + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` } type PoolUpdateAssessment string From 1212335da8c068c4f21d5025025d7da15527e22a Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Thu, 29 Aug 2024 17:06:10 +0200 Subject: [PATCH 03/45] status: move to a new `update.openshift.io` group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved `UpdateStatus` from `config.openshift.io` group to a new `update.openshift.io`, because config did not feel like a good fit (there’s no configuration involved) and none of the other existing groups felt appropriate. --- config/v1alpha1/register.go | 2 - update/.codegen.yaml | 2 + update/install.go | 26 +++++++++++++ update/v1alpha1/Makefile | 3 ++ update/v1alpha1/doc.go | 8 ++++ update/v1alpha1/register.go | 38 +++++++++++++++++++ .../v1alpha1/types_update_status.go | 0 7 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 update/.codegen.yaml create mode 100644 update/install.go create mode 100644 update/v1alpha1/Makefile create mode 100644 update/v1alpha1/doc.go create mode 100644 update/v1alpha1/register.go rename {config => update}/v1alpha1/types_update_status.go (100%) diff --git a/config/v1alpha1/register.go b/config/v1alpha1/register.go index f917dc9a235..4b30ea380b1 100644 --- a/config/v1alpha1/register.go +++ b/config/v1alpha1/register.go @@ -40,8 +40,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ImagePolicyList{}, &ClusterImagePolicy{}, &ClusterImagePolicyList{}, - &UpdateStatus{}, - &UpdateStatusList{}, ) metav1.AddToGroupVersion(scheme, GroupVersion) return nil diff --git a/update/.codegen.yaml b/update/.codegen.yaml new file mode 100644 index 00000000000..ffa2c8d9b2e --- /dev/null +++ b/update/.codegen.yaml @@ -0,0 +1,2 @@ +swaggerdocs: + commentPolicy: Warn diff --git a/update/install.go b/update/install.go new file mode 100644 index 00000000000..0be9a22e20d --- /dev/null +++ b/update/install.go @@ -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} +} diff --git a/update/v1alpha1/Makefile b/update/v1alpha1/Makefile new file mode 100644 index 00000000000..071ce9bdcaa --- /dev/null +++ b/update/v1alpha1/Makefile @@ -0,0 +1,3 @@ +.PHONY: test +test: + make -C ../../tests test GINKGO_EXTRA_ARGS=--focus="update.openshift.io/v1alpha1" diff --git a/update/v1alpha1/doc.go b/update/v1alpha1/doc.go new file mode 100644 index 00000000000..f4e39a0523c --- /dev/null +++ b/update/v1alpha1/doc.go @@ -0,0 +1,8 @@ +// +k8s:deepcopy-gen=package,register +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true + +// +kubebuilder:validation:Optional +// +groupName=update.openshift.io +// Package v1alpha1 is the v1alpha1 version of the API. +package v1alpha1 diff --git a/update/v1alpha1/register.go b/update/v1alpha1/register.go new file mode 100644 index 00000000000..562ec59e19a --- /dev/null +++ b/update/v1alpha1/register.go @@ -0,0 +1,38 @@ +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, + &UpdateStatus{}, + &UpdateStatusList{}, + ) + metav1.AddToGroupVersion(scheme, GroupVersion) + return nil +} diff --git a/config/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go similarity index 100% rename from config/v1alpha1/types_update_status.go rename to update/v1alpha1/types_update_status.go From 22fe1ec07906cd6dac52e33c98c1a86f0dfcad18 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Thu, 29 Aug 2024 17:24:04 +0200 Subject: [PATCH 04/45] status: make namespaced Initial draft used a non-namespaced API, because in standalone clusters it would be a singleton scoped to the cluster, semantically. We expect the concept to work with HCP too though. There the resource would need to live in the management cluster apiserver and would be scoped to a *hosted* cluster, not the management cluster (management cluster would need one too, though). Therefore, we would need a namespaced, functionally equivalent CRD for HCP, which seems like higher effort and complexity than the minor awkwardness of using a namespaced resource in standalone clusters. --- update/v1alpha1/types_update_status.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index b2ca72f7ad5..1f3e4afd008 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -3,7 +3,6 @@ package v1alpha1 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +genclient -// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // UpdateStatus is the API about in-progress updates, kept populated by Update Status Controller by @@ -11,7 +10,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // // Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. // +kubebuilder:object:root=true -// +kubebuilder:resource:path=updatestatuses,scope=Cluster +// +kubebuilder:resource:path=updatestatuses,scope=Namespaced // +kubebuilder:subresource:status // +openshift:api-approved.openshift.io=TODO // +openshift:file-pattern=cvoRunLevel=0000_00,operatorName=cluster-version-operator,operatorOrdering=02 From ddfc2b9cd23e028b6dd171fe4cc950dbdc4e68de Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Thu, 29 Aug 2024 17:50:43 +0200 Subject: [PATCH 05/45] status: add resource ref to high-level control plane status Adding a resource reference to this level improves the cohesion with workerPools part of the API, and can be useful in standalone/hcp scenarios where controlplane is represented by different CRDs. --- update/v1alpha1/types_update_status.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 1f3e4afd008..6268a32d437 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -64,6 +64,10 @@ const ( // ControlPlaneUpdateStatus contains a summary and insights related to the control plane update type ControlPlaneUpdateStatus struct { + // Resource is the resource that represents the control plane. It will typically be a ClusterVersion resource + // in standalone OpenShift and HostedCluster in HCP. + Resource PoolResourceRef `json:"resource"` + // Informers is a list of insight producers, each carries a list of insights // +listType=map // +listMapKey=name From cabb94821bf8d6b464bfa1f283c2c4d2a55e8aaa Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Thu, 29 Aug 2024 18:06:47 +0200 Subject: [PATCH 06/45] status: expand cv/co/mcp in json keys --- update/v1alpha1/types_update_status.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 6268a32d437..239682d7a59 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -343,17 +343,17 @@ type UpdateInsight struct { // ClusterVersionStatusInsight is a status insight about the state of a control plane update, where // the control plane is represented by a ClusterVersion resource usually managed by CVO // +optional - ClusterVersionStatusInsight *ClusterVersionStatusInsight `json:"cv,omitempty"` + ClusterVersionStatusInsight *ClusterVersionStatusInsight `json:"clusterVersion,omitempty"` // ClusterOperatorStatusInsight is a status insight about the state of a control plane cluster operator update // represented by a ClusterOperator resource // +optional - ClusterOperatorStatusInsight *ClusterOperatorStatusInsight `json:"co,omitempty"` + ClusterOperatorStatusInsight *ClusterOperatorStatusInsight `json:"clusterOperator,omitempty"` // MachineConfigPoolStatusInsight is a status insight about the state of a worker pool update, where the worker pool // is represented by a MachineConfigPool resource // +optional - MachineConfigPoolStatusInsight *MachineConfigPoolStatusInsight `json:"mcp,omitempty"` + MachineConfigPoolStatusInsight *MachineConfigPoolStatusInsight `json:"machineConfigPool,omitempty"` // NodeStatusInsight is a status insight about the state of a worker node update, where the worker node is represented // by a Node resource From 913a5687d94773aa9452797bf6cd31fa3d79cd45 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 3 Sep 2024 17:02:26 +0200 Subject: [PATCH 07/45] status: generalize metadata on CV update edge versions We are expecting use cases for more flexible metadata about the versions involved in the update, such as 'architecture' for pseudo-updates when clusters are migrated from `x86_64` to `multi`. The original two boolean flags were replaced with a generic list of name+type+value triplets. --- update/v1alpha1/types_update_status.go | 57 ++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 239682d7a59..b4b89a28806 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -110,20 +110,59 @@ const ( ClusterVersionStatusInsightUpdatingReasonNoProgressing ClusterVersionStatusInsightUpdatingReason = "MissingProgressingCondition" ) +type VersionMetadataType string + +const ( + VersionMetadataTypeString VersionMetadataType = "string" + VersionMetadataTypeBool VersionMetadataType = "bool" + VersionMetadataTypeInt VersionMetadataType = "int" +) + +type VersionMetadataKey string + +const ( + // InstallationMetadataKey denotes a boolean that indicates the update was initiated as an installation + InstallationMetadataKey VersionMetadataKey = "installation" + // PartialMetadataKey denotes a boolean that indicates the update was initiated in a state where the previous upgrade + // (to the original version) was not fully completed + PartialMetadataKey VersionMetadataKey = "partial" + // ArchitectureMetadataKey denotes a string that indicates the architecture of the payload image of the version, + // when relevant + ArchitectureMetadataKey VersionMetadataKey = "architecture" +) + +type VersionMetadata struct { + // +required + Key VersionMetadataKey `json:"key"` + + // +unionDiscriminator + // +required + Type VersionMetadataType `json:"type"` + + // +optional + String string `json:"string,omitempty"` + + // +optional + Bool bool `json:"bool,omitempty"` +} + +type UpdateEdgeVersion struct { + // Version is the version of the edge + Version string `json:"version,omitempty"` + + // Metadata is a list of metadata associated with the version + // +listType=map + // +listMapKey=key + Metadata []VersionMetadata `json:"metadata,omitempty"` +} + // ControlPlaneUpdateVersions contains the original and target versions of the upgrade type ControlPlaneUpdateVersions struct { // Previous is the version of the control plane before the update - Previous string `json:"previous,omitempty"` - - // IsPreviousPartial is true if the update was initiated in a state where the previous upgrade (to the original version) - // was not fully completed - IsPreviousPartial bool `json:"previousPartial,omitempty"` + Previous UpdateEdgeVersion `json:"previous,omitempty"` // Target is the version of the control plane after the update - Target string `json:"target"` - - // IsTargetInstall is true if the current (or last completed) work is an installation, not an upgrade - IsTargetInstall bool `json:"targetInstall,omitempty"` + Target UpdateEdgeVersion `json:"target"` } type ClusterVersionStatusInsight struct { From 528ae576da90f7690ef519daf47cd28b0b9c550c Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 1 Oct 2024 15:48:11 +0200 Subject: [PATCH 08/45] status: add several assessment/reason consts --- update/v1alpha1/types_update_status.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index b4b89a28806..947c8619408 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -93,6 +93,7 @@ type UpdateInformer struct { type ControlPlaneUpdateAssessment string const ( + ControlPlaneUpdateAssessmentUnknown ControlPlaneUpdateAssessment = "Unknown" ControlPlaneUpdateAssessmentProgressing ControlPlaneUpdateAssessment = "Progressing" ControlPlaneUpdateAssessmentCompleted ControlPlaneUpdateAssessment = "Completed" ControlPlaneUpdateAssessmentDegraded ControlPlaneUpdateAssessment = "Degraded" @@ -107,7 +108,9 @@ const ( type ClusterVersionStatusInsightUpdatingReason string const ( - ClusterVersionStatusInsightUpdatingReasonNoProgressing ClusterVersionStatusInsightUpdatingReason = "MissingProgressingCondition" + ClusterVersionStatusInsightUpdatingReasonCannotDetermineUpdating ClusterVersionStatusInsightUpdatingReason = "CannotDetermineUpdating" + ClusterVersionStatusInsightUpdatingReasonProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionProgressing" + ClusterVersionStatusInsightUpdatingReasonNotProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionNotProgressing" ) type VersionMetadataType string @@ -176,7 +179,7 @@ type ClusterVersionStatusInsight struct { Versions ControlPlaneUpdateVersions `json:"versions"` // Completion is a percentage of the update completion (0-100) - Completion int32 `json:"completion"` + Completion uint8 `json:"completion"` // StartedAt is the time when the update started StartedAt metav1.Time `json:"startedAt"` From 7a3b626f446b9aa4229f1cabff223c584a124450 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Mon, 7 Oct 2024 17:11:48 +0200 Subject: [PATCH 09/45] status: godocs, renames, review feedback --- update/v1alpha1/types_update_status.go | 545 +++++++++++++++++-------- 1 file changed, 375 insertions(+), 170 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 947c8619408..0787f22077b 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -6,21 +6,25 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // UpdateStatus is the API about in-progress updates, kept populated by Update Status Controller by -// aggregating and summarizing UpdateInformers +// aggregating and summarizing UpdateInsights produced by update informers // // Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. +// +openshift:compatibility-gen:level=4 // +kubebuilder:object:root=true -// +kubebuilder:resource:path=updatestatuses,scope=Namespaced // +kubebuilder:subresource:status +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:resource:path=updatestatuses,scope=Namespaced // +openshift:api-approved.openshift.io=TODO // +openshift:file-pattern=cvoRunLevel=0000_00,operatorName=cluster-version-operator,operatorOrdering=02 // +openshift:enable:FeatureGate=UpgradeStatus -// +openshift:compatibility-gen:level=4 +// +kubebuilder:metadata:annotations="description=Provides health and status information about OpenShift cluster updates." +// +kubebuilder:metadata:annotations="displayName=UpdateStatuses" type UpdateStatus struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:Required + // +required Spec UpdateStatusSpec `json:"spec"` // +optional Status UpdateStatusStatus `json:"status,omitempty"` @@ -33,49 +37,69 @@ type UpdateStatusSpec struct { // +k8s:deepcopy-gen=true // UpdateStatusStatus is the API about in-progress updates, kept populated by Update Status Controller by -// aggregating and summarizing UpdateInformers +// aggregating and summarizing UpdateInsights produced by update informers type UpdateStatusStatus struct { - // ControlPlaneUpdateStatus contains a summary and insights related to the control plane update + // controlPlane contains a summary and insights related to the control plane update ControlPlane ControlPlaneUpdateStatus `json:"controlPlane"` - // WorkerPoolsUpdateStatus contains summaries and insights related to the worker pools update + // workerPools contains summaries and insights related to the worker pools update WorkerPools []PoolUpdateStatus `json:"workerPools"` - // Conditions provide details about Update Status Controller operational matters + // conditions provide details about Update Status Controller operational matters // +listType=map // +listMapKey=type + // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` } +// ControlPlaneConditionType are types of conditions that can be reported on control plane level type ControlPlaneConditionType string const ( - ControlPlaneConditionTypeUpdating ControlPlaneConditionType = "Updating" + // ControlPlaneUpdating is the condition type that communicate whether the whole control plane is updating + // or not + ControlPlaneUpdating ControlPlaneConditionType = "Updating" ) -type ControlPlaneConditionUpdatingReason string +// ControlPlaneUpdatingReason are well-known reasons for the Updating condition +// +kubebuilder:validation:Enum=ClusterVersionProgressing;ClusterVersionNotProgressing;CannotDetermineUpdating +type ControlPlaneUpdatingReason string const ( - ControlPlaneConditionUpdatingReasonClusterVersionProgressing ControlPlaneConditionUpdatingReason = "ClusterVersionProgressing" - ControlPlaneConditionUpdatingReasonClusterVersionNotProgressing ControlPlaneConditionUpdatingReason = "ClusterVersionNotProgressing" - ControlPlaneConditionUpdatingReasonClusterVersionProgressingUnknown ControlPlaneConditionUpdatingReason = "ClusterVersionProgressingUnknown" - ControlPlaneConditionUpdatingReasonClusterVersionWithoutProgressing ControlPlaneConditionUpdatingReason = "ClusterVersionWithoutProgressing" + // ReasonClusterVersionProgressing is used for Updating=True set because we observed a ClusterVersion resource to + // have Progressing=True condition + ReasonClusterVersionProgressing ControlPlaneUpdatingReason = "ClusterVersionProgressing" + // ReasonClusterVersionNotProgressing is used for Updating=False set because we observed a ClusterVersion resource to + // have Progressing=False condition + ReasonClusterVersionNotProgressing ControlPlaneUpdatingReason = "ClusterVersionNotProgressing" + // ReasonClusterVersionCannotDetermine is used for Updating=Unknown. This covers many different actual reasons such as + // missing or Unknown Progressing condition on ClusterVersion, but it does not seem useful to track the individual + // reasons to that granularity for Updating=Unknown + ReasonClusterVersionCannotDetermine ControlPlaneUpdatingReason = "CannotDetermineUpdating" ) // ControlPlaneUpdateStatus contains a summary and insights related to the control plane update type ControlPlaneUpdateStatus struct { - // Resource is the resource that represents the control plane. It will typically be a ClusterVersion resource + // resource is the resource that represents the control plane. It will typically be a ClusterVersion resource // in standalone OpenShift and HostedCluster in HCP. - Resource PoolResourceRef `json:"resource"` + // +required + Resource ResourceRef `json:"resource"` + + // poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field + // is optional because some form factors (like HCP) do not have dedicated control plane node pools. + // +optional + PoolResource PoolResourceRef `json:"poolResource,omitempty"` - // Informers is a list of insight producers, each carries a list of insights + // informers is a list of insight producers, each carries a list of insights relevant for control plane // +listType=map // +listMapKey=name + // +optional Informers []UpdateInformer `json:"informers,omitempty"` - // Conditions provides details about the control plane update + // conditions provides details about the control plane update // +listType=map // +listMapKey=type + // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` } @@ -87,341 +111,503 @@ type UpdateInformer struct { Name string `json:"name"` // Insights is a list of insights produced by this producer + // +optional Insights []UpdateInsight `json:"insights,omitempty"` } -type ControlPlaneUpdateAssessment string +// ControlPlaneAssessment is the assessment of the control plane update process +type ControlPlaneAssessment string const ( - ControlPlaneUpdateAssessmentUnknown ControlPlaneUpdateAssessment = "Unknown" - ControlPlaneUpdateAssessmentProgressing ControlPlaneUpdateAssessment = "Progressing" - ControlPlaneUpdateAssessmentCompleted ControlPlaneUpdateAssessment = "Completed" - ControlPlaneUpdateAssessmentDegraded ControlPlaneUpdateAssessment = "Degraded" + // Unknown means the update status and health cannot be determined + ControlPlaneAssessmentUnknown ControlPlaneAssessment = "Unknown" + // Progressing means the control plane is updating and no problems or slowness are detected + ControlPlaneAssessmentProgressing ControlPlaneAssessment = "Progressing" + // Completed means the control plane successfully completed updating and no problems are detected + ControlPlaneAssessmentCompleted ControlPlaneAssessment = "Completed" + // Degraded means the process of updating the control plane suffers from an observed problem + ControlPlaneAssessmentDegraded ControlPlaneAssessment = "Degraded" ) +// ClusterVersionStatusInsightConditionType are types of conditions that can be reported on ClusterVersion status insight type ClusterVersionStatusInsightConditionType string const ( - ClusterVersionStatusInsightConditionTypeUpdating ClusterVersionStatusInsightConditionType = "Updating" + // Updating condition communicates whether the ClusterVersion is updating + ClusterVersionStatusInsightUpdating ClusterVersionStatusInsightConditionType = "Updating" ) +// ClusterVersionStatusInsightUpdatingReason are well-known reasons for the Updating condition on ClusterVersion status insights type ClusterVersionStatusInsightUpdatingReason string const ( - ClusterVersionStatusInsightUpdatingReasonCannotDetermineUpdating ClusterVersionStatusInsightUpdatingReason = "CannotDetermineUpdating" - ClusterVersionStatusInsightUpdatingReasonProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionProgressing" - ClusterVersionStatusInsightUpdatingReasonNotProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionNotProgressing" + // CannotDetermineUpdating is used with Updating=Unknown + ClusterVersionCannotDetermineUpdating ClusterVersionStatusInsightUpdatingReason = "CannotDetermineUpdating" + // ClusterVersionProgressing means that ClusterVersion is considered to be Updating=True because it has a Progressing=True condition + ClusterVersionProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionProgressing" + // ClusterVersionNotProgressing means that ClusterVersion is considered to be Updating=False because it has a Progressing=False condition + ClusterVersionNotProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionNotProgressing" ) +// VersionMetadataType is the type of the metadata value +// +kubebuilder:validation:Enum=string;bool;int type VersionMetadataType string const ( - VersionMetadataTypeString VersionMetadataType = "string" - VersionMetadataTypeBool VersionMetadataType = "bool" - VersionMetadataTypeInt VersionMetadataType = "int" + StringVersionMetadata VersionMetadataType = "string" + BoolVersionMetadata VersionMetadataType = "bool" + IntVersionMetadata VersionMetadataType = "int" ) type VersionMetadataKey string const ( - // InstallationMetadataKey denotes a boolean that indicates the update was initiated as an installation - InstallationMetadataKey VersionMetadataKey = "installation" - // PartialMetadataKey denotes a boolean that indicates the update was initiated in a state where the previous upgrade + // installation denotes a boolean that indicates the update was initiated as an installation + InstallationMetadata VersionMetadataKey = "installation" + // partial denotes a boolean that indicates the update was initiated in a state where the previous upgrade // (to the original version) was not fully completed - PartialMetadataKey VersionMetadataKey = "partial" - // ArchitectureMetadataKey denotes a string that indicates the architecture of the payload image of the version, + PartialMetadata VersionMetadataKey = "partial" + // architecture denotes a string that indicates the architecture of the payload image of the version, // when relevant - ArchitectureMetadataKey VersionMetadataKey = "architecture" + ArchitectureMetadata VersionMetadataKey = "architecture" ) type VersionMetadata struct { // +required Key VersionMetadataKey `json:"key"` + // +required + VersionMetadataValue `json:",inline"` +} + +type VersionMetadataValue struct { // +unionDiscriminator // +required + // +kubebuilder:validation:Enum:string;bool;int Type VersionMetadataType `json:"type"` // +optional + // +kubebuilder:validation:Type=string + // +unionMember String string `json:"string,omitempty"` // +optional + // +kubebuilder:validation:Type=bool + // +unionMember Bool bool `json:"bool,omitempty"` + + // +optional + // +kubebuilder:validation:Type=int + // +unionMember + Integer int `json:"integer,omitempty"` } -type UpdateEdgeVersion struct { - // Version is the version of the edge +// Version describes a version involved in an update, typically on one side of an update edge +type Version struct { + // version is a semantic version string + // +required Version string `json:"version,omitempty"` - // Metadata is a list of metadata associated with the version + // metadata is a list of metadata associated with the version // +listType=map // +listMapKey=key + // +optional Metadata []VersionMetadata `json:"metadata,omitempty"` } // ControlPlaneUpdateVersions contains the original and target versions of the upgrade type ControlPlaneUpdateVersions struct { - // Previous is the version of the control plane before the update - Previous UpdateEdgeVersion `json:"previous,omitempty"` + // previous is the version of the control plane before the update + // +optional + Previous Version `json:"previous,omitempty"` - // Target is the version of the control plane after the update - Target UpdateEdgeVersion `json:"target"` + // target is the version of the control plane after the update + // +required + Target Version `json:"target"` } +// ClusterVersionStatusInsight reports the state of a ClusterVersion resource (which represents a control plane +// update in standalone clusters), during the update. type ClusterVersionStatusInsight struct { - // Resource is the ClusterVersion resource that represents the control plane + // resource is the ClusterVersion resource that represents the control plane + // +required Resource ResourceRef `json:"resource"` - // Assessment is the assessment of the control plane update process - Assessment ControlPlaneUpdateAssessment `json:"assessment"` + // assessment is the assessment of the control plane update process + // +required + Assessment ControlPlaneAssessment `json:"assessment"` - // Versions contains the original and target versions of the upgrade + // versions contains the original and target versions of the upgrade + // +required Versions ControlPlaneUpdateVersions `json:"versions"` - // Completion is a percentage of the update completion (0-100) + // completion is a percentage of the update completion (0-100) + // +required + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 Completion uint8 `json:"completion"` - // StartedAt is the time when the update started + // startedAt is the time when the update started + // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time StartedAt metav1.Time `json:"startedAt"` - // CompletedAt is the time when the update completed - CompletedAt metav1.Time `json:"completedAt"` + // completedAt is the time when the update completed + // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time + CompletedAt metav1.Time `json:"completedAt,omitempty"` - // EstimatedCompletedAt is the estimated time when the update will complete - EstimatedCompletedAt metav1.Time `json:"estimatedCompletedAt"` + // estimatedCompletedAt is the estimated time when the update will complete + // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time + EstimatedCompletedAt metav1.Time `json:"estimatedCompletedAt,omitempty"` // Conditions provides details about the control plane update // +listType=map // +listMapKey=type + // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` } + +// ClusterOperatorStatusInsightConditionType are types of conditions that can be reported on ClusterOperator status insights type ClusterOperatorStatusInsightConditionType string const ( - ClusterOperatorStatusInsightConditionTypeUpdating ClusterOperatorStatusInsightConditionType = "Updating" - ClusterOperatorStatusInsightConditionTypeHealthy ClusterOperatorStatusInsightConditionType = "Healthy" + // Updating condition communicates whether the ClusterOperator is updating + ClusterOperatorStatusInsightUpdating ClusterOperatorStatusInsightConditionType = "Updating" + // Healthy condition communicates whether the ClusterOperator is considered healthy + ClusterOperatorStatusInsightHealthy ClusterOperatorStatusInsightConditionType = "Healthy" ) -type ClusterOperatorStatusInsightUpdatingReason string +// ClusterOperatorUpdatingReason are well-known reasons for the Updating condition on ClusterOperator status insights +type ClusterOperatorUpdatingReason string const ( - ClusterOperatorStatusInsightUpdatingReasonUpdated ClusterOperatorStatusInsightUpdatingReason = "Updated" - ClusterOperatorStatusInsightUpdatingReasonPending ClusterOperatorStatusInsightUpdatingReason = "Pending" - ClusterOperatorStatusInsightUpdatingReasonProgressing ClusterOperatorStatusInsightUpdatingReason = "Progressing" - ClusterOperatorStatusInsightUpdatingReasonUnknownUpdate ClusterOperatorStatusInsightUpdatingReason = "UnclearClusterState" - ClusterOperatorStatusInsightUpdatingReasonUnknownVersion ClusterOperatorStatusInsightUpdatingReason = "UnknownVersion" + // Updated is used with Updating=False when the ClusterOperator finished updating + ClusterOperatorUpdatingReasonUpdated ClusterOperatorUpdatingReason = "Updated" + // Pending is used with Updating=False when the ClusterOperator is not updating and is still running previous version + ClusterOperatorUpdatingReasonPending ClusterOperatorUpdatingReason = "Pending" + // Progressing is used with Updating=True when the ClusterOperator is updating + ClusterOperatorUpdatingReasonProgressing ClusterOperatorUpdatingReason = "Progressing" + // CannotDetermine is used with Updating=Unknown + ClusterOperatorUpdatingCannotDetermine ClusterOperatorUpdatingReason = "CannotDetermine" ) -type ClusterOperatorStatusInsightHealthyReason string +// ClusterOperatorHealthyReason are well-known reasons for the Healthy condition on ClusterOperator status insights +type ClusterOperatorHealthyReason string const ( - ClusterOperatorUpdateStatusInsightHealthyReasonAllIsWell ClusterOperatorStatusInsightHealthyReason = "AllIsWell" - ClusterOperatorUpdateStatusInsightHealthyReasonUnavailable ClusterOperatorStatusInsightHealthyReason = "Unavailable" - ClusterOperatorUpdateStatusInsightHealthyReasonDegraded ClusterOperatorStatusInsightHealthyReason = "Degraded" - ClusterOperatorUpdateStatusInsightHealthyReasonMissingAvailable ClusterOperatorStatusInsightHealthyReason = "MissingAvailable" - ClusterOperatorUpdateStatusInsightHealthyReasonMissingDegraded ClusterOperatorStatusInsightHealthyReason = "MissingDegraded" + // AsExpected is used with Healthy=True when no issues are observed + ClusterOperatorHealthyReasonAsExpected ClusterOperatorHealthyReason = "AsExpected" + // Unavailable is used with Healthy=False when the ClusterOperator has Available=False condition + ClusterOperatorHealthyReasonUnavailable ClusterOperatorHealthyReason = "Unavailable" + // Degraded is used with Healthy=False when the ClusterOperator has Degraded=True condition + ClusterOperatorHealthyReasonDegraded ClusterOperatorHealthyReason = "Degraded" + // CannotDetermine is used with Healthy=Unknown + ClusterOperatorHealthyReasonCannotDetermine ClusterOperatorHealthyReason = "CannotDetermine" ) +// ClusterOperatorStatusInsight reports the state of a ClusterOperator resource (which represents a control plane +// component update in standalone clusters), during the update type ClusterOperatorStatusInsight struct { - // Name is the name of the operator + // name is the name of the operator + // +required Name string `json:"name"` - // Resource is the ClusterOperator resource that represents the operator + // resource is the ClusterOperator resource that represents the operator + // +required Resource ResourceRef `json:"resource"` - // Conditions provide details about the operator + // conditions provide details about the operator // +listType=map // +listMapKey=type + // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` } // PoolUpdateStatus contains a summary and insights related to a node pool update type PoolUpdateStatus struct { - // Name is the name of the pool + // name is the name of the pool + // +required Name string `json:"name"` - // Resource is the resource that represents the pool + // resource is the resource that represents the pool + // +required Resource PoolResourceRef `json:"resource"` - // Informers is a list of insight producers, each carries a list of insights + // informers is a list of insight producers, each carries a list of insights // +listType=map // +listMapKey=name + // +optional Informers []UpdateInformer `json:"informers,omitempty"` - // Conditions provide details about the pool + // conditions provide details about the pool // +listType=map // +listMapKey=type + // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` } +// PoolUpdateAssessment is the assessment of the node pool update process type PoolUpdateAssessment string const ( - PoolUpdateAssessmentPending PoolUpdateAssessment = "Pending" - PoolUpdateAssessmentCompleted PoolUpdateAssessment = "Completed" - PoolUpdateAssessmentDegraded PoolUpdateAssessment = "Degraded" - PoolUpdateAssessmentExcluded PoolUpdateAssessment = "Excluded" - PoolUpdateAssessmentProgressing PoolUpdateAssessment = "Progressing" + // Pending means the nodes in the pool will be updated but none have even started yet + PoolUpdatePending PoolUpdateAssessment = "Pending" + // Completed means all nodes in the pool have been updated + PoolUpdateCompleted PoolUpdateAssessment = "Completed" + // Degraded means the process of updating the pool suffers from an observed problem + PoolUpdateDegraded PoolUpdateAssessment = "Degraded" + // Excluded means some (or all) nodes in the pool would be normally updated but a configuration (such as paused MCP) + // prevents that from happening + PoolUpdateExcluded PoolUpdateAssessment = "Excluded" + // Progressing means the nodes in the pool are being updated and no problems or slowness are detected + PoolUpdateProgressing PoolUpdateAssessment = "Progressing" ) -type PoolNodesSummaryType string +// NodeSummaryType are types of summaries (how many nodes match certain criteria, such as updated, degraded, etc.) +// reported for a node pool +// +kubebuilder:validation:Enum=Total;Available;Progressing;Outdated;Draining;Excluded;Degraded +type NodeSummaryType string const ( - PoolNodesSummaryTypeTotal PoolNodesSummaryType = "Total" - PoolNodesSummaryTypeAvailable PoolNodesSummaryType = "Available" - PoolNodesSummaryTypeProgressing PoolNodesSummaryType = "Progressing" - PoolNodesSummaryTypeOutdated PoolNodesSummaryType = "Outdated" - PoolNodesSummaryTypeDraining PoolNodesSummaryType = "Draining" - PoolNodesSummaryTypeExcluded PoolNodesSummaryType = "Excluded" - PoolNodesSummaryTypeDegraded PoolNodesSummaryType = "Degraded" + // Total is the total number of nodes in the pool + NodesTotal NodeSummaryType = "Total" + // Available is the number of nodes in the pool that are available (accepting workloads) + NodesAvailable NodeSummaryType = "Available" + // Progressing is the number of nodes in the pool that are updating + NodesProgressing NodeSummaryType = "Progressing" + // Outdated is the number of nodes in the pool that are running an outdated version + NodesOutdated NodeSummaryType = "Outdated" + // Draining is the number of nodes in the pool that are being drained + NodesDraining NodeSummaryType = "Draining" + // Excluded is the number of nodes in the pool that would normally be updated but configuration (such as paused MCP) + // prevents that from happening + NodesExcluded NodeSummaryType = "Excluded" + // Degraded is the number of nodes in the pool that are degraded + NodesDegraded NodeSummaryType = "Degraded" ) -type PoolNodesUpdateSummary struct { - // Type is the type of the summary +// NodeSummary is a count of nodes matching certain criteria (e.g. updated, degraded, etc.) +type NodeSummary struct { + // type is the type of the summary // +required - // +kubebuilder:validation:Required - Type PoolNodesSummaryType `json:"type"` + // +kubebuilder:validation:Enum=Total;Available;Progressing;Outdated;Draining;Excluded;Degraded + Type NodeSummaryType `json:"type"` - // Count is the number of nodes matching the criteria - Count int32 `json:"count"` + // count is the number of nodes matching the criteria + // +required + // +kubebuilder:validation:Minimum=0 + Count uint8 `json:"count"` } +// ClusterVersionStatusInsight reports the state of a MachineConfigPool resource during the update type MachineConfigPoolStatusInsight struct { - // Name is the name of the machine config pool + // name is the name of the machine config pool + // +required Name string `json:"name"` - // Resource is the MachineConfigPool resource that represents the pool - Resource ResourceRef `json:"resource"` + // resource is the MachineConfigPool resource that represents the pool + // +required + Resource PoolResourceRef `json:"resource"` - // Scope describes whether the pool is a control plane or a worker pool + // scopeType describes whether the pool is a control plane or a worker pool + // +required + // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Scope ScopeType `json:"scopeType"` - // Assessment is the assessment of the machine config pool update process + // assessment is the assessment of the machine config pool update process + // +required Assessment PoolUpdateAssessment `json:"assessment"` - // Completion is a percentage of the update completion (0-100) - Completion int32 `json:"completion"` + // completion is a percentage of the update completion (0-100) + // +required + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 + Completion uint8 `json:"completion"` - // Summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.) + // summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.) // +listType=map // +listMapKey=type - Summaries []PoolNodesUpdateSummary `json:"summaries,omitempty"` + // +optional + Summaries []NodeSummary `json:"summaries,omitempty"` - // Conditions provide details about the machine config pool + // conditions provide details about the machine config pool update // +listType=map // +listMapKey=type + // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` } +// ClusterOperatorStatusInsightConditionType are types of conditions that can be reported on Node status insights type NodeStatusInsightConditionType string const ( - NodeStatusInsightConditionTypeUpdating NodeStatusInsightConditionType = "Updating" - NodeStatusInsightConditionTypeDegraded NodeStatusInsightConditionType = "Degraded" - NodeStatusInsightConditionTypeAvailable NodeStatusInsightConditionType = "Available" + // Updating condition communicates whether the Node is updating + NodeStatusInsightUpdating NodeStatusInsightConditionType = "Updating" + // Degraded condition communicates whether the Node is degraded (problem observed) + NodeStatusInsightDegraded NodeStatusInsightConditionType = "Degraded" + // Available condition communicates whether the Node is available (accepting workloads) + NodeStatusInsightAvailable NodeStatusInsightConditionType = "Available" ) -type NodeStatusInsightUpdatingReason string +// NodeStatusInsightUpdatingReason are well-known reasons for the Updating condition on Node status insights +type NodeUpdatingReason string const ( - // Updating=True reasons - - NodeStatusInsightUpdatingReasonDraining NodeStatusInsightUpdatingReason = "Draining" - NodeStatusInsightUpdatingReasonUpdating NodeStatusInsightUpdatingReason = "Updating" - NodeStatusInsightUpdatingReasonRebooting NodeStatusInsightUpdatingReason = "Rebooting" - - // Updating=False reasons - - NodeStatusInsightUpdatingReasonPaused NodeStatusInsightUpdatingReason = "Paused" - NodeStatusInsightUpdatingReasonPending NodeStatusInsightUpdatingReason = "Pending" - NodeStatusInsightUpdatingReasonCompleted NodeStatusInsightUpdatingReason = "Completed" + // Draining is used with Updating=True when the Node is being drained + NodeDraining NodeUpdatingReason = "Draining" + // Updating is used with Updating=True when new node configuration is being applied + NodeUpdating NodeUpdatingReason = "Updating" + // Rebooting is used with Updating=True when the Node is rebooting into the new version + NodeRebooting NodeUpdatingReason = "Rebooting" + + // Updated is used with Updating=False when the Node is prevented by configuration from updating + NodePaused NodeUpdatingReason = "Paused" + // Updated is used with Updating=False when the Node is waiting to be eventually updated + NodeUpdatePending NodeUpdatingReason = "Pending" + // Updated is used with Updating=False when the Node has been updated + NodeCompleted NodeUpdatingReason = "Completed" + + // CannotDetermine is used with Updating=Unknown + NodeCannotDetermine NodeUpdatingReason = "CannotDetermine" ) +// NodeStatusInsight reports the state of a Node during the update type NodeStatusInsight struct { - // Name is the name of the node + // name is the name of the node + // +required Name string `json:"name"` - // Resource is the Node resource that represents the node + // resource is the Node resource that represents the node + // +required Resource ResourceRef `json:"resource"` - // PoolResource is the resource that represents the pool the node is a member of + // poolResource is the resource that represents the pool the node is a member of + // +required PoolResource PoolResourceRef `json:"poolResource"` - // Version is the version of the node, when known + // version is the version of the node, when known + // +optional + // +kubebuilder:validation:Type=string Version string `json:"version,omitempty"` - // EstToComplete is the estimated time to complete the update, when known + // estToComplete is the estimated time to complete the update, when known + // +optional + // +kubebuilder:validation:Type=string EstToComplete metav1.Duration `json:"estToComplete,omitempty"` - // Message is a human-readable message about the node update status + // message is a short human-readable message about the node update status + // +optional Message string `json:"message,omitempty"` - // Conditions provides details about the control plane update + // conditions provides details about the control plane update // +listType=map // +listMapKey=type + // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` } +// UpdateInsightType identifies the type of the update insight as either one of the resource-specific status insight, +// or a generic health insight +// +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;UpdateHealth type UpdateInsightType string const ( - UpdateInsightTypeClusterVersionStatusInsight UpdateInsightType = "ClusterVersion" - UpdateInsightTypeClusterOperatorStatusInsight UpdateInsightType = "ClusterOperator" - UpdateInsightTypeMachineConfigPoolStatusInsight UpdateInsightType = "MachineConfigPool" - UpdateInsightTypeNodeStatusInsight UpdateInsightType = "Node" - UpdateInsightTypeUpdateHealthInsight UpdateInsightType = "UpdateHealth" + // Resource-specific status insights should be reported continuously during the update process and mostly communicate + // progress and high-level state + + // ClusterVersion status insight reports progress and high-level state of a ClusterVersion resource, representing + // control plane in standalone clusters + ClusterVersionStatusInsightType UpdateInsightType = "ClusterVersion" + // ClusterOperator status insight reports progress and high-level state of a ClusterOperator, representing a control + // plane component + ClusterOperatorStatusInsightType UpdateInsightType = "ClusterOperator" + // MachineConfigPool status insight reports progress and high-level state of a MachineConfigPool resource, representing + // a pool of nodes in clusters using Machine API + MachineConfigPoolStatusInsightType UpdateInsightType = "MachineConfigPool" + // Node status insight reports progress and high-level state of a Node resource, representing a node (both control + // plane and worker) in a cluster + NodeStatusInsightType UpdateInsightType = "Node" + + // Health insights are reported only when an informer observes a condition that requires admin attention + UpdateHealthInsightType UpdateInsightType = "UpdateHealth" ) type UpdateInsight struct { - // +unionDiscriminator - Type UpdateInsightType `json:"type"` - - // UID identifies an insight over time + // uid identifies the insight over time + // +required + // +kubebuilder:validation:Type=string UID string `json:"uid"` - // AcquiredAt is the time when the data was acquired by the producer - AcquiredAt metav1.Time `json:"acquisitionTime"` + // acquiredAt is the time when the data was acquired by the producer + // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time + AcquiredAt metav1.Time `json:"acquiredAt"` + + UpdateInsightUnion `json:",inline"` +} - // ClusterVersionStatusInsight is a status insight about the state of a control plane update, where +type UpdateInsightUnion struct { + // type identifies the type of the update insight + // +unionDiscriminator + // +required + // +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;UpdateHealth + Type UpdateInsightType `json:"type"` + + // clusterVersion is a status insight about the state of a control plane update, where // the control plane is represented by a ClusterVersion resource usually managed by CVO // +optional + // +unionMember ClusterVersionStatusInsight *ClusterVersionStatusInsight `json:"clusterVersion,omitempty"` - // ClusterOperatorStatusInsight is a status insight about the state of a control plane cluster operator update + // clusterOperator is a status insight about the state of a control plane cluster operator update // represented by a ClusterOperator resource // +optional + // +unionMember ClusterOperatorStatusInsight *ClusterOperatorStatusInsight `json:"clusterOperator,omitempty"` - // MachineConfigPoolStatusInsight is a status insight about the state of a worker pool update, where the worker pool + // machineConfigPool is a status insight about the state of a worker pool update, where the worker pool // is represented by a MachineConfigPool resource // +optional + // +unionMember MachineConfigPoolStatusInsight *MachineConfigPoolStatusInsight `json:"machineConfigPool,omitempty"` - // NodeStatusInsight is a status insight about the state of a worker node update, where the worker node is represented + // node is a status insight about the state of a worker node update, where the worker node is represented // by a Node resource // +optional + // +unionMember NodeStatusInsight *NodeStatusInsight `json:"node,omitempty"` - // UpdateHealthInsight is a generic health insight about the update. It does not represent a status of any specific + // health is a generic health insight about the update. It does not represent a status of any specific // resource but surfaces actionable information about the health of the cluster or an update // +optional + // +unionMember UpdateHealthInsight *UpdateHealthInsight `json:"health,omitempty"` } // UpdateHealthInsight is a piece of actionable information produced by an insight producer about the health // of the cluster or an update type UpdateHealthInsight struct { - // StartedAt is the time when the condition reported by the insight started + // startedAt is the time when the condition reported by the insight started + // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time StartedAt metav1.Time `json:"startedAt"` - // Scope is list of objects involved in the insight - // +optional - Scope UpdateInsightScope `json:"scope,omitempty"` + // scope is list of objects involved in the insight + // +required + Scope UpdateInsightScope `json:"scope"` - // Impact describes the impact the reported condition has on the cluster or update + // impact describes the impact the reported condition has on the cluster or update + // +required Impact UpdateInsightImpact `json:"impact"` - // Remediation contains ... TODO + // remediation contains information about how to resolve or prevent the reported condition Remediation UpdateInsightRemediation `json:"remediation"` } @@ -430,32 +616,36 @@ type UpdateHealthInsight struct { type ScopeType string const ( - ScopeTypeControlPlane ScopeType = "ControlPlane" - ScopeTypeWorkerPool ScopeType = "WorkerPool" + // ControlPlane is used for insights that are related to the control plane (including control plane pool or nodes) + ControlPlaneScope ScopeType = "ControlPlane" + // WorkerPool is used for insights that are related to a worker pools and nodes (excluding control plane) + WorkerPoolScope ScopeType = "WorkerPool" ) -// UpdateInsightScope is a list of objects involved in the insight +// UpdateInsightScope is a list of resources involved in the insight type UpdateInsightScope struct { - // Type is either ControlPlane or WorkerPool - // +kubebuilder:validation:Required + // type is either ControlPlane or WorkerPool + // +required + // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Type ScopeType `json:"type"` - // Resources is a list of resources involved in the insight + // resources is a list of resources involved in the insight // +optional Resources []ResourceRef `json:"resources,omitempty"` } -// ResourceRef is a reference to a kubernetes resource, typically involved in an -// insight +// ResourceRef is a reference to a kubernetes resource, typically involved in an insight type ResourceRef struct { - // Kind of object being referenced + // kind of object being referenced + // +required Kind string `json:"kind"` - // APIGroup of the object being referenced + // APIGroup of the object being referenced, if any // +optional APIGroup string `json:"apiGroup,omitempty"` // Name of the object being referenced + // +required Name string `json:"name"` // Namespace of the object being referenced, if any @@ -464,21 +654,23 @@ type ResourceRef struct { } // InsightImpactLevel describes the severity of the impact the reported condition has on the cluster or update -// +kubebuilder:validation:Enum=info;warning;error;critical +// +kubebuilder:validation:Enum=unknown;info;warning;error;critical type InsightImpactLevel string const ( - // InfoImpactLevel should be used for insights that are strictly informational or even positive (things go well or + // UnknownImpactLevel is used when the impact level is not known + UnknownImpactLevel InsightImpactLevel = "unknown" + // info should be used for insights that are strictly informational or even positive (things go well or // something recently healed) InfoImpactLevel InsightImpactLevel = "info" - // WarningImpactLevel should be used for insights that explain a minor or transient problem. Anything that requires + // warning should be used for insights that explain a minor or transient problem. Anything that requires // admin attention or manual action should not be a warning but at least an error. WarningImpactLevel InsightImpactLevel = "warning" - // ErrorImpactLevel should be used for insights that inform about a problem that requires admin attention. Insights of + // error should be used for insights that inform about a problem that requires admin attention. Insights of // level error and higher should be as actionable as possible, and should be accompanied by links to documentation, // KB articles or other resources that help the admin to resolve the problem. ErrorImpactLevel InsightImpactLevel = "error" - // CriticalInfoLevel should be used rarely, for insights that inform about a severe problem, threatening with data + // critical should be used rarely, for insights that inform about a severe problem, threatening with data // loss, destroyed cluster or other catastrophic consequences. Insights of this level should be accompanied by // links to documentation, KB articles or other resources that help the admin to resolve the problem, or at least // prevent the severe consequences from happening. @@ -503,30 +695,43 @@ const ( // UpdateInsightImpact describes the impact the reported condition has on the cluster or update type UpdateInsightImpact struct { - // Level is the severity of the impact + // level is the severity of the impact + // +required + // +kubebuilder:validation:Enum=unknown;info;warning;error;critical Level InsightImpactLevel `json:"level"` - // Type is the type of the impact + // type is the type of the impact + // +required + // +kubebuilder:validation:Enum=None;Unknown;API Availability;Cluster Capacity;Application Availability;Application Outage;Data Loss;Update Speed;Update Stalled Type InsightImpactType `json:"type"` - // Summary is a short summary of the impact + // summary is a short summary of the impact + // +required + // +kubebuilder:validation:Type=string Summary string `json:"summary"` - // Description is a human-oriented description of the condition reported by the insight + // description is a human-oriented, possibly longer-form description of the condition reported by the insight + // +optional + // +kubebuilder:validation:Type=string Description string `json:"description"` } -// UpdateInsightRemediation contains ... TODO +// UpdateInsightRemediation contains information about how to resolve or prevent the reported condition type UpdateInsightRemediation struct { - // Reference is a URL where administrators can find information to resolve or prevent the reported condition + // reference is a URL where administrators can find information to resolve or prevent the reported condition + // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=uri Reference string `json:"reference"` - // EstimatedFinish is the estimated time when the informer expects the condition to be resolved, if applicable. - // This should normally only be provided by system level insights (impact level=status) + // estimatedFinish is the estimated time when the informer expects the condition to be resolved, if applicable. + // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time EstimatedFinish metav1.Time `json:"estimatedFinish"` } -// PoolResourceRef is a reference to a kubernetes resource that represents a worker pool +// PoolResourceRef is a reference to a kubernetes resource that represents a node pool type PoolResourceRef struct { ResourceRef `json:",inline"` } From ab2134849a5045ba8c4cb4d3640c9d599f5c3323 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 8 Oct 2024 18:21:49 +0200 Subject: [PATCH 10/45] status: try to remove deprecated items? --- update/v1alpha1/register.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/update/v1alpha1/register.go b/update/v1alpha1/register.go index 562ec59e19a..76eecf2b124 100644 --- a/update/v1alpha1/register.go +++ b/update/v1alpha1/register.go @@ -12,21 +12,8 @@ var ( 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, From 15af87933ce83a1f6ca18e68c9ee287dae661d72 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 8 Oct 2024 19:15:12 +0200 Subject: [PATCH 11/45] status: address minor review feedback --- update/v1alpha1/types_update_status.go | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 0787f22077b..d26ca441b54 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -5,8 +5,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// UpdateStatus is the API about in-progress updates, kept populated by Update Status Controller by -// aggregating and summarizing UpdateInsights produced by update informers +// UpdateStatus reports status for in-progress cluster version updates // // Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. // +openshift:compatibility-gen:level=4 @@ -14,7 +13,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +kubebuilder:subresource:status // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:path=updatestatuses,scope=Namespaced -// +openshift:api-approved.openshift.io=TODO +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2012 // +openshift:file-pattern=cvoRunLevel=0000_00,operatorName=cluster-version-operator,operatorOrdering=02 // +openshift:enable:FeatureGate=UpgradeStatus // +kubebuilder:metadata:annotations="description=Provides health and status information about OpenShift cluster updates." @@ -81,12 +80,12 @@ const ( // ControlPlaneUpdateStatus contains a summary and insights related to the control plane update type ControlPlaneUpdateStatus struct { // resource is the resource that represents the control plane. It will typically be a ClusterVersion resource - // in standalone OpenShift and HostedCluster in HCP. + // in standalone OpenShift and HostedCluster in Hosted Control Planes. // +required Resource ResourceRef `json:"resource"` // poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field - // is optional because some form factors (like HCP) do not have dedicated control plane node pools. + // is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools. // +optional PoolResource PoolResourceRef `json:"poolResource,omitempty"` @@ -156,7 +155,6 @@ type VersionMetadataType string const ( StringVersionMetadata VersionMetadataType = "string" BoolVersionMetadata VersionMetadataType = "bool" - IntVersionMetadata VersionMetadataType = "int" ) type VersionMetadataKey string @@ -183,7 +181,7 @@ type VersionMetadata struct { type VersionMetadataValue struct { // +unionDiscriminator // +required - // +kubebuilder:validation:Enum:string;bool;int + // +kubebuilder:validation:Enum:string;bool Type VersionMetadataType `json:"type"` // +optional @@ -195,11 +193,6 @@ type VersionMetadataValue struct { // +kubebuilder:validation:Type=bool // +unionMember Bool bool `json:"bool,omitempty"` - - // +optional - // +kubebuilder:validation:Type=int - // +unionMember - Integer int `json:"integer,omitempty"` } // Version describes a version involved in an update, typically on one side of an update edge From b1c2c71cd6e33d6469e2337b1d2ddfd1487130a1 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 8 Oct 2024 19:16:52 +0200 Subject: [PATCH 12/45] status: use omitemtpy/required consistently --- update/v1alpha1/types_update_status.go | 29 +++++++++++++++----------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index d26ca441b54..cfb436fa36d 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -26,7 +26,7 @@ type UpdateStatus struct { // +required Spec UpdateStatusSpec `json:"spec"` // +optional - Status UpdateStatusStatus `json:"status,omitempty"` + Status UpdateStatusStatus `json:"status"` } // UpdateStatusSpec is empty for now, can possibly hold configuration for Update Status Controller in the future @@ -39,10 +39,12 @@ type UpdateStatusSpec struct { // aggregating and summarizing UpdateInsights produced by update informers type UpdateStatusStatus struct { // controlPlane contains a summary and insights related to the control plane update + // +required ControlPlane ControlPlaneUpdateStatus `json:"controlPlane"` // workerPools contains summaries and insights related to the worker pools update - WorkerPools []PoolUpdateStatus `json:"workerPools"` + // +optional + WorkerPools []PoolUpdateStatus `json:"workerPools,omitempty"` // conditions provide details about Update Status Controller operational matters // +listType=map @@ -87,7 +89,7 @@ type ControlPlaneUpdateStatus struct { // poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field // is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools. // +optional - PoolResource PoolResourceRef `json:"poolResource,omitempty"` + PoolResource *PoolResourceRef `json:"poolResource,omitempty"` // informers is a list of insight producers, each carries a list of insights relevant for control plane // +listType=map @@ -197,7 +199,8 @@ type VersionMetadataValue struct { // Version describes a version involved in an update, typically on one side of an update edge type Version struct { - // version is a semantic version string + // version is a semantic version string, or a placeholder '' for the special case where this + // is a "previous" version in a new installation // +required Version string `json:"version,omitempty"` @@ -210,9 +213,11 @@ type Version struct { // ControlPlaneUpdateVersions contains the original and target versions of the upgrade type ControlPlaneUpdateVersions struct { - // previous is the version of the control plane before the update - // +optional - Previous Version `json:"previous,omitempty"` + // previous is the version of the control plane before the update. When the cluster is being installed + // for the first time, the version will have a placeholder value like '' and the target version + // will have a boolean installation=true metadata + // +required + Previous Version `json:"previous"` // target is the version of the control plane after the update // +required @@ -250,13 +255,13 @@ type ClusterVersionStatusInsight struct { // +optional // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time - CompletedAt metav1.Time `json:"completedAt,omitempty"` + CompletedAt *metav1.Time `json:"completedAt,omitempty"` // estimatedCompletedAt is the estimated time when the update will complete // +optional // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time - EstimatedCompletedAt metav1.Time `json:"estimatedCompletedAt,omitempty"` + EstimatedCompletedAt *metav1.Time `json:"estimatedCompletedAt,omitempty"` // Conditions provides details about the control plane update // +listType=map @@ -491,7 +496,7 @@ type NodeStatusInsight struct { // estToComplete is the estimated time to complete the update, when known // +optional // +kubebuilder:validation:Type=string - EstToComplete metav1.Duration `json:"estToComplete,omitempty"` + EstToComplete *metav1.Duration `json:"estToComplete,omitempty"` // message is a short human-readable message about the node update status // +optional @@ -706,7 +711,7 @@ type UpdateInsightImpact struct { // description is a human-oriented, possibly longer-form description of the condition reported by the insight // +optional // +kubebuilder:validation:Type=string - Description string `json:"description"` + Description string `json:"description,omitempty"` } // UpdateInsightRemediation contains information about how to resolve or prevent the reported condition @@ -721,7 +726,7 @@ type UpdateInsightRemediation struct { // +optional // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time - EstimatedFinish metav1.Time `json:"estimatedFinish"` + EstimatedFinish *metav1.Time `json:"estimatedFinish,omitempty"` } // PoolResourceRef is a reference to a kubernetes resource that represents a node pool From 180ddbef3ef6f7c0bac73713f891509f26a702df Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 8 Oct 2024 19:17:14 +0200 Subject: [PATCH 13/45] status: add some missing `list` annotations --- update/v1alpha1/types_update_status.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index cfb436fa36d..db06622cabb 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -43,6 +43,8 @@ type UpdateStatusStatus struct { ControlPlane ControlPlaneUpdateStatus `json:"controlPlane"` // workerPools contains summaries and insights related to the worker pools update + // +listType=map + // +listMapKey=name // +optional WorkerPools []PoolUpdateStatus `json:"workerPools,omitempty"` @@ -113,6 +115,8 @@ type UpdateInformer struct { // Insights is a list of insights produced by this producer // +optional + // +listType=map + // +listMapKey=uid Insights []UpdateInsight `json:"insights,omitempty"` } @@ -629,6 +633,7 @@ type UpdateInsightScope struct { // resources is a list of resources involved in the insight // +optional + // +listType=set Resources []ResourceRef `json:"resources,omitempty"` } From 05ff06ec338c9760739ebb025d00c148aec2d747 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Wed, 9 Oct 2024 14:37:19 +0200 Subject: [PATCH 14/45] status: add minimal tests Generated with: ``` ./tests/hack/gen-minimal-test.sh update/v1alpha1 v1alpha1 ``` --- .../UpgradeStatus.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml diff --git a/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml b/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml new file mode 100644 index 00000000000..f95404c988b --- /dev/null +++ b/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml @@ -0,0 +1,15 @@ +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this +name: "UpdateStatus" +crdName: updatestatuses.update.openshift.io +featureGate: UpgradeStatus +tests: + onCreate: + - name: Should be able to create a minimal UpdateStatus + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} # No spec is required for a UpdateStatus + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} From cda015556e7ee6cb52211f53674bee95a9c83fff Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Mon, 14 Oct 2024 16:31:11 +0200 Subject: [PATCH 15/45] status: minor fixes for conventions - Use `+kubebuilder:validation:Required` consistently (not `+required`) - Do not mention (assume) underlying controller name - Integers use `int32` types with enforced bounds - Constants are `PascalNames` by convention - GoDoc start by JSON name by convention - Other GoDoc description tweaks --- update/v1alpha1/types_update_status.go | 141 +++++++++++++------------ 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index db06622cabb..8dce7870054 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -22,24 +22,26 @@ type UpdateStatus struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` + // spec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold + // configuration to drive what information is surfaced and how // +kubebuilder:validation:Required - // +required Spec UpdateStatusSpec `json:"spec"` // +optional Status UpdateStatusStatus `json:"status"` } -// UpdateStatusSpec is empty for now, can possibly hold configuration for Update Status Controller in the future +// UpdateStatusSpec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used +// to hold configuration to drive what information is surfaced and how type UpdateStatusSpec struct { } // +k8s:deepcopy-gen=true -// UpdateStatusStatus is the API about in-progress updates, kept populated by Update Status Controller by -// aggregating and summarizing UpdateInsights produced by update informers +// UpdateStatusStatus is the API about in-progress updates. It aggregates and summarizes UpdateInsights produced by +// update informers type UpdateStatusStatus struct { // controlPlane contains a summary and insights related to the control plane update - // +required + // +kubebuilder:validation:Required ControlPlane ControlPlaneUpdateStatus `json:"controlPlane"` // workerPools contains summaries and insights related to the worker pools update @@ -48,7 +50,7 @@ type UpdateStatusStatus struct { // +optional WorkerPools []PoolUpdateStatus `json:"workerPools,omitempty"` - // conditions provide details about Update Status Controller operational matters + // conditions provide details about the controller operational matters // +listType=map // +listMapKey=type // +optional @@ -59,8 +61,7 @@ type UpdateStatusStatus struct { type ControlPlaneConditionType string const ( - // ControlPlaneUpdating is the condition type that communicate whether the whole control plane is updating - // or not + // Updating is the condition type that communicate whether the whole control plane is updating or not ControlPlaneUpdating ControlPlaneConditionType = "Updating" ) @@ -69,13 +70,13 @@ const ( type ControlPlaneUpdatingReason string const ( - // ReasonClusterVersionProgressing is used for Updating=True set because we observed a ClusterVersion resource to + // ClusterVersionProgressing is used for Updating=True set because we observed a ClusterVersion resource to // have Progressing=True condition ReasonClusterVersionProgressing ControlPlaneUpdatingReason = "ClusterVersionProgressing" - // ReasonClusterVersionNotProgressing is used for Updating=False set because we observed a ClusterVersion resource to + // ClusterVersionNotProgressing is used for Updating=False set because we observed a ClusterVersion resource to // have Progressing=False condition ReasonClusterVersionNotProgressing ControlPlaneUpdatingReason = "ClusterVersionNotProgressing" - // ReasonClusterVersionCannotDetermine is used for Updating=Unknown. This covers many different actual reasons such as + // CannotDetermineUpdating is used with Updating=Unknown. This covers many different actual reasons such as // missing or Unknown Progressing condition on ClusterVersion, but it does not seem useful to track the individual // reasons to that granularity for Updating=Unknown ReasonClusterVersionCannotDetermine ControlPlaneUpdatingReason = "CannotDetermineUpdating" @@ -85,7 +86,7 @@ const ( type ControlPlaneUpdateStatus struct { // resource is the resource that represents the control plane. It will typically be a ClusterVersion resource // in standalone OpenShift and HostedCluster in Hosted Control Planes. - // +required + // +kubebuilder:validation:Required Resource ResourceRef `json:"resource"` // poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field @@ -108,12 +109,11 @@ type ControlPlaneUpdateStatus struct { // UpdateInformer is an insight producer identified by a name, carrying a list of insights it produced type UpdateInformer struct { - // Name is the name of the insight producer - // +required + // name is the name of the insight producer // +kubebuilder:validation:Required Name string `json:"name"` - // Insights is a list of insights produced by this producer + // insights is a list of insights produced by this producer // +optional // +listType=map // +listMapKey=uid @@ -155,12 +155,12 @@ const ( ) // VersionMetadataType is the type of the metadata value -// +kubebuilder:validation:Enum=string;bool;int +// +kubebuilder:validation:Enum=String;Bool type VersionMetadataType string const ( - StringVersionMetadata VersionMetadataType = "string" - BoolVersionMetadata VersionMetadataType = "bool" + StringVersionMetadata VersionMetadataType = "String" + BoolVersionMetadata VersionMetadataType = "Bool" ) type VersionMetadataKey string @@ -177,17 +177,18 @@ const ( ) type VersionMetadata struct { - // +required + // key is the name of this metadata value + // +kubebuilder:validation:Required Key VersionMetadataKey `json:"key"` - // +required + // +kubebuilder:validation:Required VersionMetadataValue `json:",inline"` } type VersionMetadataValue struct { // +unionDiscriminator - // +required - // +kubebuilder:validation:Enum:string;bool + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum:String;Bool Type VersionMetadataType `json:"type"` // +optional @@ -205,7 +206,7 @@ type VersionMetadataValue struct { type Version struct { // version is a semantic version string, or a placeholder '' for the special case where this // is a "previous" version in a new installation - // +required + // +kubebuilder:validation:Required Version string `json:"version,omitempty"` // metadata is a list of metadata associated with the version @@ -220,11 +221,11 @@ type ControlPlaneUpdateVersions struct { // previous is the version of the control plane before the update. When the cluster is being installed // for the first time, the version will have a placeholder value like '' and the target version // will have a boolean installation=true metadata - // +required + // +kubebuilder:validation:Required Previous Version `json:"previous"` // target is the version of the control plane after the update - // +required + // +kubebuilder:validation:Required Target Version `json:"target"` } @@ -232,25 +233,25 @@ type ControlPlaneUpdateVersions struct { // update in standalone clusters), during the update. type ClusterVersionStatusInsight struct { // resource is the ClusterVersion resource that represents the control plane - // +required + // +kubebuilder:validation:Required Resource ResourceRef `json:"resource"` // assessment is the assessment of the control plane update process - // +required + // +kubebuilder:validation:Required Assessment ControlPlaneAssessment `json:"assessment"` // versions contains the original and target versions of the upgrade - // +required + // +kubebuilder:validation:Required Versions ControlPlaneUpdateVersions `json:"versions"` // completion is a percentage of the update completion (0-100) - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 - Completion uint8 `json:"completion"` + Completion int32 `json:"completion"` // startedAt is the time when the update started - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time StartedAt metav1.Time `json:"startedAt"` @@ -267,7 +268,7 @@ type ClusterVersionStatusInsight struct { // +kubebuilder:validation:Format=date-time EstimatedCompletedAt *metav1.Time `json:"estimatedCompletedAt,omitempty"` - // Conditions provides details about the control plane update + // conditions provides detailed observed conditions about ClusterVersion // +listType=map // +listMapKey=type // +optional @@ -316,11 +317,11 @@ const ( // component update in standalone clusters), during the update type ClusterOperatorStatusInsight struct { // name is the name of the operator - // +required + // +kubebuilder:validation:Required Name string `json:"name"` // resource is the ClusterOperator resource that represents the operator - // +required + // +kubebuilder:validation:Required Resource ResourceRef `json:"resource"` // conditions provide details about the operator @@ -333,11 +334,11 @@ type ClusterOperatorStatusInsight struct { // PoolUpdateStatus contains a summary and insights related to a node pool update type PoolUpdateStatus struct { // name is the name of the pool - // +required + // +kubebuilder:validation:Required Name string `json:"name"` // resource is the resource that represents the pool - // +required + // +kubebuilder:validation:Required Resource PoolResourceRef `json:"resource"` // informers is a list of insight producers, each carries a list of insights @@ -396,40 +397,40 @@ const ( // NodeSummary is a count of nodes matching certain criteria (e.g. updated, degraded, etc.) type NodeSummary struct { // type is the type of the summary - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Enum=Total;Available;Progressing;Outdated;Draining;Excluded;Degraded Type NodeSummaryType `json:"type"` // count is the number of nodes matching the criteria - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Minimum=0 - Count uint8 `json:"count"` + Count int32 `json:"count"` } // ClusterVersionStatusInsight reports the state of a MachineConfigPool resource during the update type MachineConfigPoolStatusInsight struct { // name is the name of the machine config pool - // +required + // +kubebuilder:validation:Required Name string `json:"name"` // resource is the MachineConfigPool resource that represents the pool - // +required + // +kubebuilder:validation:Required Resource PoolResourceRef `json:"resource"` // scopeType describes whether the pool is a control plane or a worker pool - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Scope ScopeType `json:"scopeType"` // assessment is the assessment of the machine config pool update process - // +required + // +kubebuilder:validation:Required Assessment PoolUpdateAssessment `json:"assessment"` // completion is a percentage of the update completion (0-100) - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 - Completion uint8 `json:"completion"` + Completion int32 `json:"completion"` // summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.) // +listType=map @@ -444,7 +445,7 @@ type MachineConfigPoolStatusInsight struct { Conditions []metav1.Condition `json:"conditions,omitempty"` } -// ClusterOperatorStatusInsightConditionType are types of conditions that can be reported on Node status insights +// NodeStatusInsightConditionType are types of conditions that can be reported on Node status insights type NodeStatusInsightConditionType string const ( @@ -456,7 +457,7 @@ const ( NodeStatusInsightAvailable NodeStatusInsightConditionType = "Available" ) -// NodeStatusInsightUpdatingReason are well-known reasons for the Updating condition on Node status insights +// NodeUpdatingReason are well-known reasons for the Updating condition on Node status insights type NodeUpdatingReason string const ( @@ -481,15 +482,15 @@ const ( // NodeStatusInsight reports the state of a Node during the update type NodeStatusInsight struct { // name is the name of the node - // +required + // +kubebuilder:validation:Required Name string `json:"name"` // resource is the Node resource that represents the node - // +required + // +kubebuilder:validation:Required Resource ResourceRef `json:"resource"` // poolResource is the resource that represents the pool the node is a member of - // +required + // +kubebuilder:validation:Required PoolResource PoolResourceRef `json:"poolResource"` // version is the version of the node, when known @@ -541,12 +542,12 @@ const ( type UpdateInsight struct { // uid identifies the insight over time - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Type=string UID string `json:"uid"` // acquiredAt is the time when the data was acquired by the producer - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time AcquiredAt metav1.Time `json:"acquiredAt"` @@ -557,7 +558,7 @@ type UpdateInsight struct { type UpdateInsightUnion struct { // type identifies the type of the update insight // +unionDiscriminator - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;UpdateHealth Type UpdateInsightType `json:"type"` @@ -596,17 +597,17 @@ type UpdateInsightUnion struct { // of the cluster or an update type UpdateHealthInsight struct { // startedAt is the time when the condition reported by the insight started - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time StartedAt metav1.Time `json:"startedAt"` // scope is list of objects involved in the insight - // +required + // +kubebuilder:validation:Required Scope UpdateInsightScope `json:"scope"` // impact describes the impact the reported condition has on the cluster or update - // +required + // +kubebuilder:validation:Required Impact UpdateInsightImpact `json:"impact"` // remediation contains information about how to resolve or prevent the reported condition @@ -627,7 +628,7 @@ const ( // UpdateInsightScope is a list of resources involved in the insight type UpdateInsightScope struct { // type is either ControlPlane or WorkerPool - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Type ScopeType `json:"type"` @@ -640,7 +641,7 @@ type UpdateInsightScope struct { // ResourceRef is a reference to a kubernetes resource, typically involved in an insight type ResourceRef struct { // kind of object being referenced - // +required + // +kubebuilder:validation:Required Kind string `json:"kind"` // APIGroup of the object being referenced, if any @@ -648,7 +649,7 @@ type ResourceRef struct { APIGroup string `json:"apiGroup,omitempty"` // Name of the object being referenced - // +required + // +kubebuilder:validation:Required Name string `json:"name"` // Namespace of the object being referenced, if any @@ -657,27 +658,27 @@ type ResourceRef struct { } // InsightImpactLevel describes the severity of the impact the reported condition has on the cluster or update -// +kubebuilder:validation:Enum=unknown;info;warning;error;critical +// +kubebuilder:validation:Enum=Unknown;Info;Warning;Error;Critical type InsightImpactLevel string const ( // UnknownImpactLevel is used when the impact level is not known - UnknownImpactLevel InsightImpactLevel = "unknown" + UnknownImpactLevel InsightImpactLevel = "Unknown" // info should be used for insights that are strictly informational or even positive (things go well or // something recently healed) - InfoImpactLevel InsightImpactLevel = "info" + InfoImpactLevel InsightImpactLevel = "Info" // warning should be used for insights that explain a minor or transient problem. Anything that requires // admin attention or manual action should not be a warning but at least an error. - WarningImpactLevel InsightImpactLevel = "warning" + WarningImpactLevel InsightImpactLevel = "Warning" // error should be used for insights that inform about a problem that requires admin attention. Insights of // level error and higher should be as actionable as possible, and should be accompanied by links to documentation, // KB articles or other resources that help the admin to resolve the problem. - ErrorImpactLevel InsightImpactLevel = "error" + ErrorImpactLevel InsightImpactLevel = "Error" // critical should be used rarely, for insights that inform about a severe problem, threatening with data // loss, destroyed cluster or other catastrophic consequences. Insights of this level should be accompanied by // links to documentation, KB articles or other resources that help the admin to resolve the problem, or at least // prevent the severe consequences from happening. - CriticalInfoLevel InsightImpactLevel = "critical" + CriticalInfoLevel InsightImpactLevel = "Critical" ) // InsightImpactType describes the type of the impact the reported condition has on the cluster or update @@ -699,17 +700,17 @@ const ( // UpdateInsightImpact describes the impact the reported condition has on the cluster or update type UpdateInsightImpact struct { // level is the severity of the impact - // +required - // +kubebuilder:validation:Enum=unknown;info;warning;error;critical + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=Unknown;Info;Warning;Error;Critical Level InsightImpactLevel `json:"level"` // type is the type of the impact - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Enum=None;Unknown;API Availability;Cluster Capacity;Application Availability;Application Outage;Data Loss;Update Speed;Update Stalled Type InsightImpactType `json:"type"` // summary is a short summary of the impact - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Type=string Summary string `json:"summary"` @@ -722,7 +723,7 @@ type UpdateInsightImpact struct { // UpdateInsightRemediation contains information about how to resolve or prevent the reported condition type UpdateInsightRemediation struct { // reference is a URL where administrators can find information to resolve or prevent the reported condition - // +required + // +kubebuilder:validation:Required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=uri Reference string `json:"reference"` From 855f66361d6ef49ba63f8643401f5064b8b0f8f2 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Mon, 14 Oct 2024 17:15:59 +0200 Subject: [PATCH 16/45] status: use resource names instead of kind Make the `ResourceRef` type follow [OpenShift API conventions](https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md#use-resource-name-rather-than-kind-in-object-references). I also considered to follow the ["Use Specific Types for Object Reference"](https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md#use-specific-types-for-object-references-and-omit-ref-suffix) more strictly and introduce speficic types instead using `ResourceRef` everywhere but consistency felt much worse (control plane would need ClusterVersion/HostedCluster reference, status insights would need just names, pool references would need MCP/NodePool but not in control plane...). Consistency is also a value, and because we use resource references at different places, it felt better to stay consistent everywhere. --- update/v1alpha1/types_update_status.go | 58 ++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 8dce7870054..4bb62250dd0 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -86,11 +86,21 @@ const ( type ControlPlaneUpdateStatus struct { // resource is the resource that represents the control plane. It will typically be a ClusterVersion resource // in standalone OpenShift and HostedCluster in Hosted Control Planes. + // + // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + // only the "correct" resource types to be referenced (here, ClusterVersion and HostedCluster). However, because we + // use resource references in many places and this API is intended to be consumed by clients, not produced, consistency + // seems to be more valuable than type safety for producers. // +kubebuilder:validation:Required Resource ResourceRef `json:"resource"` // poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field // is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools. + // + // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + // only the "correct" resource types to be referenced (here, MachineConfigPool). However, because we use resource + // references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be + // more valuable than type safety for producers. // +optional PoolResource *PoolResourceRef `json:"poolResource,omitempty"` @@ -233,6 +243,11 @@ type ControlPlaneUpdateVersions struct { // update in standalone clusters), during the update. type ClusterVersionStatusInsight struct { // resource is the ClusterVersion resource that represents the control plane + // + // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + // resource name (because the rest is implied by status insight type). However, because we use resource references in + // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + // than type safety for producers. // +kubebuilder:validation:Required Resource ResourceRef `json:"resource"` @@ -321,6 +336,11 @@ type ClusterOperatorStatusInsight struct { Name string `json:"name"` // resource is the ClusterOperator resource that represents the operator + // + // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + // resource name (because the rest is implied by status insight type). However, because we use resource references in + // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + // than type safety for producers. // +kubebuilder:validation:Required Resource ResourceRef `json:"resource"` @@ -338,6 +358,11 @@ type PoolUpdateStatus struct { Name string `json:"name"` // resource is the resource that represents the pool + // + // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + // only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + // resource references in many places and this API is intended to be consumed by clients, not produced, consistency + // seems to be more valuable than type safety for producers. // +kubebuilder:validation:Required Resource PoolResourceRef `json:"resource"` @@ -414,6 +439,11 @@ type MachineConfigPoolStatusInsight struct { Name string `json:"name"` // resource is the MachineConfigPool resource that represents the pool + // + // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + // resource name (because the rest is implied by status insight type). However, because we use resource references in + // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + // than type safety for producers. // +kubebuilder:validation:Required Resource PoolResourceRef `json:"resource"` @@ -486,10 +516,20 @@ type NodeStatusInsight struct { Name string `json:"name"` // resource is the Node resource that represents the node + // + // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + // resource name (because the rest is implied by status insight type). However, because we use resource references in + // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + // than type safety for producers. // +kubebuilder:validation:Required Resource ResourceRef `json:"resource"` // poolResource is the resource that represents the pool the node is a member of + // + // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + // only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + // resource references in many places and this API is intended to be consumed by clients, not produced, consistency + // seems to be more valuable than type safety for producers. // +kubebuilder:validation:Required PoolResource PoolResourceRef `json:"poolResource"` @@ -632,7 +672,7 @@ type UpdateInsightScope struct { // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Type ScopeType `json:"type"` - // resources is a list of resources involved in the insight + // resources is a list of resources involved in the insight, of any group/kind // +optional // +listType=set Resources []ResourceRef `json:"resources,omitempty"` @@ -640,19 +680,19 @@ type UpdateInsightScope struct { // ResourceRef is a reference to a kubernetes resource, typically involved in an insight type ResourceRef struct { - // kind of object being referenced - // +kubebuilder:validation:Required - Kind string `json:"kind"` - - // APIGroup of the object being referenced, if any + // group of the object being referenced, if any // +optional - APIGroup string `json:"apiGroup,omitempty"` + Group string `json:"group,omitempty"` + + // resource of object being referenced + // +kubebuilder:validation:Required + Resource string `json:"resource"` - // Name of the object being referenced + // name of the object being referenced // +kubebuilder:validation:Required Name string `json:"name"` - // Namespace of the object being referenced, if any + // namespace of the object being referenced, if any // +optional Namespace string `json:"namespace,omitempty"` } From 9fb4ab3b6d59376bc5f29f268f533bdf8f070bce Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Mon, 14 Oct 2024 17:49:10 +0200 Subject: [PATCH 17/45] status: fix `Unsupported value: "bool"` --- update/v1alpha1/types_update_status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 4bb62250dd0..3eb9bc5bb5c 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -207,7 +207,7 @@ type VersionMetadataValue struct { String string `json:"string,omitempty"` // +optional - // +kubebuilder:validation:Type=bool + // +kubebuilder:validation:Type=boolean // +unionMember Bool bool `json:"bool,omitempty"` } From 35085bba2e5486cbc025843f6da291f2babc9cba Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Mon, 14 Oct 2024 18:25:01 +0200 Subject: [PATCH 18/45] status: use listType=atomic for scope.resources CI enforces the presence of listType annotations on slices. List of resources is not a set, because resources are not scalars. It is not simple map because resource does not have a suitable key field. So it must be atomic I guess? --- update/v1alpha1/types_update_status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 3eb9bc5bb5c..f4ac8e1e19b 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -674,7 +674,7 @@ type UpdateInsightScope struct { // resources is a list of resources involved in the insight, of any group/kind // +optional - // +listType=set + // +listType=atomic Resources []ResourceRef `json:"resources,omitempty"` } From 12aefa61147e550f6d171aa794db9b1c27d6c72e Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Mon, 14 Oct 2024 18:48:01 +0200 Subject: [PATCH 19/45] status: simplify version metadata OpenShift API convention forbids bool usage and enforces this with CI. While I could argue for an exception (reasoning behind the convention does not apply in this case, as it would be easy to migrate from bools to strings if necessary), we can also simplify the API and make the metadata a simple key->value map, similar to `labels`. Value is optional and with empty value the presence of the key has a boolean=true semantics. It simplifies the API and possibly even improves the usability for clients. --- update/v1alpha1/types_update_status.go | 48 ++++++++------------------ 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index f4ac8e1e19b..72224f7ac21 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -164,52 +164,31 @@ const ( ClusterVersionNotProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionNotProgressing" ) -// VersionMetadataType is the type of the metadata value -// +kubebuilder:validation:Enum=String;Bool -type VersionMetadataType string - -const ( - StringVersionMetadata VersionMetadataType = "String" - BoolVersionMetadata VersionMetadataType = "Bool" -) - +// VersionMetadataKey is a key for a metadata value associated with a version +// +kubebuilder:validation:Enum=Installation;Partial;Architecture type VersionMetadataKey string const ( - // installation denotes a boolean that indicates the update was initiated as an installation - InstallationMetadata VersionMetadataKey = "installation" - // partial denotes a boolean that indicates the update was initiated in a state where the previous upgrade + // Installation denotes a boolean that indicates the update was initiated as an installation + InstallationMetadata VersionMetadataKey = "Installation" + // Partial denotes a boolean that indicates the update was initiated in a state where the previous upgrade // (to the original version) was not fully completed - PartialMetadata VersionMetadataKey = "partial" - // architecture denotes a string that indicates the architecture of the payload image of the version, + PartialMetadata VersionMetadataKey = "Partial" + // Architecture denotes a string that indicates the architecture of the payload image of the version, // when relevant - ArchitectureMetadata VersionMetadataKey = "architecture" + ArchitectureMetadata VersionMetadataKey = "Architecture" ) type VersionMetadata struct { // key is the name of this metadata value // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=installation;partial;architecture Key VersionMetadataKey `json:"key"` - // +kubebuilder:validation:Required - VersionMetadataValue `json:",inline"` -} - -type VersionMetadataValue struct { - // +unionDiscriminator - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum:String;Bool - Type VersionMetadataType `json:"type"` - // +optional // +kubebuilder:validation:Type=string - // +unionMember - String string `json:"string,omitempty"` - - // +optional - // +kubebuilder:validation:Type=boolean - // +unionMember - Bool bool `json:"bool,omitempty"` + // +kubebuilder:validation:MaxLength=32 + Value string `json:"value,omitempty"` } // Version describes a version involved in an update, typically on one side of an update edge @@ -217,9 +196,12 @@ type Version struct { // version is a semantic version string, or a placeholder '' for the special case where this // is a "previous" version in a new installation // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=64 Version string `json:"version,omitempty"` - // metadata is a list of metadata associated with the version + // metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional + // and when not provided, the metadata item has boolean semantics (presence indicates true) // +listType=map // +listMapKey=key // +optional From e82e402f0e99a87d0d2a871f2f1b634ff853db14 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 15 Oct 2024 14:46:19 +0200 Subject: [PATCH 20/45] status: break API into multiple files --- update/v1alpha1/types_update_status.go | 619 ++---------------- update/v1alpha1/types_update_status_health.go | 126 ++++ .../v1alpha1/types_update_status_progress.go | 381 +++++++++++ 3 files changed, 567 insertions(+), 559 deletions(-) create mode 100644 update/v1alpha1/types_update_status_health.go create mode 100644 update/v1alpha1/types_update_status_progress.go diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 72224f7ac21..f5b226ff0bb 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -42,13 +42,13 @@ type UpdateStatusSpec struct { type UpdateStatusStatus struct { // controlPlane contains a summary and insights related to the control plane update // +kubebuilder:validation:Required - ControlPlane ControlPlaneUpdateStatus `json:"controlPlane"` + ControlPlane ControlPlane `json:"controlPlane"` // workerPools contains summaries and insights related to the worker pools update // +listType=map // +listMapKey=name // +optional - WorkerPools []PoolUpdateStatus `json:"workerPools,omitempty"` + WorkerPools []Pool `json:"workerPools,omitempty"` // conditions provide details about the controller operational matters // +listType=map @@ -57,33 +57,8 @@ type UpdateStatusStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` } -// ControlPlaneConditionType are types of conditions that can be reported on control plane level -type ControlPlaneConditionType string - -const ( - // Updating is the condition type that communicate whether the whole control plane is updating or not - ControlPlaneUpdating ControlPlaneConditionType = "Updating" -) - -// ControlPlaneUpdatingReason are well-known reasons for the Updating condition -// +kubebuilder:validation:Enum=ClusterVersionProgressing;ClusterVersionNotProgressing;CannotDetermineUpdating -type ControlPlaneUpdatingReason string - -const ( - // ClusterVersionProgressing is used for Updating=True set because we observed a ClusterVersion resource to - // have Progressing=True condition - ReasonClusterVersionProgressing ControlPlaneUpdatingReason = "ClusterVersionProgressing" - // ClusterVersionNotProgressing is used for Updating=False set because we observed a ClusterVersion resource to - // have Progressing=False condition - ReasonClusterVersionNotProgressing ControlPlaneUpdatingReason = "ClusterVersionNotProgressing" - // CannotDetermineUpdating is used with Updating=Unknown. This covers many different actual reasons such as - // missing or Unknown Progressing condition on ClusterVersion, but it does not seem useful to track the individual - // reasons to that granularity for Updating=Unknown - ReasonClusterVersionCannotDetermine ControlPlaneUpdatingReason = "CannotDetermineUpdating" -) - -// ControlPlaneUpdateStatus contains a summary and insights related to the control plane update -type ControlPlaneUpdateStatus struct { +// ControlPlane contains a summary and insights related to the control plane update +type ControlPlane struct { // resource is the resource that represents the control plane. It will typically be a ClusterVersion resource // in standalone OpenShift and HostedCluster in Hosted Control Planes. // @@ -108,7 +83,7 @@ type ControlPlaneUpdateStatus struct { // +listType=map // +listMapKey=name // +optional - Informers []UpdateInformer `json:"informers,omitempty"` + Informers []Informer `json:"informers,omitempty"` // conditions provides details about the control plane update // +listType=map @@ -117,224 +92,33 @@ type ControlPlaneUpdateStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` } -// UpdateInformer is an insight producer identified by a name, carrying a list of insights it produced -type UpdateInformer struct { - // name is the name of the insight producer - // +kubebuilder:validation:Required - Name string `json:"name"` - - // insights is a list of insights produced by this producer - // +optional - // +listType=map - // +listMapKey=uid - Insights []UpdateInsight `json:"insights,omitempty"` -} - -// ControlPlaneAssessment is the assessment of the control plane update process -type ControlPlaneAssessment string - -const ( - // Unknown means the update status and health cannot be determined - ControlPlaneAssessmentUnknown ControlPlaneAssessment = "Unknown" - // Progressing means the control plane is updating and no problems or slowness are detected - ControlPlaneAssessmentProgressing ControlPlaneAssessment = "Progressing" - // Completed means the control plane successfully completed updating and no problems are detected - ControlPlaneAssessmentCompleted ControlPlaneAssessment = "Completed" - // Degraded means the process of updating the control plane suffers from an observed problem - ControlPlaneAssessmentDegraded ControlPlaneAssessment = "Degraded" -) - -// ClusterVersionStatusInsightConditionType are types of conditions that can be reported on ClusterVersion status insight -type ClusterVersionStatusInsightConditionType string - -const ( - // Updating condition communicates whether the ClusterVersion is updating - ClusterVersionStatusInsightUpdating ClusterVersionStatusInsightConditionType = "Updating" -) - -// ClusterVersionStatusInsightUpdatingReason are well-known reasons for the Updating condition on ClusterVersion status insights -type ClusterVersionStatusInsightUpdatingReason string - -const ( - // CannotDetermineUpdating is used with Updating=Unknown - ClusterVersionCannotDetermineUpdating ClusterVersionStatusInsightUpdatingReason = "CannotDetermineUpdating" - // ClusterVersionProgressing means that ClusterVersion is considered to be Updating=True because it has a Progressing=True condition - ClusterVersionProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionProgressing" - // ClusterVersionNotProgressing means that ClusterVersion is considered to be Updating=False because it has a Progressing=False condition - ClusterVersionNotProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionNotProgressing" -) - -// VersionMetadataKey is a key for a metadata value associated with a version -// +kubebuilder:validation:Enum=Installation;Partial;Architecture -type VersionMetadataKey string - -const ( - // Installation denotes a boolean that indicates the update was initiated as an installation - InstallationMetadata VersionMetadataKey = "Installation" - // Partial denotes a boolean that indicates the update was initiated in a state where the previous upgrade - // (to the original version) was not fully completed - PartialMetadata VersionMetadataKey = "Partial" - // Architecture denotes a string that indicates the architecture of the payload image of the version, - // when relevant - ArchitectureMetadata VersionMetadataKey = "Architecture" -) - -type VersionMetadata struct { - // key is the name of this metadata value - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=installation;partial;architecture - Key VersionMetadataKey `json:"key"` - - // +optional - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MaxLength=32 - Value string `json:"value,omitempty"` -} - -// Version describes a version involved in an update, typically on one side of an update edge -type Version struct { - // version is a semantic version string, or a placeholder '' for the special case where this - // is a "previous" version in a new installation - // +kubebuilder:validation:Required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MaxLength=64 - Version string `json:"version,omitempty"` - - // metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional - // and when not provided, the metadata item has boolean semantics (presence indicates true) - // +listType=map - // +listMapKey=key - // +optional - Metadata []VersionMetadata `json:"metadata,omitempty"` -} - -// ControlPlaneUpdateVersions contains the original and target versions of the upgrade -type ControlPlaneUpdateVersions struct { - // previous is the version of the control plane before the update. When the cluster is being installed - // for the first time, the version will have a placeholder value like '' and the target version - // will have a boolean installation=true metadata - // +kubebuilder:validation:Required - Previous Version `json:"previous"` - - // target is the version of the control plane after the update - // +kubebuilder:validation:Required - Target Version `json:"target"` -} - -// ClusterVersionStatusInsight reports the state of a ClusterVersion resource (which represents a control plane -// update in standalone clusters), during the update. -type ClusterVersionStatusInsight struct { - // resource is the ClusterVersion resource that represents the control plane - // - // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to - // resource name (because the rest is implied by status insight type). However, because we use resource references in - // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable - // than type safety for producers. - // +kubebuilder:validation:Required - Resource ResourceRef `json:"resource"` - - // assessment is the assessment of the control plane update process - // +kubebuilder:validation:Required - Assessment ControlPlaneAssessment `json:"assessment"` - - // versions contains the original and target versions of the upgrade - // +kubebuilder:validation:Required - Versions ControlPlaneUpdateVersions `json:"versions"` - - // completion is a percentage of the update completion (0-100) - // +kubebuilder:validation:Required - // +kubebuilder:validation:Minimum=0 - // +kubebuilder:validation:Maximum=100 - Completion int32 `json:"completion"` - - // startedAt is the time when the update started - // +kubebuilder:validation:Required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Format=date-time - StartedAt metav1.Time `json:"startedAt"` - - // completedAt is the time when the update completed - // +optional - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Format=date-time - CompletedAt *metav1.Time `json:"completedAt,omitempty"` - - // estimatedCompletedAt is the estimated time when the update will complete - // +optional - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Format=date-time - EstimatedCompletedAt *metav1.Time `json:"estimatedCompletedAt,omitempty"` - - // conditions provides detailed observed conditions about ClusterVersion - // +listType=map - // +listMapKey=type - // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` -} - -// ClusterOperatorStatusInsightConditionType are types of conditions that can be reported on ClusterOperator status insights -type ClusterOperatorStatusInsightConditionType string - -const ( - // Updating condition communicates whether the ClusterOperator is updating - ClusterOperatorStatusInsightUpdating ClusterOperatorStatusInsightConditionType = "Updating" - // Healthy condition communicates whether the ClusterOperator is considered healthy - ClusterOperatorStatusInsightHealthy ClusterOperatorStatusInsightConditionType = "Healthy" -) - -// ClusterOperatorUpdatingReason are well-known reasons for the Updating condition on ClusterOperator status insights -type ClusterOperatorUpdatingReason string +// ControlPlaneConditionType are types of conditions that can be reported on control plane level +type ControlPlaneConditionType string const ( - // Updated is used with Updating=False when the ClusterOperator finished updating - ClusterOperatorUpdatingReasonUpdated ClusterOperatorUpdatingReason = "Updated" - // Pending is used with Updating=False when the ClusterOperator is not updating and is still running previous version - ClusterOperatorUpdatingReasonPending ClusterOperatorUpdatingReason = "Pending" - // Progressing is used with Updating=True when the ClusterOperator is updating - ClusterOperatorUpdatingReasonProgressing ClusterOperatorUpdatingReason = "Progressing" - // CannotDetermine is used with Updating=Unknown - ClusterOperatorUpdatingCannotDetermine ClusterOperatorUpdatingReason = "CannotDetermine" + // Updating is the condition type that communicate whether the whole control plane is updating or not + ControlPlaneUpdating ControlPlaneConditionType = "Updating" ) -// ClusterOperatorHealthyReason are well-known reasons for the Healthy condition on ClusterOperator status insights -type ClusterOperatorHealthyReason string +// ControlPlaneUpdatingReason are well-known reasons for the Updating condition +// +kubebuilder:validation:Enum=ClusterVersionProgressing;ClusterVersionNotProgressing;CannotDetermineUpdating +type ControlPlaneUpdatingReason string const ( - // AsExpected is used with Healthy=True when no issues are observed - ClusterOperatorHealthyReasonAsExpected ClusterOperatorHealthyReason = "AsExpected" - // Unavailable is used with Healthy=False when the ClusterOperator has Available=False condition - ClusterOperatorHealthyReasonUnavailable ClusterOperatorHealthyReason = "Unavailable" - // Degraded is used with Healthy=False when the ClusterOperator has Degraded=True condition - ClusterOperatorHealthyReasonDegraded ClusterOperatorHealthyReason = "Degraded" - // CannotDetermine is used with Healthy=Unknown - ClusterOperatorHealthyReasonCannotDetermine ClusterOperatorHealthyReason = "CannotDetermine" + // ClusterVersionProgressing is used for Updating=True set because we observed a ClusterVersion resource to + // have Progressing=True condition + ReasonClusterVersionProgressing ControlPlaneUpdatingReason = "ClusterVersionProgressing" + // ClusterVersionNotProgressing is used for Updating=False set because we observed a ClusterVersion resource to + // have Progressing=False condition + ReasonClusterVersionNotProgressing ControlPlaneUpdatingReason = "ClusterVersionNotProgressing" + // CannotDetermineUpdating is used with Updating=Unknown. This covers many different actual reasons such as + // missing or Unknown Progressing condition on ClusterVersion, but it does not seem useful to track the individual + // reasons to that granularity for Updating=Unknown + ReasonClusterVersionCannotDetermine ControlPlaneUpdatingReason = "CannotDetermineUpdating" ) -// ClusterOperatorStatusInsight reports the state of a ClusterOperator resource (which represents a control plane -// component update in standalone clusters), during the update -type ClusterOperatorStatusInsight struct { - // name is the name of the operator - // +kubebuilder:validation:Required - Name string `json:"name"` - - // resource is the ClusterOperator resource that represents the operator - // - // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to - // resource name (because the rest is implied by status insight type). However, because we use resource references in - // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable - // than type safety for producers. - // +kubebuilder:validation:Required - Resource ResourceRef `json:"resource"` - - // conditions provide details about the operator - // +listType=map - // +listMapKey=type - // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` -} - -// PoolUpdateStatus contains a summary and insights related to a node pool update -type PoolUpdateStatus struct { +// Pool contains a summary and insights related to a node pool update +type Pool struct { // name is the name of the pool // +kubebuilder:validation:Required Name string `json:"name"` @@ -352,7 +136,7 @@ type PoolUpdateStatus struct { // +listType=map // +listMapKey=name // +optional - Informers []UpdateInformer `json:"informers,omitempty"` + Informers []Informer `json:"informers,omitempty"` // conditions provide details about the pool // +listType=map @@ -361,208 +145,21 @@ type PoolUpdateStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` } -// PoolUpdateAssessment is the assessment of the node pool update process -type PoolUpdateAssessment string - -const ( - // Pending means the nodes in the pool will be updated but none have even started yet - PoolUpdatePending PoolUpdateAssessment = "Pending" - // Completed means all nodes in the pool have been updated - PoolUpdateCompleted PoolUpdateAssessment = "Completed" - // Degraded means the process of updating the pool suffers from an observed problem - PoolUpdateDegraded PoolUpdateAssessment = "Degraded" - // Excluded means some (or all) nodes in the pool would be normally updated but a configuration (such as paused MCP) - // prevents that from happening - PoolUpdateExcluded PoolUpdateAssessment = "Excluded" - // Progressing means the nodes in the pool are being updated and no problems or slowness are detected - PoolUpdateProgressing PoolUpdateAssessment = "Progressing" -) - -// NodeSummaryType are types of summaries (how many nodes match certain criteria, such as updated, degraded, etc.) -// reported for a node pool -// +kubebuilder:validation:Enum=Total;Available;Progressing;Outdated;Draining;Excluded;Degraded -type NodeSummaryType string - -const ( - // Total is the total number of nodes in the pool - NodesTotal NodeSummaryType = "Total" - // Available is the number of nodes in the pool that are available (accepting workloads) - NodesAvailable NodeSummaryType = "Available" - // Progressing is the number of nodes in the pool that are updating - NodesProgressing NodeSummaryType = "Progressing" - // Outdated is the number of nodes in the pool that are running an outdated version - NodesOutdated NodeSummaryType = "Outdated" - // Draining is the number of nodes in the pool that are being drained - NodesDraining NodeSummaryType = "Draining" - // Excluded is the number of nodes in the pool that would normally be updated but configuration (such as paused MCP) - // prevents that from happening - NodesExcluded NodeSummaryType = "Excluded" - // Degraded is the number of nodes in the pool that are degraded - NodesDegraded NodeSummaryType = "Degraded" -) - -// NodeSummary is a count of nodes matching certain criteria (e.g. updated, degraded, etc.) -type NodeSummary struct { - // type is the type of the summary - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=Total;Available;Progressing;Outdated;Draining;Excluded;Degraded - Type NodeSummaryType `json:"type"` - - // count is the number of nodes matching the criteria - // +kubebuilder:validation:Required - // +kubebuilder:validation:Minimum=0 - Count int32 `json:"count"` -} - -// ClusterVersionStatusInsight reports the state of a MachineConfigPool resource during the update -type MachineConfigPoolStatusInsight struct { - // name is the name of the machine config pool - // +kubebuilder:validation:Required - Name string `json:"name"` - - // resource is the MachineConfigPool resource that represents the pool - // - // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to - // resource name (because the rest is implied by status insight type). However, because we use resource references in - // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable - // than type safety for producers. - // +kubebuilder:validation:Required - Resource PoolResourceRef `json:"resource"` - - // scopeType describes whether the pool is a control plane or a worker pool - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=ControlPlane;WorkerPool - Scope ScopeType `json:"scopeType"` - - // assessment is the assessment of the machine config pool update process - // +kubebuilder:validation:Required - Assessment PoolUpdateAssessment `json:"assessment"` - - // completion is a percentage of the update completion (0-100) - // +kubebuilder:validation:Required - // +kubebuilder:validation:Minimum=0 - // +kubebuilder:validation:Maximum=100 - Completion int32 `json:"completion"` - - // summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.) - // +listType=map - // +listMapKey=type - // +optional - Summaries []NodeSummary `json:"summaries,omitempty"` - - // conditions provide details about the machine config pool update - // +listType=map - // +listMapKey=type - // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` -} - -// NodeStatusInsightConditionType are types of conditions that can be reported on Node status insights -type NodeStatusInsightConditionType string - -const ( - // Updating condition communicates whether the Node is updating - NodeStatusInsightUpdating NodeStatusInsightConditionType = "Updating" - // Degraded condition communicates whether the Node is degraded (problem observed) - NodeStatusInsightDegraded NodeStatusInsightConditionType = "Degraded" - // Available condition communicates whether the Node is available (accepting workloads) - NodeStatusInsightAvailable NodeStatusInsightConditionType = "Available" -) - -// NodeUpdatingReason are well-known reasons for the Updating condition on Node status insights -type NodeUpdatingReason string - -const ( - // Draining is used with Updating=True when the Node is being drained - NodeDraining NodeUpdatingReason = "Draining" - // Updating is used with Updating=True when new node configuration is being applied - NodeUpdating NodeUpdatingReason = "Updating" - // Rebooting is used with Updating=True when the Node is rebooting into the new version - NodeRebooting NodeUpdatingReason = "Rebooting" - - // Updated is used with Updating=False when the Node is prevented by configuration from updating - NodePaused NodeUpdatingReason = "Paused" - // Updated is used with Updating=False when the Node is waiting to be eventually updated - NodeUpdatePending NodeUpdatingReason = "Pending" - // Updated is used with Updating=False when the Node has been updated - NodeCompleted NodeUpdatingReason = "Completed" - - // CannotDetermine is used with Updating=Unknown - NodeCannotDetermine NodeUpdatingReason = "CannotDetermine" -) - -// NodeStatusInsight reports the state of a Node during the update -type NodeStatusInsight struct { - // name is the name of the node +// Informer is an insight producer identified by a name, carrying a list of insights it produced +type Informer struct { + // name is the name of the insight producer // +kubebuilder:validation:Required Name string `json:"name"` - // resource is the Node resource that represents the node - // - // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to - // resource name (because the rest is implied by status insight type). However, because we use resource references in - // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable - // than type safety for producers. - // +kubebuilder:validation:Required - Resource ResourceRef `json:"resource"` - - // poolResource is the resource that represents the pool the node is a member of - // - // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows - // only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use - // resource references in many places and this API is intended to be consumed by clients, not produced, consistency - // seems to be more valuable than type safety for producers. - // +kubebuilder:validation:Required - PoolResource PoolResourceRef `json:"poolResource"` - - // version is the version of the node, when known - // +optional - // +kubebuilder:validation:Type=string - Version string `json:"version,omitempty"` - - // estToComplete is the estimated time to complete the update, when known - // +optional - // +kubebuilder:validation:Type=string - EstToComplete *metav1.Duration `json:"estToComplete,omitempty"` - - // message is a short human-readable message about the node update status + // insights is a list of insights produced by this producer // +optional - Message string `json:"message,omitempty"` - - // conditions provides details about the control plane update // +listType=map - // +listMapKey=type - // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` + // +listMapKey=uid + Insights []Insight `json:"insights,omitempty"` } -// UpdateInsightType identifies the type of the update insight as either one of the resource-specific status insight, -// or a generic health insight -// +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;UpdateHealth -type UpdateInsightType string - -const ( - // Resource-specific status insights should be reported continuously during the update process and mostly communicate - // progress and high-level state - - // ClusterVersion status insight reports progress and high-level state of a ClusterVersion resource, representing - // control plane in standalone clusters - ClusterVersionStatusInsightType UpdateInsightType = "ClusterVersion" - // ClusterOperator status insight reports progress and high-level state of a ClusterOperator, representing a control - // plane component - ClusterOperatorStatusInsightType UpdateInsightType = "ClusterOperator" - // MachineConfigPool status insight reports progress and high-level state of a MachineConfigPool resource, representing - // a pool of nodes in clusters using Machine API - MachineConfigPoolStatusInsightType UpdateInsightType = "MachineConfigPool" - // Node status insight reports progress and high-level state of a Node resource, representing a node (both control - // plane and worker) in a cluster - NodeStatusInsightType UpdateInsightType = "Node" - - // Health insights are reported only when an informer observes a condition that requires admin attention - UpdateHealthInsightType UpdateInsightType = "UpdateHealth" -) - -type UpdateInsight struct { +// Insight is a unique piece of either status/progress or update health information produced by update informer +type Insight struct { // uid identifies the insight over time // +kubebuilder:validation:Required // +kubebuilder:validation:Type=string @@ -574,15 +171,16 @@ type UpdateInsight struct { // +kubebuilder:validation:Format=date-time AcquiredAt metav1.Time `json:"acquiredAt"` - UpdateInsightUnion `json:",inline"` + InsightUnion `json:",inline"` } -type UpdateInsightUnion struct { +// InsightUnion is the discriminated union of all insights types, identified by type field +type InsightUnion struct { // type identifies the type of the update insight // +unionDiscriminator // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;UpdateHealth - Type UpdateInsightType `json:"type"` + // +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;Health + Type InsightType `json:"type"` // clusterVersion is a status insight about the state of a control plane update, where // the control plane is represented by a ClusterVersion resource usually managed by CVO @@ -612,53 +210,34 @@ type UpdateInsightUnion struct { // resource but surfaces actionable information about the health of the cluster or an update // +optional // +unionMember - UpdateHealthInsight *UpdateHealthInsight `json:"health,omitempty"` -} - -// UpdateHealthInsight is a piece of actionable information produced by an insight producer about the health -// of the cluster or an update -type UpdateHealthInsight struct { - // startedAt is the time when the condition reported by the insight started - // +kubebuilder:validation:Required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Format=date-time - StartedAt metav1.Time `json:"startedAt"` - - // scope is list of objects involved in the insight - // +kubebuilder:validation:Required - Scope UpdateInsightScope `json:"scope"` - - // impact describes the impact the reported condition has on the cluster or update - // +kubebuilder:validation:Required - Impact UpdateInsightImpact `json:"impact"` - - // remediation contains information about how to resolve or prevent the reported condition - Remediation UpdateInsightRemediation `json:"remediation"` + HealthInsight *HealthInsight `json:"health,omitempty"` } -// ScopeType is one of ControlPlane or WorkerPool -// +kubebuilder:validation:Enum=ControlPlane;WorkerPool -type ScopeType string +// InsightType identifies the type of the update insight as either one of the resource-specific status insight, +// or a generic health insight +// +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;Health +type InsightType string const ( - // ControlPlane is used for insights that are related to the control plane (including control plane pool or nodes) - ControlPlaneScope ScopeType = "ControlPlane" - // WorkerPool is used for insights that are related to a worker pools and nodes (excluding control plane) - WorkerPoolScope ScopeType = "WorkerPool" -) + // Resource-specific status insights should be reported continuously during the update process and mostly communicate + // progress and high-level state -// UpdateInsightScope is a list of resources involved in the insight -type UpdateInsightScope struct { - // type is either ControlPlane or WorkerPool - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=ControlPlane;WorkerPool - Type ScopeType `json:"type"` + // ClusterVersion status insight reports progress and high-level state of a ClusterVersion resource, representing + // control plane in standalone clusters + ClusterVersionStatusInsightType InsightType = "ClusterVersion" + // ClusterOperator status insight reports progress and high-level state of a ClusterOperator, representing a control + // plane component + ClusterOperatorStatusInsightType InsightType = "ClusterOperator" + // MachineConfigPool status insight reports progress and high-level state of a MachineConfigPool resource, representing + // a pool of nodes in clusters using Machine API + MachineConfigPoolStatusInsightType InsightType = "MachineConfigPool" + // Node status insight reports progress and high-level state of a Node resource, representing a node (both control + // plane and worker) in a cluster + NodeStatusInsightType InsightType = "Node" - // resources is a list of resources involved in the insight, of any group/kind - // +optional - // +listType=atomic - Resources []ResourceRef `json:"resources,omitempty"` -} + // Health insights are reported only when an informer observes a condition that requires admin attention + HealthInsightType InsightType = "Health" +) // ResourceRef is a reference to a kubernetes resource, typically involved in an insight type ResourceRef struct { @@ -679,84 +258,6 @@ type ResourceRef struct { Namespace string `json:"namespace,omitempty"` } -// InsightImpactLevel describes the severity of the impact the reported condition has on the cluster or update -// +kubebuilder:validation:Enum=Unknown;Info;Warning;Error;Critical -type InsightImpactLevel string - -const ( - // UnknownImpactLevel is used when the impact level is not known - UnknownImpactLevel InsightImpactLevel = "Unknown" - // info should be used for insights that are strictly informational or even positive (things go well or - // something recently healed) - InfoImpactLevel InsightImpactLevel = "Info" - // warning should be used for insights that explain a minor or transient problem. Anything that requires - // admin attention or manual action should not be a warning but at least an error. - WarningImpactLevel InsightImpactLevel = "Warning" - // error should be used for insights that inform about a problem that requires admin attention. Insights of - // level error and higher should be as actionable as possible, and should be accompanied by links to documentation, - // KB articles or other resources that help the admin to resolve the problem. - ErrorImpactLevel InsightImpactLevel = "Error" - // critical should be used rarely, for insights that inform about a severe problem, threatening with data - // loss, destroyed cluster or other catastrophic consequences. Insights of this level should be accompanied by - // links to documentation, KB articles or other resources that help the admin to resolve the problem, or at least - // prevent the severe consequences from happening. - CriticalInfoLevel InsightImpactLevel = "Critical" -) - -// InsightImpactType describes the type of the impact the reported condition has on the cluster or update -// +kubebuilder:validation:Enum=None;Unknown;API Availability;Cluster Capacity;Application Availability;Application Outage;Data Loss;Update Speed;Update Stalled -type InsightImpactType string - -const ( - NoneImpactType InsightImpactType = "None" - UnknownImpactType InsightImpactType = "Unknown" - ApiAvailabilityImpactType InsightImpactType = "API Availability" - ClusterCapacityImpactType InsightImpactType = "Cluster Capacity" - ApplicationAvailabilityImpactType InsightImpactType = "Application Availability" - ApplicationOutageImpactType InsightImpactType = "Application Outage" - DataLossImpactType InsightImpactType = "Data Loss" - UpdateSpeedImpactType InsightImpactType = "Update Speed" - UpdateStalledImpactType InsightImpactType = "Update Stalled" -) - -// UpdateInsightImpact describes the impact the reported condition has on the cluster or update -type UpdateInsightImpact struct { - // level is the severity of the impact - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=Unknown;Info;Warning;Error;Critical - Level InsightImpactLevel `json:"level"` - - // type is the type of the impact - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=None;Unknown;API Availability;Cluster Capacity;Application Availability;Application Outage;Data Loss;Update Speed;Update Stalled - Type InsightImpactType `json:"type"` - - // summary is a short summary of the impact - // +kubebuilder:validation:Required - // +kubebuilder:validation:Type=string - Summary string `json:"summary"` - - // description is a human-oriented, possibly longer-form description of the condition reported by the insight - // +optional - // +kubebuilder:validation:Type=string - Description string `json:"description,omitempty"` -} - -// UpdateInsightRemediation contains information about how to resolve or prevent the reported condition -type UpdateInsightRemediation struct { - // reference is a URL where administrators can find information to resolve or prevent the reported condition - // +kubebuilder:validation:Required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Format=uri - Reference string `json:"reference"` - - // estimatedFinish is the estimated time when the informer expects the condition to be resolved, if applicable. - // +optional - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Format=date-time - EstimatedFinish *metav1.Time `json:"estimatedFinish,omitempty"` -} - // PoolResourceRef is a reference to a kubernetes resource that represents a node pool type PoolResourceRef struct { ResourceRef `json:",inline"` diff --git a/update/v1alpha1/types_update_status_health.go b/update/v1alpha1/types_update_status_health.go new file mode 100644 index 00000000000..4ffc50987a7 --- /dev/null +++ b/update/v1alpha1/types_update_status_health.go @@ -0,0 +1,126 @@ +package v1alpha1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// HealthInsight is a piece of actionable information produced by an insight producer about the health +// of the cluster or an update +type HealthInsight struct { + // startedAt is the time when the condition reported by the insight started + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time + StartedAt metav1.Time `json:"startedAt"` + + // scope is list of objects involved in the insight + // +kubebuilder:validation:Required + Scope InsightScope `json:"scope"` + + // impact describes the impact the reported condition has on the cluster or update + // +kubebuilder:validation:Required + Impact InsightImpact `json:"impact"` + + // remediation contains information about how to resolve or prevent the reported condition + Remediation InsightRemediation `json:"remediation"` +} + +// InsightScope is a list of resources involved in the insight +type InsightScope struct { + // type is either ControlPlane or WorkerPool + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=ControlPlane;WorkerPool + Type ScopeType `json:"type"` + + // resources is a list of resources involved in the insight, of any group/kind + // +optional + // +listType=atomic + Resources []ResourceRef `json:"resources,omitempty"` +} + +// ScopeType is one of ControlPlane or WorkerPool +// +kubebuilder:validation:Enum=ControlPlane;WorkerPool +type ScopeType string + +const ( + // ControlPlane is used for insights that are related to the control plane (including control plane pool or nodes) + ControlPlaneScope ScopeType = "ControlPlane" + // WorkerPool is used for insights that are related to a worker pools and nodes (excluding control plane) + WorkerPoolScope ScopeType = "WorkerPool" +) + +// InsightImpact describes the impact the reported condition has on the cluster or update +type InsightImpact struct { + // level is the severity of the impact + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=Unknown;Info;Warning;Error;Critical + Level InsightImpactLevel `json:"level"` + + // type is the type of the impact + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=None;Unknown;API Availability;Cluster Capacity;Application Availability;Application Outage;Data Loss;Update Speed;Update Stalled + Type InsightImpactType `json:"type"` + + // summary is a short summary of the impact + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + Summary string `json:"summary"` + + // description is a human-oriented, possibly longer-form description of the condition reported by the insight + // +optional + // +kubebuilder:validation:Type=string + Description string `json:"description,omitempty"` +} + +// InsightImpactLevel describes the severity of the impact the reported condition has on the cluster or update +// +kubebuilder:validation:Enum=Unknown;Info;Warning;Error;Critical +type InsightImpactLevel string + +const ( + // UnknownImpactLevel is used when the impact level is not known + UnknownImpactLevel InsightImpactLevel = "Unknown" + // info should be used for insights that are strictly informational or even positive (things go well or + // something recently healed) + InfoImpactLevel InsightImpactLevel = "Info" + // warning should be used for insights that explain a minor or transient problem. Anything that requires + // admin attention or manual action should not be a warning but at least an error. + WarningImpactLevel InsightImpactLevel = "Warning" + // error should be used for insights that inform about a problem that requires admin attention. Insights of + // level error and higher should be as actionable as possible, and should be accompanied by links to documentation, + // KB articles or other resources that help the admin to resolve the problem. + ErrorImpactLevel InsightImpactLevel = "Error" + // critical should be used rarely, for insights that inform about a severe problem, threatening with data + // loss, destroyed cluster or other catastrophic consequences. Insights of this level should be accompanied by + // links to documentation, KB articles or other resources that help the admin to resolve the problem, or at least + // prevent the severe consequences from happening. + CriticalInfoLevel InsightImpactLevel = "Critical" +) + +// InsightImpactType describes the type of the impact the reported condition has on the cluster or update +// +kubebuilder:validation:Enum=None;Unknown;API Availability;Cluster Capacity;Application Availability;Application Outage;Data Loss;Update Speed;Update Stalled +type InsightImpactType string + +const ( + NoneImpactType InsightImpactType = "None" + UnknownImpactType InsightImpactType = "Unknown" + ApiAvailabilityImpactType InsightImpactType = "API Availability" + ClusterCapacityImpactType InsightImpactType = "Cluster Capacity" + ApplicationAvailabilityImpactType InsightImpactType = "Application Availability" + ApplicationOutageImpactType InsightImpactType = "Application Outage" + DataLossImpactType InsightImpactType = "Data Loss" + UpdateSpeedImpactType InsightImpactType = "Update Speed" + UpdateStalledImpactType InsightImpactType = "Update Stalled" +) + +// InsightRemediation contains information about how to resolve or prevent the reported condition +type InsightRemediation struct { + // reference is a URL where administrators can find information to resolve or prevent the reported condition + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=uri + Reference string `json:"reference"` + + // estimatedFinish is the estimated time when the informer expects the condition to be resolved, if applicable. + // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time + EstimatedFinish *metav1.Time `json:"estimatedFinish,omitempty"` +} diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go new file mode 100644 index 00000000000..0153ea849c2 --- /dev/null +++ b/update/v1alpha1/types_update_status_progress.go @@ -0,0 +1,381 @@ +package v1alpha1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// ClusterVersionStatusInsight reports the state of a ClusterVersion resource (which represents a control plane +// update in standalone clusters), during the update. +type ClusterVersionStatusInsight struct { + // resource is the ClusterVersion resource that represents the control plane + // + // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + // resource name (because the rest is implied by status insight type). However, because we use resource references in + // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + // than type safety for producers. + // +kubebuilder:validation:Required + Resource ResourceRef `json:"resource"` + + // assessment is the assessment of the control plane update process + // +kubebuilder:validation:Required + Assessment ControlPlaneAssessment `json:"assessment"` + + // versions contains the original and target versions of the upgrade + // +kubebuilder:validation:Required + Versions ControlPlaneUpdateVersions `json:"versions"` + + // completion is a percentage of the update completion (0-100) + // +kubebuilder:validation:Required + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 + Completion int32 `json:"completion"` + + // startedAt is the time when the update started + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time + StartedAt metav1.Time `json:"startedAt"` + + // completedAt is the time when the update completed + // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time + CompletedAt *metav1.Time `json:"completedAt,omitempty"` + + // estimatedCompletedAt is the estimated time when the update will complete + // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time + EstimatedCompletedAt *metav1.Time `json:"estimatedCompletedAt,omitempty"` + + // conditions provides detailed observed conditions about ClusterVersion + // +listType=map + // +listMapKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// ControlPlaneAssessment is the assessment of the control plane update process +type ControlPlaneAssessment string + +const ( + // Unknown means the update status and health cannot be determined + ControlPlaneAssessmentUnknown ControlPlaneAssessment = "Unknown" + // Progressing means the control plane is updating and no problems or slowness are detected + ControlPlaneAssessmentProgressing ControlPlaneAssessment = "Progressing" + // Completed means the control plane successfully completed updating and no problems are detected + ControlPlaneAssessmentCompleted ControlPlaneAssessment = "Completed" + // Degraded means the process of updating the control plane suffers from an observed problem + ControlPlaneAssessmentDegraded ControlPlaneAssessment = "Degraded" +) + +// ControlPlaneUpdateVersions contains the original and target versions of the upgrade +type ControlPlaneUpdateVersions struct { + // previous is the version of the control plane before the update. When the cluster is being installed + // for the first time, the version will have a placeholder value like '' and the target version + // will have a boolean installation=true metadata + // +kubebuilder:validation:Required + Previous Version `json:"previous"` + + // target is the version of the control plane after the update + // +kubebuilder:validation:Required + Target Version `json:"target"` +} + +// Version describes a version involved in an update, typically on one side of an update edge +type Version struct { + // version is a semantic version string, or a placeholder '' for the special case where this + // is a "previous" version in a new installation + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=64 + Version string `json:"version,omitempty"` + + // metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional + // and when not provided, the metadata item has boolean semantics (presence indicates true) + // +listType=map + // +listMapKey=key + // +optional + Metadata []VersionMetadata `json:"metadata,omitempty"` +} + +type VersionMetadata struct { + // key is the name of this metadata value + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=installation;partial;architecture + Key VersionMetadataKey `json:"key"` + + // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=32 + Value string `json:"value,omitempty"` +} + +// VersionMetadataKey is a key for a metadata value associated with a version +// +kubebuilder:validation:Enum=Installation;Partial;Architecture +type VersionMetadataKey string + +const ( + // Installation denotes a boolean that indicates the update was initiated as an installation + InstallationMetadata VersionMetadataKey = "Installation" + // Partial denotes a boolean that indicates the update was initiated in a state where the previous upgrade + // (to the original version) was not fully completed + PartialMetadata VersionMetadataKey = "Partial" + // Architecture denotes a string that indicates the architecture of the payload image of the version, + // when relevant + ArchitectureMetadata VersionMetadataKey = "Architecture" +) + +// ClusterVersionStatusInsightConditionType are types of conditions that can be reported on ClusterVersion status insight +type ClusterVersionStatusInsightConditionType string + +const ( + // Updating condition communicates whether the ClusterVersion is updating + ClusterVersionStatusInsightUpdating ClusterVersionStatusInsightConditionType = "Updating" +) + +// ClusterVersionStatusInsightUpdatingReason are well-known reasons for the Updating condition on ClusterVersion status insights +type ClusterVersionStatusInsightUpdatingReason string + +const ( + // CannotDetermineUpdating is used with Updating=Unknown + ClusterVersionCannotDetermineUpdating ClusterVersionStatusInsightUpdatingReason = "CannotDetermineUpdating" + // ClusterVersionProgressing means that ClusterVersion is considered to be Updating=True because it has a Progressing=True condition + ClusterVersionProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionProgressing" + // ClusterVersionNotProgressing means that ClusterVersion is considered to be Updating=False because it has a Progressing=False condition + ClusterVersionNotProgressing ClusterVersionStatusInsightUpdatingReason = "ClusterVersionNotProgressing" +) + +// ClusterOperatorStatusInsight reports the state of a ClusterOperator resource (which represents a control plane +// component update in standalone clusters), during the update +type ClusterOperatorStatusInsight struct { + // name is the name of the operator + // +kubebuilder:validation:Required + Name string `json:"name"` + + // resource is the ClusterOperator resource that represents the operator + // + // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + // resource name (because the rest is implied by status insight type). However, because we use resource references in + // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + // than type safety for producers. + // +kubebuilder:validation:Required + Resource ResourceRef `json:"resource"` + + // conditions provide details about the operator + // +listType=map + // +listMapKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// ClusterOperatorStatusInsightConditionType are types of conditions that can be reported on ClusterOperator status insights +type ClusterOperatorStatusInsightConditionType string + +const ( + // Updating condition communicates whether the ClusterOperator is updating + ClusterOperatorStatusInsightUpdating ClusterOperatorStatusInsightConditionType = "Updating" + // Healthy condition communicates whether the ClusterOperator is considered healthy + ClusterOperatorStatusInsightHealthy ClusterOperatorStatusInsightConditionType = "Healthy" +) + +// ClusterOperatorUpdatingReason are well-known reasons for the Updating condition on ClusterOperator status insights +type ClusterOperatorUpdatingReason string + +const ( + // Updated is used with Updating=False when the ClusterOperator finished updating + ClusterOperatorUpdatingReasonUpdated ClusterOperatorUpdatingReason = "Updated" + // Pending is used with Updating=False when the ClusterOperator is not updating and is still running previous version + ClusterOperatorUpdatingReasonPending ClusterOperatorUpdatingReason = "Pending" + // Progressing is used with Updating=True when the ClusterOperator is updating + ClusterOperatorUpdatingReasonProgressing ClusterOperatorUpdatingReason = "Progressing" + // CannotDetermine is used with Updating=Unknown + ClusterOperatorUpdatingCannotDetermine ClusterOperatorUpdatingReason = "CannotDetermine" +) + +// ClusterOperatorHealthyReason are well-known reasons for the Healthy condition on ClusterOperator status insights +type ClusterOperatorHealthyReason string + +const ( + // AsExpected is used with Healthy=True when no issues are observed + ClusterOperatorHealthyReasonAsExpected ClusterOperatorHealthyReason = "AsExpected" + // Unavailable is used with Healthy=False when the ClusterOperator has Available=False condition + ClusterOperatorHealthyReasonUnavailable ClusterOperatorHealthyReason = "Unavailable" + // Degraded is used with Healthy=False when the ClusterOperator has Degraded=True condition + ClusterOperatorHealthyReasonDegraded ClusterOperatorHealthyReason = "Degraded" + // CannotDetermine is used with Healthy=Unknown + ClusterOperatorHealthyReasonCannotDetermine ClusterOperatorHealthyReason = "CannotDetermine" +) + +// ClusterVersionStatusInsight reports the state of a MachineConfigPool resource during the update +type MachineConfigPoolStatusInsight struct { + // name is the name of the machine config pool + // +kubebuilder:validation:Required + Name string `json:"name"` + + // resource is the MachineConfigPool resource that represents the pool + // + // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + // resource name (because the rest is implied by status insight type). However, because we use resource references in + // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + // than type safety for producers. + // +kubebuilder:validation:Required + Resource PoolResourceRef `json:"resource"` + + // scopeType describes whether the pool is a control plane or a worker pool + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=ControlPlane;WorkerPool + Scope ScopeType `json:"scopeType"` + + // assessment is the assessment of the machine config pool update process + // +kubebuilder:validation:Required + Assessment PoolAssessment `json:"assessment"` + + // completion is a percentage of the update completion (0-100) + // +kubebuilder:validation:Required + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 + Completion int32 `json:"completion"` + + // summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.) + // +listType=map + // +listMapKey=type + // +optional + Summaries []NodeSummary `json:"summaries,omitempty"` + + // conditions provide details about the machine config pool update + // +listType=map + // +listMapKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// PoolAssessment is the assessment of the node pool update process +type PoolAssessment string + +const ( + // Pending means the nodes in the pool will be updated but none have even started yet + PoolPending PoolAssessment = "Pending" + // Completed means all nodes in the pool have been updated + PoolCompleted PoolAssessment = "Completed" + // Degraded means the process of updating the pool suffers from an observed problem + PoolDegraded PoolAssessment = "Degraded" + // Excluded means some (or all) nodes in the pool would be normally updated but a configuration (such as paused MCP) + // prevents that from happening + PoolExcluded PoolAssessment = "Excluded" + // Progressing means the nodes in the pool are being updated and no problems or slowness are detected + PoolProgressing PoolAssessment = "Progressing" +) + +// NodeSummary is a count of nodes matching certain criteria (e.g. updated, degraded, etc.) +type NodeSummary struct { + // type is the type of the summary + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=Total;Available;Progressing;Outdated;Draining;Excluded;Degraded + Type NodeSummaryType `json:"type"` + + // count is the number of nodes matching the criteria + // +kubebuilder:validation:Required + // +kubebuilder:validation:Minimum=0 + Count int32 `json:"count"` +} + +// NodeSummaryType are types of summaries (how many nodes match certain criteria, such as updated, degraded, etc.) +// reported for a node pool +// +kubebuilder:validation:Enum=Total;Available;Progressing;Outdated;Draining;Excluded;Degraded +type NodeSummaryType string + +const ( + // Total is the total number of nodes in the pool + NodesTotal NodeSummaryType = "Total" + // Available is the number of nodes in the pool that are available (accepting workloads) + NodesAvailable NodeSummaryType = "Available" + // Progressing is the number of nodes in the pool that are updating + NodesProgressing NodeSummaryType = "Progressing" + // Outdated is the number of nodes in the pool that are running an outdated version + NodesOutdated NodeSummaryType = "Outdated" + // Draining is the number of nodes in the pool that are being drained + NodesDraining NodeSummaryType = "Draining" + // Excluded is the number of nodes in the pool that would normally be updated but configuration (such as paused MCP) + // prevents that from happening + NodesExcluded NodeSummaryType = "Excluded" + // Degraded is the number of nodes in the pool that are degraded + NodesDegraded NodeSummaryType = "Degraded" +) + +// NodeStatusInsight reports the state of a Node during the update +type NodeStatusInsight struct { + // name is the name of the node + // +kubebuilder:validation:Required + Name string `json:"name"` + + // resource is the Node resource that represents the node + // + // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + // resource name (because the rest is implied by status insight type). However, because we use resource references in + // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + // than type safety for producers. + // +kubebuilder:validation:Required + Resource ResourceRef `json:"resource"` + + // poolResource is the resource that represents the pool the node is a member of + // + // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + // only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + // resource references in many places and this API is intended to be consumed by clients, not produced, consistency + // seems to be more valuable than type safety for producers. + // +kubebuilder:validation:Required + PoolResource PoolResourceRef `json:"poolResource"` + + // version is the version of the node, when known + // +optional + // +kubebuilder:validation:Type=string + Version string `json:"version,omitempty"` + + // estToComplete is the estimated time to complete the update, when known + // +optional + // +kubebuilder:validation:Type=string + EstToComplete *metav1.Duration `json:"estToComplete,omitempty"` + + // message is a short human-readable message about the node update status + // +optional + Message string `json:"message,omitempty"` + + // conditions provides details about the control plane update + // +listType=map + // +listMapKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// NodeStatusInsightConditionType are types of conditions that can be reported on Node status insights +type NodeStatusInsightConditionType string + +const ( + // Updating condition communicates whether the Node is updating + NodeStatusInsightUpdating NodeStatusInsightConditionType = "Updating" + // Degraded condition communicates whether the Node is degraded (problem observed) + NodeStatusInsightDegraded NodeStatusInsightConditionType = "Degraded" + // Available condition communicates whether the Node is available (accepting workloads) + NodeStatusInsightAvailable NodeStatusInsightConditionType = "Available" +) + +// NodeUpdatingReason are well-known reasons for the Updating condition on Node status insights +type NodeUpdatingReason string + +const ( + // Draining is used with Updating=True when the Node is being drained + NodeDraining NodeUpdatingReason = "Draining" + // Updating is used with Updating=True when new node configuration is being applied + NodeUpdating NodeUpdatingReason = "Updating" + // Rebooting is used with Updating=True when the Node is rebooting into the new version + NodeRebooting NodeUpdatingReason = "Rebooting" + + // Updated is used with Updating=False when the Node is prevented by configuration from updating + NodePaused NodeUpdatingReason = "Paused" + // Updated is used with Updating=False when the Node is waiting to be eventually updated + NodeUpdatePending NodeUpdatingReason = "Pending" + // Updated is used with Updating=False when the Node has been updated + NodeCompleted NodeUpdatingReason = "Completed" + + // CannotDetermine is used with Updating=Unknown + NodeCannotDetermine NodeUpdatingReason = "CannotDetermine" +) From 615da5ada60f9cd290efec1bd54ea7d70b84e6ed Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 15 Oct 2024 17:38:13 +0200 Subject: [PATCH 21/45] status: add tests --- .../UpgradeStatus.yaml | 447 ++++++++++++++++++ 1 file changed, 447 insertions(+) diff --git a/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml b/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml index f95404c988b..58fd3256a2e 100644 --- a/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml +++ b/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml @@ -13,3 +13,450 @@ tests: apiVersion: update.openshift.io/v1alpha1 kind: UpdateStatus spec: {} + onUpdate: + - name: UpdateStatus can contain a ClusterVersion insight + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: master + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: "" + metadata: + - key: Installation + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: master + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: "" + metadata: + - key: Installation + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + + - name: UpdateStatus can contain a ClusterOperator insight + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: ClusterOperator + clusterOperator: + name: image-registry + resource: + group: config.openshift.io + resource: clusteroperators + name: image-registry + conditions: + - type: Updating + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Pending + message: Waiting to be updated + - type: Healthy + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Degraded + message: Image registry is degraded + conditions: [] + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: ClusterOperator + clusterOperator: + name: image-registry + resource: + group: config.openshift.io + resource: clusteroperators + name: image-registry + conditions: + - type: Updating + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Pending + message: Waiting to be updated + - type: Healthy + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Degraded + message: Image registry is degraded + conditions: [] + + - name: UpdateStatus can contain a MachineConfigPool insight + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + informers: [] + conditions: [] + workerPools: + - name: worker + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: MachineConfigPool + machineConfigPool: + name: image-registry + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + scopeType: WorkerPool + assessment: Completed + completion: 100 + summaries: + - type: Total + count: 8 + - type: Outdated + count: 0 + conditions: [] + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + informers: [] + conditions: [] + workerPools: + - name: worker + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: MachineConfigPool + machineConfigPool: + name: image-registry + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + scopeType: WorkerPool + assessment: Completed + completion: 100 + summaries: + - type: Total + count: 8 + - type: Outdated + count: 0 + conditions: [] + - name: UpdateStatus can contain a Node insight + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + informers: [] + conditions: [] + workerPools: + - name: worker + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: Node + node: + name: node-42 + resource: + resource: nodes + name: node-42 + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + scopeType: WorkerPool + version: 4.18.0 + estToComplete: 42m + message: "Unschedulable | Disk Pressure" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Draining + message: "Node is draining" + - type: Degraded + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: AsExpected + message: "All is well" + - type: Available + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: MultipleReasons + message: "Unschedulable | Disk Pressure" + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + informers: [] + conditions: [] + workerPools: + - name: worker + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: Node + node: + name: node-42 + resource: + resource: nodes + name: node-42 + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + scopeType: WorkerPool + version: 4.18.0 + estToComplete: 42m + message: "Unschedulable | Disk Pressure" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Draining + message: "Node is draining" + - type: Degraded + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: AsExpected + message: "All is well" + - type: Available + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: MultipleReasons + message: "Unschedulable | Disk Pressure" + + - name: UpdateStatus can contain a Health insight + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + informers: + - name: update-status-controller + insights: + - uid: "4331" + acquiredAt: "2021-01-01T00:00:00Z" + type: Health + health: + startedAt: "2021-01-01T00:00:00Z" + scope: + type: ControlPlane + resources: + - group: config.openshift.io + resource: clusterversions + name: version + - resource: nodes + name: node-42 + impact: + level: Error + type: Cluster Capacity + summary: Something that involves a CV and node-42 and affects capacity + description: Potentially longer description of the issue + remediation: + reference: https://access.redhat.com/solutions/1234 + estimatedFinish: "2021-01-01T02:00:00Z" + conditions: [] + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + informers: + - name: update-status-controller + insights: + - uid: "4331" + acquiredAt: "2021-01-01T00:00:00Z" + type: Health + health: + startedAt: "2021-01-01T00:00:00Z" + scope: + type: ControlPlane + resources: + - group: config.openshift.io + resource: clusterversions + name: version + - resource: nodes + name: node-42 + impact: + level: Error + type: Cluster Capacity + summary: Something that involves a CV and node-42 and affects capacity + description: Potentially longer description of the issue + remediation: + reference: https://access.redhat.com/solutions/1234 + estimatedFinish: "2021-01-01T02:00:00Z" + conditions: [] From 67158c4d459b6c3dad26697659b40ff922009ede Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 15 Oct 2024 17:38:57 +0200 Subject: [PATCH 22/45] status: small fixes motivated by tests --- update/v1alpha1/types_update_status_progress.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go index 0153ea849c2..173873f9243 100644 --- a/update/v1alpha1/types_update_status_progress.go +++ b/update/v1alpha1/types_update_status_progress.go @@ -87,7 +87,7 @@ type Version struct { // +kubebuilder:validation:Required // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=64 - Version string `json:"version,omitempty"` + Version string `json:"version"` // metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional // and when not provided, the metadata item has boolean semantics (presence indicates true) @@ -100,7 +100,7 @@ type Version struct { type VersionMetadata struct { // key is the name of this metadata value // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=installation;partial;architecture + // +kubebuilder:validation:Enum=Installation;Partial;Architecture Key VersionMetadataKey `json:"key"` // +optional @@ -325,6 +325,11 @@ type NodeStatusInsight struct { // +kubebuilder:validation:Required PoolResource PoolResourceRef `json:"poolResource"` + // scopeType describes whether the node belongs to control plane or a worker pool + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=ControlPlane;WorkerPool + Scope ScopeType `json:"scopeType"` + // version is the version of the node, when known // +optional // +kubebuilder:validation:Type=string From 1af316b10a67ee5e562e7347622ef4e83fcf1482 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 22 Oct 2024 16:08:23 +0200 Subject: [PATCH 23/45] status: minor reason renames --- update/v1alpha1/types_update_status.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index f5b226ff0bb..65feda20b3b 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -107,14 +107,14 @@ type ControlPlaneUpdatingReason string const ( // ClusterVersionProgressing is used for Updating=True set because we observed a ClusterVersion resource to // have Progressing=True condition - ReasonClusterVersionProgressing ControlPlaneUpdatingReason = "ClusterVersionProgressing" + ControlPlaneClusterVersionProgressing ControlPlaneUpdatingReason = "ClusterVersionProgressing" // ClusterVersionNotProgressing is used for Updating=False set because we observed a ClusterVersion resource to // have Progressing=False condition - ReasonClusterVersionNotProgressing ControlPlaneUpdatingReason = "ClusterVersionNotProgressing" + ControlPlaneClusterVersionNotProgressing ControlPlaneUpdatingReason = "ClusterVersionNotProgressing" // CannotDetermineUpdating is used with Updating=Unknown. This covers many different actual reasons such as // missing or Unknown Progressing condition on ClusterVersion, but it does not seem useful to track the individual // reasons to that granularity for Updating=Unknown - ReasonClusterVersionCannotDetermine ControlPlaneUpdatingReason = "CannotDetermineUpdating" + ControlPlaneCannotDetermineUpdating ControlPlaneUpdatingReason = "CannotDetermineUpdating" ) // Pool contains a summary and insights related to a node pool update From a8284a5fe0048f04890f904afaadd77f8e500cbb Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 17 Dec 2024 17:21:11 +0100 Subject: [PATCH 24/45] status: fix MCP status insight godoc --- update/v1alpha1/types_update_status_progress.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go index 173873f9243..c78a5a2fe7c 100644 --- a/update/v1alpha1/types_update_status_progress.go +++ b/update/v1alpha1/types_update_status_progress.go @@ -205,7 +205,7 @@ const ( ClusterOperatorHealthyReasonCannotDetermine ClusterOperatorHealthyReason = "CannotDetermine" ) -// ClusterVersionStatusInsight reports the state of a MachineConfigPool resource during the update +// MachineConfigPoolStatusInsight reports the state of a MachineConfigPool resource during the update type MachineConfigPoolStatusInsight struct { // name is the name of the machine config pool // +kubebuilder:validation:Required From b36388d3372f628245669012b599610b895cc06a Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Thu, 19 Dec 2024 17:07:08 +0100 Subject: [PATCH 25/45] status: make namespaced Initially `UpdateStatus` was made namespaces to accomodate HCP more easily, but recently it seems the org has established a practice where HCP resources have specialized variants. We have also identified some differences in how the API will need to behave in HCP, so it makes sense to make the API cluster-scoped in standalone, and in the future we will have a HCP-specific namespaced variant. --- update/v1alpha1/types_update_status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 65feda20b3b..0a95d21aa73 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -12,7 +12,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +kubebuilder:object:root=true // +kubebuilder:subresource:status // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:resource:path=updatestatuses,scope=Namespaced +// +kubebuilder:resource:path=updatestatuses,scope=Cluster // +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2012 // +openshift:file-pattern=cvoRunLevel=0000_00,operatorName=cluster-version-operator,operatorOrdering=02 // +openshift:enable:FeatureGate=UpgradeStatus From eabdd9d267268d6c1c97b9047d4b7e2ca77db265 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Mon, 20 Jan 2025 16:38:56 +0100 Subject: [PATCH 26/45] `make lint-fix` Mostly just fixed: - `kubebuilder:validation:Required` -> `required` - `patchStrategy=merge, patchMergeKey=type` in conditions --- update/v1alpha1/types_update_status.go | 34 ++++++----- update/v1alpha1/types_update_status_health.go | 16 ++--- .../v1alpha1/types_update_status_progress.go | 60 +++++++++++-------- 3 files changed, 62 insertions(+), 48 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 0a95d21aa73..6c421b6a2cd 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -24,7 +24,7 @@ type UpdateStatus struct { // spec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold // configuration to drive what information is surfaced and how - // +kubebuilder:validation:Required + // +required Spec UpdateStatusSpec `json:"spec"` // +optional Status UpdateStatusStatus `json:"status"` @@ -41,7 +41,7 @@ type UpdateStatusSpec struct { // update informers type UpdateStatusStatus struct { // controlPlane contains a summary and insights related to the control plane update - // +kubebuilder:validation:Required + // +required ControlPlane ControlPlane `json:"controlPlane"` // workerPools contains summaries and insights related to the worker pools update @@ -54,7 +54,9 @@ type UpdateStatusStatus struct { // +listType=map // +listMapKey=type // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` + // +patchStrategy=merge + // +patchMergeKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // ControlPlane contains a summary and insights related to the control plane update @@ -66,7 +68,7 @@ type ControlPlane struct { // only the "correct" resource types to be referenced (here, ClusterVersion and HostedCluster). However, because we // use resource references in many places and this API is intended to be consumed by clients, not produced, consistency // seems to be more valuable than type safety for producers. - // +kubebuilder:validation:Required + // +required Resource ResourceRef `json:"resource"` // poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field @@ -89,7 +91,9 @@ type ControlPlane struct { // +listType=map // +listMapKey=type // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` + // +patchStrategy=merge + // +patchMergeKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // ControlPlaneConditionType are types of conditions that can be reported on control plane level @@ -120,7 +124,7 @@ const ( // Pool contains a summary and insights related to a node pool update type Pool struct { // name is the name of the pool - // +kubebuilder:validation:Required + // +required Name string `json:"name"` // resource is the resource that represents the pool @@ -129,7 +133,7 @@ type Pool struct { // only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use // resource references in many places and this API is intended to be consumed by clients, not produced, consistency // seems to be more valuable than type safety for producers. - // +kubebuilder:validation:Required + // +required Resource PoolResourceRef `json:"resource"` // informers is a list of insight producers, each carries a list of insights @@ -142,13 +146,15 @@ type Pool struct { // +listType=map // +listMapKey=type // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` + // +patchStrategy=merge + // +patchMergeKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // Informer is an insight producer identified by a name, carrying a list of insights it produced type Informer struct { // name is the name of the insight producer - // +kubebuilder:validation:Required + // +required Name string `json:"name"` // insights is a list of insights produced by this producer @@ -161,12 +167,12 @@ type Informer struct { // Insight is a unique piece of either status/progress or update health information produced by update informer type Insight struct { // uid identifies the insight over time - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Type=string UID string `json:"uid"` // acquiredAt is the time when the data was acquired by the producer - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time AcquiredAt metav1.Time `json:"acquiredAt"` @@ -178,7 +184,7 @@ type Insight struct { type InsightUnion struct { // type identifies the type of the update insight // +unionDiscriminator - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;Health Type InsightType `json:"type"` @@ -246,11 +252,11 @@ type ResourceRef struct { Group string `json:"group,omitempty"` // resource of object being referenced - // +kubebuilder:validation:Required + // +required Resource string `json:"resource"` // name of the object being referenced - // +kubebuilder:validation:Required + // +required Name string `json:"name"` // namespace of the object being referenced, if any diff --git a/update/v1alpha1/types_update_status_health.go b/update/v1alpha1/types_update_status_health.go index 4ffc50987a7..3dd63d4169e 100644 --- a/update/v1alpha1/types_update_status_health.go +++ b/update/v1alpha1/types_update_status_health.go @@ -6,17 +6,17 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // of the cluster or an update type HealthInsight struct { // startedAt is the time when the condition reported by the insight started - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time StartedAt metav1.Time `json:"startedAt"` // scope is list of objects involved in the insight - // +kubebuilder:validation:Required + // +required Scope InsightScope `json:"scope"` // impact describes the impact the reported condition has on the cluster or update - // +kubebuilder:validation:Required + // +required Impact InsightImpact `json:"impact"` // remediation contains information about how to resolve or prevent the reported condition @@ -26,7 +26,7 @@ type HealthInsight struct { // InsightScope is a list of resources involved in the insight type InsightScope struct { // type is either ControlPlane or WorkerPool - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Type ScopeType `json:"type"` @@ -50,17 +50,17 @@ const ( // InsightImpact describes the impact the reported condition has on the cluster or update type InsightImpact struct { // level is the severity of the impact - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Enum=Unknown;Info;Warning;Error;Critical Level InsightImpactLevel `json:"level"` // type is the type of the impact - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Enum=None;Unknown;API Availability;Cluster Capacity;Application Availability;Application Outage;Data Loss;Update Speed;Update Stalled Type InsightImpactType `json:"type"` // summary is a short summary of the impact - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Type=string Summary string `json:"summary"` @@ -113,7 +113,7 @@ const ( // InsightRemediation contains information about how to resolve or prevent the reported condition type InsightRemediation struct { // reference is a URL where administrators can find information to resolve or prevent the reported condition - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=uri Reference string `json:"reference"` diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go index c78a5a2fe7c..5743886e8c2 100644 --- a/update/v1alpha1/types_update_status_progress.go +++ b/update/v1alpha1/types_update_status_progress.go @@ -11,25 +11,25 @@ type ClusterVersionStatusInsight struct { // resource name (because the rest is implied by status insight type). However, because we use resource references in // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable // than type safety for producers. - // +kubebuilder:validation:Required + // +required Resource ResourceRef `json:"resource"` // assessment is the assessment of the control plane update process - // +kubebuilder:validation:Required + // +required Assessment ControlPlaneAssessment `json:"assessment"` // versions contains the original and target versions of the upgrade - // +kubebuilder:validation:Required + // +required Versions ControlPlaneUpdateVersions `json:"versions"` // completion is a percentage of the update completion (0-100) - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 Completion int32 `json:"completion"` // startedAt is the time when the update started - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time StartedAt metav1.Time `json:"startedAt"` @@ -50,7 +50,9 @@ type ClusterVersionStatusInsight struct { // +listType=map // +listMapKey=type // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` + // +patchStrategy=merge + // +patchMergeKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // ControlPlaneAssessment is the assessment of the control plane update process @@ -72,11 +74,11 @@ type ControlPlaneUpdateVersions struct { // previous is the version of the control plane before the update. When the cluster is being installed // for the first time, the version will have a placeholder value like '' and the target version // will have a boolean installation=true metadata - // +kubebuilder:validation:Required + // +required Previous Version `json:"previous"` // target is the version of the control plane after the update - // +kubebuilder:validation:Required + // +required Target Version `json:"target"` } @@ -84,7 +86,7 @@ type ControlPlaneUpdateVersions struct { type Version struct { // version is a semantic version string, or a placeholder '' for the special case where this // is a "previous" version in a new installation - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=64 Version string `json:"version"` @@ -99,7 +101,7 @@ type Version struct { type VersionMetadata struct { // key is the name of this metadata value - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Enum=Installation;Partial;Architecture Key VersionMetadataKey `json:"key"` @@ -148,7 +150,7 @@ const ( // component update in standalone clusters), during the update type ClusterOperatorStatusInsight struct { // name is the name of the operator - // +kubebuilder:validation:Required + // +required Name string `json:"name"` // resource is the ClusterOperator resource that represents the operator @@ -157,14 +159,16 @@ type ClusterOperatorStatusInsight struct { // resource name (because the rest is implied by status insight type). However, because we use resource references in // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable // than type safety for producers. - // +kubebuilder:validation:Required + // +required Resource ResourceRef `json:"resource"` // conditions provide details about the operator // +listType=map // +listMapKey=type // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` + // +patchStrategy=merge + // +patchMergeKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // ClusterOperatorStatusInsightConditionType are types of conditions that can be reported on ClusterOperator status insights @@ -208,7 +212,7 @@ const ( // MachineConfigPoolStatusInsight reports the state of a MachineConfigPool resource during the update type MachineConfigPoolStatusInsight struct { // name is the name of the machine config pool - // +kubebuilder:validation:Required + // +required Name string `json:"name"` // resource is the MachineConfigPool resource that represents the pool @@ -217,20 +221,20 @@ type MachineConfigPoolStatusInsight struct { // resource name (because the rest is implied by status insight type). However, because we use resource references in // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable // than type safety for producers. - // +kubebuilder:validation:Required + // +required Resource PoolResourceRef `json:"resource"` // scopeType describes whether the pool is a control plane or a worker pool - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Scope ScopeType `json:"scopeType"` // assessment is the assessment of the machine config pool update process - // +kubebuilder:validation:Required + // +required Assessment PoolAssessment `json:"assessment"` // completion is a percentage of the update completion (0-100) - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 Completion int32 `json:"completion"` @@ -245,7 +249,9 @@ type MachineConfigPoolStatusInsight struct { // +listType=map // +listMapKey=type // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` + // +patchStrategy=merge + // +patchMergeKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // PoolAssessment is the assessment of the node pool update process @@ -268,12 +274,12 @@ const ( // NodeSummary is a count of nodes matching certain criteria (e.g. updated, degraded, etc.) type NodeSummary struct { // type is the type of the summary - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Enum=Total;Available;Progressing;Outdated;Draining;Excluded;Degraded Type NodeSummaryType `json:"type"` // count is the number of nodes matching the criteria - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Minimum=0 Count int32 `json:"count"` } @@ -304,7 +310,7 @@ const ( // NodeStatusInsight reports the state of a Node during the update type NodeStatusInsight struct { // name is the name of the node - // +kubebuilder:validation:Required + // +required Name string `json:"name"` // resource is the Node resource that represents the node @@ -313,7 +319,7 @@ type NodeStatusInsight struct { // resource name (because the rest is implied by status insight type). However, because we use resource references in // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable // than type safety for producers. - // +kubebuilder:validation:Required + // +required Resource ResourceRef `json:"resource"` // poolResource is the resource that represents the pool the node is a member of @@ -322,11 +328,11 @@ type NodeStatusInsight struct { // only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use // resource references in many places and this API is intended to be consumed by clients, not produced, consistency // seems to be more valuable than type safety for producers. - // +kubebuilder:validation:Required + // +required PoolResource PoolResourceRef `json:"poolResource"` // scopeType describes whether the node belongs to control plane or a worker pool - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Scope ScopeType `json:"scopeType"` @@ -348,7 +354,9 @@ type NodeStatusInsight struct { // +listType=map // +listMapKey=type // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` + // +patchStrategy=merge + // +patchMergeKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // NodeStatusInsightConditionType are types of conditions that can be reported on Node status insights From 26f96ef3c7a540a3fda741003a0c3955891bc14d Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Mon, 20 Jan 2025 17:12:41 +0100 Subject: [PATCH 27/45] status: fix lint warnings not fixed by `make lint-fix` --- update/v1alpha1/types_update_status.go | 68 ++++++++++------- update/v1alpha1/types_update_status_health.go | 1 + .../v1alpha1/types_update_status_progress.go | 73 ++++++++++--------- 3 files changed, 82 insertions(+), 60 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 6c421b6a2cd..dcb1e750221 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -19,13 +19,16 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +kubebuilder:metadata:annotations="description=Provides health and status information about OpenShift cluster updates." // +kubebuilder:metadata:annotations="displayName=UpdateStatuses" type UpdateStatus struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` // spec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold // configuration to drive what information is surfaced and how // +required Spec UpdateStatusSpec `json:"spec"` + // status exposes the health and status of the ongoing cluster update // +optional Status UpdateStatusStatus `json:"status"` } @@ -40,6 +43,14 @@ type UpdateStatusSpec struct { // UpdateStatusStatus is the API about in-progress updates. It aggregates and summarizes UpdateInsights produced by // update informers type UpdateStatusStatus struct { + // conditions provide details about the controller operational matters + // +listType=map + // +listMapKey=type + // +patchStrategy=merge + // +patchMergeKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + // controlPlane contains a summary and insights related to the control plane update // +required ControlPlane ControlPlane `json:"controlPlane"` @@ -47,20 +58,22 @@ type UpdateStatusStatus struct { // workerPools contains summaries and insights related to the worker pools update // +listType=map // +listMapKey=name + // +patchStrategy=merge + // +patchMergeKey=name // +optional - WorkerPools []Pool `json:"workerPools,omitempty"` + WorkerPools []Pool `json:"workerPools,omitempty" patchStrategy:"merge" patchMergeKey:"name"` +} - // conditions provide details about the controller operational matters +// ControlPlane contains a summary and insights related to the control plane update +type ControlPlane struct { + // conditions provides details about the control plane update // +listType=map // +listMapKey=type - // +optional // +patchStrategy=merge // +patchMergeKey=type + // +optional Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` -} -// ControlPlane contains a summary and insights related to the control plane update -type ControlPlane struct { // resource is the resource that represents the control plane. It will typically be a ClusterVersion resource // in standalone OpenShift and HostedCluster in Hosted Control Planes. // @@ -84,16 +97,10 @@ type ControlPlane struct { // informers is a list of insight producers, each carries a list of insights relevant for control plane // +listType=map // +listMapKey=name - // +optional - Informers []Informer `json:"informers,omitempty"` - - // conditions provides details about the control plane update - // +listType=map - // +listMapKey=type - // +optional // +patchStrategy=merge - // +patchMergeKey=type - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + // +patchMergeKey=name + // +optional + Informers []Informer `json:"informers,omitempty" patchStrategy:"merge" patchMergeKey:"name"` } // ControlPlaneConditionType are types of conditions that can be reported on control plane level @@ -123,6 +130,14 @@ const ( // Pool contains a summary and insights related to a node pool update type Pool struct { + // conditions provide details about the pool + // +listType=map + // +listMapKey=type + // +patchStrategy=merge + // +patchMergeKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + // name is the name of the pool // +required Name string `json:"name"` @@ -139,16 +154,10 @@ type Pool struct { // informers is a list of insight producers, each carries a list of insights // +listType=map // +listMapKey=name - // +optional - Informers []Informer `json:"informers,omitempty"` - - // conditions provide details about the pool - // +listType=map - // +listMapKey=type - // +optional // +patchStrategy=merge - // +patchMergeKey=type - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + // +patchMergeKey=name + // +optional + Informers []Informer `json:"informers,omitempty" patchStrategy:"merge" patchMergeKey:"name"` } // Informer is an insight producer identified by a name, carrying a list of insights it produced @@ -158,10 +167,12 @@ type Informer struct { Name string `json:"name"` // insights is a list of insights produced by this producer - // +optional // +listType=map // +listMapKey=uid - Insights []Insight `json:"insights,omitempty"` + // +patchStrategy=merge + // +patchMergeKey=uid + // +optional + Insights []Insight `json:"insights,omitempty" patchStrategy:"merge" patchMergeKey:"uid"` } // Insight is a unique piece of either status/progress or update health information produced by update informer @@ -277,7 +288,10 @@ type PoolResourceRef struct { // +openshift:compatibility-gen:level=4 type UpdateStatusList struct { metav1.TypeMeta `json:",inline"` + // +optional metav1.ListMeta `json:"metadata"` + // items is a list of UpdateStatus resources + // +optional Items []UpdateStatus `json:"items"` } diff --git a/update/v1alpha1/types_update_status_health.go b/update/v1alpha1/types_update_status_health.go index 3dd63d4169e..61dcce585d3 100644 --- a/update/v1alpha1/types_update_status_health.go +++ b/update/v1alpha1/types_update_status_health.go @@ -20,6 +20,7 @@ type HealthInsight struct { Impact InsightImpact `json:"impact"` // remediation contains information about how to resolve or prevent the reported condition + // +required Remediation InsightRemediation `json:"remediation"` } diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go index 5743886e8c2..8e2b2b94a66 100644 --- a/update/v1alpha1/types_update_status_progress.go +++ b/update/v1alpha1/types_update_status_progress.go @@ -5,6 +5,14 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // ClusterVersionStatusInsight reports the state of a ClusterVersion resource (which represents a control plane // update in standalone clusters), during the update. type ClusterVersionStatusInsight struct { + // conditions provides detailed observed conditions about ClusterVersion + // +listType=map + // +listMapKey=type + // +patchStrategy=merge + // +patchMergeKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + // resource is the ClusterVersion resource that represents the control plane // // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to @@ -45,14 +53,6 @@ type ClusterVersionStatusInsight struct { // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time EstimatedCompletedAt *metav1.Time `json:"estimatedCompletedAt,omitempty"` - - // conditions provides detailed observed conditions about ClusterVersion - // +listType=map - // +listMapKey=type - // +optional - // +patchStrategy=merge - // +patchMergeKey=type - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // ControlPlaneAssessment is the assessment of the control plane update process @@ -95,16 +95,21 @@ type Version struct { // and when not provided, the metadata item has boolean semantics (presence indicates true) // +listType=map // +listMapKey=key + // +patchStrategy=merge + // +patchMergeKey=key // +optional - Metadata []VersionMetadata `json:"metadata,omitempty"` + Metadata []VersionMetadata `json:"metadata,omitempty" patchStrategy:"merge" patchMergeKey:"key"` } +// VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata +// have boolean semantics (true when present, false when absent) type VersionMetadata struct { // key is the name of this metadata value // +required // +kubebuilder:validation:Enum=Installation;Partial;Architecture Key VersionMetadataKey `json:"key"` + // value is the value for the metadata // +optional // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=32 @@ -149,6 +154,14 @@ const ( // ClusterOperatorStatusInsight reports the state of a ClusterOperator resource (which represents a control plane // component update in standalone clusters), during the update type ClusterOperatorStatusInsight struct { + // conditions provide details about the operator + // +listType=map + // +listMapKey=type + // +patchStrategy=merge + // +patchMergeKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + // name is the name of the operator // +required Name string `json:"name"` @@ -161,14 +174,6 @@ type ClusterOperatorStatusInsight struct { // than type safety for producers. // +required Resource ResourceRef `json:"resource"` - - // conditions provide details about the operator - // +listType=map - // +listMapKey=type - // +optional - // +patchStrategy=merge - // +patchMergeKey=type - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // ClusterOperatorStatusInsightConditionType are types of conditions that can be reported on ClusterOperator status insights @@ -211,6 +216,14 @@ const ( // MachineConfigPoolStatusInsight reports the state of a MachineConfigPool resource during the update type MachineConfigPoolStatusInsight struct { + // conditions provide details about the machine config pool update + // +listType=map + // +listMapKey=type + // +patchStrategy=merge + // +patchMergeKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + // name is the name of the machine config pool // +required Name string `json:"name"` @@ -242,16 +255,10 @@ type MachineConfigPoolStatusInsight struct { // summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.) // +listType=map // +listMapKey=type - // +optional - Summaries []NodeSummary `json:"summaries,omitempty"` - - // conditions provide details about the machine config pool update - // +listType=map - // +listMapKey=type - // +optional // +patchStrategy=merge // +patchMergeKey=type - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + // +optional + Summaries []NodeSummary `json:"summaries,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // PoolAssessment is the assessment of the node pool update process @@ -309,6 +316,14 @@ const ( // NodeStatusInsight reports the state of a Node during the update type NodeStatusInsight struct { + // conditions provides details about the control plane update + // +listType=map + // +listMapKey=type + // +patchStrategy=merge + // +patchMergeKey=type + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + // name is the name of the node // +required Name string `json:"name"` @@ -349,14 +364,6 @@ type NodeStatusInsight struct { // message is a short human-readable message about the node update status // +optional Message string `json:"message,omitempty"` - - // conditions provides details about the control plane update - // +listType=map - // +listMapKey=type - // +optional - // +patchStrategy=merge - // +patchMergeKey=type - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } // NodeStatusInsightConditionType are types of conditions that can be reported on Node status insights From e71150da55df20e46194784d72c39e255ed15261 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 21 Jan 2025 17:22:38 +0100 Subject: [PATCH 28/45] status: handle installation corner case with CEL validation --- update/v1alpha1/types_update_status_progress.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go index 8e2b2b94a66..6f85529c2fd 100644 --- a/update/v1alpha1/types_update_status_progress.go +++ b/update/v1alpha1/types_update_status_progress.go @@ -72,22 +72,25 @@ const ( // ControlPlaneUpdateVersions contains the original and target versions of the upgrade type ControlPlaneUpdateVersions struct { // previous is the version of the control plane before the update. When the cluster is being installed - // for the first time, the version will have a placeholder value like '' and the target version - // will have a boolean installation=true metadata + // for the first time, the version will have a placeholder value '' and carry 'Installation' metadata // +required + // +kubebuilder:validation:XValidation:rule="self.version == '' ? (has(self.metadata) && self.metadata.exists(m, m.key == 'Installation')) : !(has(self.metadata) && self.metadata.exists(m, m.key == 'Installation'))",message="previous version must be '' iff marked with Installation metadata" Previous Version `json:"previous"` - // target is the version of the control plane after the update + // target is the version of the control plane after the update. It may never be '' or have `Installation` metadata // +required + // +kubebuilder:validation:XValidation:rule="self.version != '' && !(has(self.metadata) && self.metadata.exists(m, m.key == 'Installation'))",message="target version must not be '' or have Installation metadata" Target Version `json:"target"` } // Version describes a version involved in an update, typically on one side of an update edge type Version struct { // version is a semantic version string, or a placeholder '' for the special case where this - // is a "previous" version in a new installation + // is a "previous" version in a new installation, in which case the metadata must contain an item + // with key 'Installation' // +required // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=5 // +kubebuilder:validation:MaxLength=64 Version string `json:"version"` From 228944e2ca6242e197ce2f0422ed0b14c4f69080 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 21 Jan 2025 17:56:25 +0100 Subject: [PATCH 29/45] status: add maxLength and maxItems validations --- update/v1alpha1/types_update_status.go | 28 +++++++++++++++++++ update/v1alpha1/types_update_status_health.go | 5 ++++ .../v1alpha1/types_update_status_progress.go | 23 +++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index dcb1e750221..d954d511e25 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -49,6 +49,7 @@ type UpdateStatusStatus struct { // +patchStrategy=merge // +patchMergeKey=type // +optional + // +kubebuilder:validation:maxItems=10 Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // controlPlane contains a summary and insights related to the control plane update @@ -61,6 +62,7 @@ type UpdateStatusStatus struct { // +patchStrategy=merge // +patchMergeKey=name // +optional + // +kubebuilder:validation:maxItems=64 WorkerPools []Pool `json:"workerPools,omitempty" patchStrategy:"merge" patchMergeKey:"name"` } @@ -100,6 +102,7 @@ type ControlPlane struct { // +patchStrategy=merge // +patchMergeKey=name // +optional + // +kubebuilder:validation:maxItems=32 Informers []Informer `json:"informers,omitempty" patchStrategy:"merge" patchMergeKey:"name"` } @@ -140,6 +143,10 @@ type Pool struct { // name is the name of the pool // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` Name string `json:"name"` // resource is the resource that represents the pool @@ -157,6 +164,7 @@ type Pool struct { // +patchStrategy=merge // +patchMergeKey=name // +optional + // +kubebuilder:validation:maxItems=32 Informers []Informer `json:"informers,omitempty" patchStrategy:"merge" patchMergeKey:"name"` } @@ -164,6 +172,10 @@ type Pool struct { type Informer struct { // name is the name of the insight producer // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` Name string `json:"name"` // insights is a list of insights produced by this producer @@ -172,6 +184,7 @@ type Informer struct { // +patchStrategy=merge // +patchMergeKey=uid // +optional + // +kubebuilder:validation:maxItems=4096 Insights []Insight `json:"insights,omitempty" patchStrategy:"merge" patchMergeKey:"uid"` } @@ -180,6 +193,9 @@ type Insight struct { // uid identifies the insight over time // +required // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` UID string `json:"uid"` // acquiredAt is the time when the data was acquired by the producer @@ -260,18 +276,29 @@ const ( type ResourceRef struct { // group of the object being referenced, if any // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=253 Group string `json:"group,omitempty"` // resource of object being referenced // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:MinLength=1 Resource string `json:"resource"` // name of the object being referenced // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:MinLength=1 Name string `json:"name"` // namespace of the object being referenced, if any // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` Namespace string `json:"namespace,omitempty"` } @@ -293,5 +320,6 @@ type UpdateStatusList struct { // items is a list of UpdateStatus resources // +optional + // +kubebuilder:validation:MaxItems=32 Items []UpdateStatus `json:"items"` } diff --git a/update/v1alpha1/types_update_status_health.go b/update/v1alpha1/types_update_status_health.go index 61dcce585d3..9e89a80cb0e 100644 --- a/update/v1alpha1/types_update_status_health.go +++ b/update/v1alpha1/types_update_status_health.go @@ -34,6 +34,7 @@ type InsightScope struct { // resources is a list of resources involved in the insight, of any group/kind // +optional // +listType=atomic + // +kubebuilder:validation:maxItems=64 Resources []ResourceRef `json:"resources,omitempty"` } @@ -63,11 +64,14 @@ type InsightImpact struct { // summary is a short summary of the impact // +required // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=256 + // +kubebuilder:validation:MinLength=1 Summary string `json:"summary"` // description is a human-oriented, possibly longer-form description of the condition reported by the insight // +optional // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=4096 Description string `json:"description,omitempty"` } @@ -117,6 +121,7 @@ type InsightRemediation struct { // +required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=uri + // +kubebuilder:validation:MaxLength=512 Reference string `json:"reference"` // estimatedFinish is the estimated time when the informer expects the condition to be resolved, if applicable. diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go index 6f85529c2fd..3be80ee41c7 100644 --- a/update/v1alpha1/types_update_status_progress.go +++ b/update/v1alpha1/types_update_status_progress.go @@ -24,6 +24,7 @@ type ClusterVersionStatusInsight struct { // assessment is the assessment of the control plane update process // +required + // +kubebuilder:validation:Enum=Unknown;Progressing;Completed;Degraded Assessment ControlPlaneAssessment `json:"assessment"` // versions contains the original and target versions of the upgrade @@ -101,6 +102,7 @@ type Version struct { // +patchStrategy=merge // +patchMergeKey=key // +optional + // +kubebuilder:validation:MaxItems=10 Metadata []VersionMetadata `json:"metadata,omitempty" patchStrategy:"merge" patchMergeKey:"key"` } @@ -163,10 +165,15 @@ type ClusterOperatorStatusInsight struct { // +patchStrategy=merge // +patchMergeKey=type // +optional + // +kubebuilder:validation:MaxItems=10 Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // name is the name of the operator // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:Pattern=`^[a-z0-9-]+$` Name string `json:"name"` // resource is the ClusterOperator resource that represents the operator @@ -225,10 +232,15 @@ type MachineConfigPoolStatusInsight struct { // +patchStrategy=merge // +patchMergeKey=type // +optional + // +kubebuilder:validation:MaxItems=10 Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // name is the name of the machine config pool // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:Pattern=`^[a-z0-9-]+$` Name string `json:"name"` // resource is the MachineConfigPool resource that represents the pool @@ -247,6 +259,7 @@ type MachineConfigPoolStatusInsight struct { // assessment is the assessment of the machine config pool update process // +required + // +kubebuilder:validation:Enum=Pending;Completed;Degraded;Excluded;Progressing Assessment PoolAssessment `json:"assessment"` // completion is a percentage of the update completion (0-100) @@ -261,6 +274,7 @@ type MachineConfigPoolStatusInsight struct { // +patchStrategy=merge // +patchMergeKey=type // +optional + // +kubebuilder:validation:MaxItems=16 Summaries []NodeSummary `json:"summaries,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } @@ -291,6 +305,7 @@ type NodeSummary struct { // count is the number of nodes matching the criteria // +required // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=4096 Count int32 `json:"count"` } @@ -325,10 +340,14 @@ type NodeStatusInsight struct { // +patchStrategy=merge // +patchMergeKey=type // +optional + // +kubebuilder:validation:MaxItems=10 Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // name is the name of the node // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 Name string `json:"name"` // resource is the Node resource that represents the node @@ -357,15 +376,19 @@ type NodeStatusInsight struct { // version is the version of the node, when known // +optional // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=64 Version string `json:"version,omitempty"` // estToComplete is the estimated time to complete the update, when known // +optional // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=duration EstToComplete *metav1.Duration `json:"estToComplete,omitempty"` // message is a short human-readable message about the node update status // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MaxLength=100 Message string `json:"message,omitempty"` } From 1ccd8c79742efab067c061e2ce94487f9c482b17 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 21 Jan 2025 19:03:59 +0100 Subject: [PATCH 30/45] status: reduce maxItems on version metadata for CEL budget --- update/v1alpha1/types_update_status_progress.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go index 3be80ee41c7..b28b9cd1765 100644 --- a/update/v1alpha1/types_update_status_progress.go +++ b/update/v1alpha1/types_update_status_progress.go @@ -102,7 +102,7 @@ type Version struct { // +patchStrategy=merge // +patchMergeKey=key // +optional - // +kubebuilder:validation:MaxItems=10 + // +kubebuilder:validation:MaxItems=5 Metadata []VersionMetadata `json:"metadata,omitempty" patchStrategy:"merge" patchMergeKey:"key"` } From f04d7716934ad0dcb21d67c39f1d91410f2a202d Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 21 Jan 2025 19:04:30 +0100 Subject: [PATCH 31/45] status: add some negative API tests --- .../UpgradeStatus.yaml | 334 +++++++++++++++++- 1 file changed, 333 insertions(+), 1 deletion(-) diff --git a/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml b/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml index 58fd3256a2e..34b79da6652 100644 --- a/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml +++ b/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml @@ -14,7 +14,7 @@ tests: kind: UpdateStatus spec: {} onUpdate: - - name: UpdateStatus can contain a ClusterVersion insight + - name: UpdateStatus can contain a ClusterVersion insight for installation initial: | apiVersion: update.openshift.io/v1alpha1 kind: UpdateStatus @@ -116,6 +116,338 @@ tests: reason: ClusterVersionProgressing message: "Installing version 4.18.0" + - name: UpdateStatus can contain a ClusterVersion insight for update + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: master + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: 4.17.0 + metadata: + - key: Partial + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: master + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: 4.17.0 + metadata: + - key: Partial + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + + - name: UpdateStatus refuses invalid installation-like versions in ClusterVersion insights 1 + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: master + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + expectedStatusError: "Invalid value: \"object\": previous version must be '' iff marked with Installation metadata" + - name: UpdateStatus refuses invalid installation-like versions in ClusterVersion insights 2 + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: master + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: 4.17.0 + metadata: + - key: Installation + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + expectedStatusError: "Invalid value: \"object\": previous version must be '' iff marked with Installation metadata" + - name: UpdateStatus refuses invalid installation-like versions in ClusterVersion insights 3 + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: master + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: 4.17.0 + target: + version: + metadata: + - key: Installation + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + expectedStatusError: "Invalid value: \"object\": target version must not be '' or have Installation metadata" + - name: UpdateStatus refuses invalid installation-like versions in ClusterVersion insights 4 + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: master + informers: + - name: update-status-controller + insights: + - uid: "1234" + acquiredAt: "2021-01-01T00:00:00Z" + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: 4.17.0 + target: + version: 4.18.0 + metadata: + - key: Installation + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + expectedStatusError: "Invalid value: \"object\": target version must not be '' or have Installation metadata" - name: UpdateStatus can contain a ClusterOperator insight initial: | apiVersion: update.openshift.io/v1alpha1 From ee509de3ea760115d17537e8482f9dbc8d239b9c Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Thu, 23 Jan 2025 20:17:42 +0100 Subject: [PATCH 32/45] status: fixup excessive Enum= validations The (identical) rule markers present on both the field and the type alias caused the generated schema to be non-structural --- update/v1alpha1/types_update_status.go | 1 - update/v1alpha1/types_update_status_health.go | 3 --- update/v1alpha1/types_update_status_progress.go | 8 ++------ 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index d954d511e25..8d7ff91af22 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -212,7 +212,6 @@ type InsightUnion struct { // type identifies the type of the update insight // +unionDiscriminator // +required - // +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;Health Type InsightType `json:"type"` // clusterVersion is a status insight about the state of a control plane update, where diff --git a/update/v1alpha1/types_update_status_health.go b/update/v1alpha1/types_update_status_health.go index 9e89a80cb0e..21b31b044bc 100644 --- a/update/v1alpha1/types_update_status_health.go +++ b/update/v1alpha1/types_update_status_health.go @@ -28,7 +28,6 @@ type HealthInsight struct { type InsightScope struct { // type is either ControlPlane or WorkerPool // +required - // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Type ScopeType `json:"type"` // resources is a list of resources involved in the insight, of any group/kind @@ -53,12 +52,10 @@ const ( type InsightImpact struct { // level is the severity of the impact // +required - // +kubebuilder:validation:Enum=Unknown;Info;Warning;Error;Critical Level InsightImpactLevel `json:"level"` // type is the type of the impact // +required - // +kubebuilder:validation:Enum=None;Unknown;API Availability;Cluster Capacity;Application Availability;Application Outage;Data Loss;Update Speed;Update Stalled Type InsightImpactType `json:"type"` // summary is a short summary of the impact diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go index b28b9cd1765..9f39608ef94 100644 --- a/update/v1alpha1/types_update_status_progress.go +++ b/update/v1alpha1/types_update_status_progress.go @@ -24,7 +24,6 @@ type ClusterVersionStatusInsight struct { // assessment is the assessment of the control plane update process // +required - // +kubebuilder:validation:Enum=Unknown;Progressing;Completed;Degraded Assessment ControlPlaneAssessment `json:"assessment"` // versions contains the original and target versions of the upgrade @@ -57,6 +56,7 @@ type ClusterVersionStatusInsight struct { } // ControlPlaneAssessment is the assessment of the control plane update process +// +kubebuilder:validation:Enum=Unknown;Progressing;Completed;Degraded type ControlPlaneAssessment string const ( @@ -111,7 +111,6 @@ type Version struct { type VersionMetadata struct { // key is the name of this metadata value // +required - // +kubebuilder:validation:Enum=Installation;Partial;Architecture Key VersionMetadataKey `json:"key"` // value is the value for the metadata @@ -254,12 +253,10 @@ type MachineConfigPoolStatusInsight struct { // scopeType describes whether the pool is a control plane or a worker pool // +required - // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Scope ScopeType `json:"scopeType"` // assessment is the assessment of the machine config pool update process // +required - // +kubebuilder:validation:Enum=Pending;Completed;Degraded;Excluded;Progressing Assessment PoolAssessment `json:"assessment"` // completion is a percentage of the update completion (0-100) @@ -279,6 +276,7 @@ type MachineConfigPoolStatusInsight struct { } // PoolAssessment is the assessment of the node pool update process +// +kubebuilder:validation:Enum=Pending;Completed;Degraded;Excluded;Progressing type PoolAssessment string const ( @@ -299,7 +297,6 @@ const ( type NodeSummary struct { // type is the type of the summary // +required - // +kubebuilder:validation:Enum=Total;Available;Progressing;Outdated;Draining;Excluded;Degraded Type NodeSummaryType `json:"type"` // count is the number of nodes matching the criteria @@ -370,7 +367,6 @@ type NodeStatusInsight struct { // scopeType describes whether the node belongs to control plane or a worker pool // +required - // +kubebuilder:validation:Enum=ControlPlane;WorkerPool Scope ScopeType `json:"scopeType"` // version is the version of the node, when known From 7ca5398ca19fb489ad92d23c3573af0975293772 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Thu, 23 Jan 2025 20:46:53 +0100 Subject: [PATCH 33/45] status: break workerpool and controlplane structs I was running into trouble with CRD validation because of CEL budgets. The way the API is structured makes cardinatilities high because we need to allow high amouts of insights because of nodes. Then the hypothetical worst case leads to 32 worker pools, each with 16 informers reporting 1024 insights, all of which are `ClusterVersion` status insights which have a CEL that needs validation. Such scenario is purely hypothetical but compliance to budgets is enforced by the tools. The cardinality is so high because of the top-level worker pool list (32) so the problem can be solved by separating what insights can be present in which section of the API, which is what this commit does. Alternatively, we could flatten the `informers` layer and that way we would get rid of the `16` factor, and we would be able to limit the amount of insights reported by all informers that way. The informer source is not that important for API consumers but would make the API harder to work with on the producer side. --- update/v1alpha1/types_update_status.go | 102 +++++++++++++++--- update/v1alpha1/types_update_status_health.go | 2 +- .../v1alpha1/types_update_status_progress.go | 1 + 3 files changed, 88 insertions(+), 17 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 8d7ff91af22..bc916fa746b 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -49,7 +49,7 @@ type UpdateStatusStatus struct { // +patchStrategy=merge // +patchMergeKey=type // +optional - // +kubebuilder:validation:maxItems=10 + // +kubebuilder:validation:MaxItems=10 Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // controlPlane contains a summary and insights related to the control plane update @@ -62,7 +62,7 @@ type UpdateStatusStatus struct { // +patchStrategy=merge // +patchMergeKey=name // +optional - // +kubebuilder:validation:maxItems=64 + // +kubebuilder:validation:MaxItems=32 WorkerPools []Pool `json:"workerPools,omitempty" patchStrategy:"merge" patchMergeKey:"name"` } @@ -74,6 +74,7 @@ type ControlPlane struct { // +patchStrategy=merge // +patchMergeKey=type // +optional + // +kubebuilder:validation:MaxItems=10 Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // resource is the resource that represents the control plane. It will typically be a ClusterVersion resource @@ -102,8 +103,8 @@ type ControlPlane struct { // +patchStrategy=merge // +patchMergeKey=name // +optional - // +kubebuilder:validation:maxItems=32 - Informers []Informer `json:"informers,omitempty" patchStrategy:"merge" patchMergeKey:"name"` + // +kubebuilder:validation:MaxItems=16 + Informers []ControlPlaneInformer `json:"informers,omitempty" patchStrategy:"merge" patchMergeKey:"name"` } // ControlPlaneConditionType are types of conditions that can be reported on control plane level @@ -139,6 +140,7 @@ type Pool struct { // +patchStrategy=merge // +patchMergeKey=type // +optional + // +kubebuilder:validation:MaxItems=10 Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // name is the name of the pool @@ -164,12 +166,12 @@ type Pool struct { // +patchStrategy=merge // +patchMergeKey=name // +optional - // +kubebuilder:validation:maxItems=32 - Informers []Informer `json:"informers,omitempty" patchStrategy:"merge" patchMergeKey:"name"` + // +kubebuilder:validation:MaxItems=16 + Informers []WorkerPoolInformer `json:"informers,omitempty" patchStrategy:"merge" patchMergeKey:"name"` } -// Informer is an insight producer identified by a name, carrying a list of insights it produced -type Informer struct { +// ControlPlaneInformer is an insight producer identified by a name, carrying a list of insights it produced +type ControlPlaneInformer struct { // name is the name of the insight producer // +required // +kubebuilder:validation:Type=string @@ -184,12 +186,32 @@ type Informer struct { // +patchStrategy=merge // +patchMergeKey=uid // +optional - // +kubebuilder:validation:maxItems=4096 - Insights []Insight `json:"insights,omitempty" patchStrategy:"merge" patchMergeKey:"uid"` + // +kubebuilder:validation:MaxItems=128 + Insights []ControlPlaneInsight `json:"insights,omitempty" patchStrategy:"merge" patchMergeKey:"uid"` } -// Insight is a unique piece of either status/progress or update health information produced by update informer -type Insight struct { +// WorkerPoolInformer is an insight producer identified by a name, carrying a list of insights it produced +type WorkerPoolInformer struct { + // name is the name of the insight producer + // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` + Name string `json:"name"` + + // insights is a list of insights produced by this producer + // +listType=map + // +listMapKey=uid + // +patchStrategy=merge + // +patchMergeKey=uid + // +optional + // +kubebuilder:validation:MaxItems=1024 + Insights []WorkerPoolInsight `json:"insights,omitempty" patchStrategy:"merge" patchMergeKey:"uid"` +} + +// ControlPlaneInsight is a unique piece of either status/progress or update health information produced by update informer +type ControlPlaneInsight struct { // uid identifies the insight over time // +required // +kubebuilder:validation:Type=string @@ -204,14 +226,35 @@ type Insight struct { // +kubebuilder:validation:Format=date-time AcquiredAt metav1.Time `json:"acquiredAt"` - InsightUnion `json:",inline"` + ControlPlaneInsightUnion `json:",inline"` } -// InsightUnion is the discriminated union of all insights types, identified by type field -type InsightUnion struct { +// WorkerPoolInsight is a unique piece of either status/progress or update health information produced by update informer +type WorkerPoolInsight struct { + // uid identifies the insight over time + // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` + UID string `json:"uid"` + + // acquiredAt is the time when the data was acquired by the producer + // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=date-time + AcquiredAt metav1.Time `json:"acquiredAt"` + + WorkerPoolInsightUnion `json:",inline"` +} + +// ControlPlaneInsightUnion is the discriminated union of all insights types that can be reported for the control plane, +// identified by type field +type ControlPlaneInsightUnion struct { // type identifies the type of the update insight // +unionDiscriminator // +required + // +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;Health Type InsightType `json:"type"` // clusterVersion is a status insight about the state of a control plane update, where @@ -245,9 +288,36 @@ type InsightUnion struct { HealthInsight *HealthInsight `json:"health,omitempty"` } +// WorkerPoolInsightUnion is the discriminated union of insights types that can be reported for a worker pool, +// identified by type field +type WorkerPoolInsightUnion struct { + // type identifies the type of the update insight + // +unionDiscriminator + // +required + // +kubebuilder:validation:Enum=MachineConfigPool;Node;Health + Type InsightType `json:"type"` + + // machineConfigPool is a status insight about the state of a worker pool update, where the worker pool + // is represented by a MachineConfigPool resource + // +optional + // +unionMember + MachineConfigPoolStatusInsight *MachineConfigPoolStatusInsight `json:"machineConfigPool,omitempty"` + + // node is a status insight about the state of a worker node update, where the worker node is represented + // by a Node resource + // +optional + // +unionMember + NodeStatusInsight *NodeStatusInsight `json:"node,omitempty"` + + // health is a generic health insight about the update. It does not represent a status of any specific + // resource but surfaces actionable information about the health of the cluster or an update + // +optional + // +unionMember + HealthInsight *HealthInsight `json:"health,omitempty"` +} + // InsightType identifies the type of the update insight as either one of the resource-specific status insight, // or a generic health insight -// +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;Health type InsightType string const ( diff --git a/update/v1alpha1/types_update_status_health.go b/update/v1alpha1/types_update_status_health.go index 21b31b044bc..6891ad8c42b 100644 --- a/update/v1alpha1/types_update_status_health.go +++ b/update/v1alpha1/types_update_status_health.go @@ -33,7 +33,7 @@ type InsightScope struct { // resources is a list of resources involved in the insight, of any group/kind // +optional // +listType=atomic - // +kubebuilder:validation:maxItems=64 + // +kubebuilder:validation:MaxItems=16 Resources []ResourceRef `json:"resources,omitempty"` } diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go index 9f39608ef94..085a749ac9d 100644 --- a/update/v1alpha1/types_update_status_progress.go +++ b/update/v1alpha1/types_update_status_progress.go @@ -11,6 +11,7 @@ type ClusterVersionStatusInsight struct { // +patchStrategy=merge // +patchMergeKey=type // +optional + // +kubebuilder:validation:MaxItems=10 Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // resource is the ClusterVersion resource that represents the control plane From f7792ac5260930ed9330d267a57fd9e6667c4c0e Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 4 Feb 2025 18:28:20 +0100 Subject: [PATCH 34/45] status: remove `kubebuilder:validation:Optional` from doc.go --- update/v1alpha1/doc.go | 1 - 1 file changed, 1 deletion(-) diff --git a/update/v1alpha1/doc.go b/update/v1alpha1/doc.go index f4e39a0523c..636c807aad7 100644 --- a/update/v1alpha1/doc.go +++ b/update/v1alpha1/doc.go @@ -2,7 +2,6 @@ // +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true -// +kubebuilder:validation:Optional // +groupName=update.openshift.io // Package v1alpha1 is the v1alpha1 version of the API. package v1alpha1 From 6968651f57a82321a89f8b494a93763b10f7da13 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Tue, 4 Feb 2025 18:49:59 +0100 Subject: [PATCH 35/45] status: status.controlPlane required->optional --- update/v1alpha1/types_update_status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index bc916fa746b..e44843d3388 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -53,7 +53,7 @@ type UpdateStatusStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // controlPlane contains a summary and insights related to the control plane update - // +required + // +optional ControlPlane ControlPlane `json:"controlPlane"` // workerPools contains summaries and insights related to the worker pools update From f2c77ae38cf8aa750d701a82cb0d5322f77a957a Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Wed, 12 Feb 2025 19:25:33 +0100 Subject: [PATCH 36/45] status: genclient nonNamespaced --- update/v1alpha1/types_update_status.go | 1 + 1 file changed, 1 insertion(+) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index e44843d3388..6342809b418 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -3,6 +3,7 @@ package v1alpha1 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // UpdateStatus reports status for in-progress cluster version updates From 116245b00ab75da242ffcf4b008de94fc20c3cb4 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Fri, 14 Feb 2025 16:35:50 +0100 Subject: [PATCH 37/45] status: reintroduce `SchemeGroupVersion`, `AddToScheme`, `Resource` The generated code in this repositor does not need this but the code in openshift/client-go does --- update/v1alpha1/register.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/update/v1alpha1/register.go b/update/v1alpha1/register.go index 76eecf2b124..562ec59e19a 100644 --- a/update/v1alpha1/register.go +++ b/update/v1alpha1/register.go @@ -12,8 +12,21 @@ var ( 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, From 41b1919595851c73ddec81b598b9025f5d9c3909 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Wed, 5 Mar 2025 15:04:12 +0100 Subject: [PATCH 38/45] update: enforce comment policy --- update/.codegen.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/.codegen.yaml b/update/.codegen.yaml index ffa2c8d9b2e..7f4c27472fc 100644 --- a/update/.codegen.yaml +++ b/update/.codegen.yaml @@ -1,2 +1,2 @@ swaggerdocs: - commentPolicy: Warn + commentPolicy: Enforce From d5afb9f732853ba7532aefd03bec6020d125da19 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Wed, 5 Mar 2025 15:11:12 +0100 Subject: [PATCH 39/45] status: Add TODO for known .status conditions --- update/v1alpha1/types_update_status.go | 1 + 1 file changed, 1 insertion(+) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 6342809b418..d81e12d228e 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -45,6 +45,7 @@ type UpdateStatusSpec struct { // update informers type UpdateStatusStatus struct { // conditions provide details about the controller operational matters + // TODO(UpdateStatus API GA): Update the list of conditions expected to be present // +listType=map // +listMapKey=type // +patchStrategy=merge From cea149cfb3944db9be83fc3decb4622104841013 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Wed, 5 Mar 2025 15:13:53 +0100 Subject: [PATCH 40/45] status: .status.controlPlane optional+omitempty --- update/v1alpha1/types_update_status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index d81e12d228e..20cd90ef2da 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -56,7 +56,7 @@ type UpdateStatusStatus struct { // controlPlane contains a summary and insights related to the control plane update // +optional - ControlPlane ControlPlane `json:"controlPlane"` + ControlPlane *ControlPlane `json:"controlPlane,omitempty"` // workerPools contains summaries and insights related to the worker pools update // +listType=map From b619f70ebd0616469603ea9307e93105b14bdfbd Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Wed, 5 Mar 2025 15:38:29 +0100 Subject: [PATCH 41/45] status: .status.workerPools: godoc and TODOs --- update/v1alpha1/types_update_status.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 20cd90ef2da..4ed73ffb913 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -58,7 +58,11 @@ type UpdateStatusStatus struct { // +optional ControlPlane *ControlPlane `json:"controlPlane,omitempty"` - // workerPools contains summaries and insights related to the worker pools update + // workerPools contains summaries and insights related to the worker pools update. Each item in the list represents + // a single worker pool and carries all insights reported for it by informers. It has at most 32 items. + // TODO(UpdateStatus API GA): Determine a proper limit for MCPs / NodePool + // TODO(UpdateStatus): How to handle degenerate clusters with many pools? Worst case clusters can have per-node pools + // so hundreds, and hypothetically more empty ones. // +listType=map // +listMapKey=name // +patchStrategy=merge From 63850db39432635ba238c1d46a7ffc230601298c Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Wed, 5 Mar 2025 16:22:28 +0100 Subject: [PATCH 42/45] status: .status.controlPlane godocs --- update/v1alpha1/types_update_status.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 4ed73ffb913..6b3c8a67d21 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -44,7 +44,10 @@ type UpdateStatusSpec struct { // UpdateStatusStatus is the API about in-progress updates. It aggregates and summarizes UpdateInsights produced by // update informers type UpdateStatusStatus struct { - // conditions provide details about the controller operational matters + // conditions provide details about the controller operational matters, exposing whether the controller managing this + // UpdateStatus is functioning well, receives insights from individual informers, and is able to interpret them and + // relay them through this UpdateStatus. These condition do not communicate anything about the state of the update + // itself but may indicate whether the UpdateStatus content is reliable or not. // TODO(UpdateStatus API GA): Update the list of conditions expected to be present // +listType=map // +listMapKey=type @@ -72,9 +75,14 @@ type UpdateStatusStatus struct { WorkerPools []Pool `json:"workerPools,omitempty" patchStrategy:"merge" patchMergeKey:"name"` } -// ControlPlane contains a summary and insights related to the control plane update +// ControlPlane contains a summary and insights related to the control plane update. type ControlPlane struct { - // conditions provides details about the control plane update + // conditions provides details about the control plane update. This is a high-level status of an abstract control place + // concept, and will typically be the controller's interpretation / summarization of the insights it received (that + // will be placed in .informers[].insights for clients that want to perform further analysis of the data). + // Known condition types are: + // * "Updating": Whether the cluster control plane is currently updating or not + // // +listType=map // +listMapKey=type // +patchStrategy=merge @@ -84,7 +92,8 @@ type ControlPlane struct { Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // resource is the resource that represents the control plane. It will typically be a ClusterVersion resource - // in standalone OpenShift and HostedCluster in Hosted Control Planes. + // in standalone OpenShift and HostedCluster in Hosted Control Planes. This field is optional because the information + // may be unknown temporarily. // // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows // only the "correct" resource types to be referenced (here, ClusterVersion and HostedCluster). However, because we @@ -94,7 +103,8 @@ type ControlPlane struct { Resource ResourceRef `json:"resource"` // poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field - // is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools. + // is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools, + // and also because the information may be unknown temporarily. // // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows // only the "correct" resource types to be referenced (here, MachineConfigPool). However, because we use resource From 3bb60506f0b650936d86ec68959525ef1f9ecc4f Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Wed, 5 Mar 2025 16:26:36 +0100 Subject: [PATCH 43/45] status: .status.controlPlane resource/pool validation --- .../UpgradeStatus.yaml | 63 +++++++++++++++++++ update/v1alpha1/types_update_status.go | 6 +- 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml b/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml index 34b79da6652..c02584a66e8 100644 --- a/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml +++ b/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml @@ -448,6 +448,69 @@ tests: kind: UpdateStatus spec: {} expectedStatusError: "Invalid value: \"object\": target version must not be '' or have Installation metadata" + + - name: UpdateStatus refuses controlPlane not represented by a ClusterVersion or HostedCluster + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusteroperators + name: authentication + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: master + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + expectedStatusError: "Invalid value: \"object\": controlPlane.resource must be either a clusterversions.config.openshift.io or a hostedclusters.hypershift.openshift.io resource" + + - name: UpdateStatus refuses controlPlane pool that is not a MCP + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + controlPlane: + resource: + group: config.openshift.io + resource: clusterversions + name: version + poolResource: + group: config.openshift.io + resource: clusteroperators + name: authentication + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + expectedStatusError: "Invalid value: \"object\": controlPlane.poolResource must be a machineconfigpools.machineconfiguration.openshift.io resource" + - name: UpdateStatus can contain a ClusterOperator insight initial: | apiVersion: update.openshift.io/v1alpha1 diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 6b3c8a67d21..0588b7fb7f2 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -99,8 +99,9 @@ type ControlPlane struct { // only the "correct" resource types to be referenced (here, ClusterVersion and HostedCluster). However, because we // use resource references in many places and this API is intended to be consumed by clients, not produced, consistency // seems to be more valuable than type safety for producers. - // +required - Resource ResourceRef `json:"resource"` + // +optional + // +kubebuilder:validation:XValidation:rule="(self.group == 'config.openshift.io' && self.resource == 'clusterversions') || (self.group == 'hypershift.openshift.io' && self.resource == 'hostedclusters')",message="controlPlane.resource must be either a clusterversions.config.openshift.io or a hostedclusters.hypershift.openshift.io resource" + Resource *ResourceRef `json:"resource"` // poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field // is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools, @@ -111,6 +112,7 @@ type ControlPlane struct { // references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be // more valuable than type safety for producers. // +optional + // +kubebuilder:validation:XValidation:rule="(self.group == 'machineconfiguration.openshift.io' && self.resource == 'machineconfigpools')",message="controlPlane.poolResource must be a machineconfigpools.machineconfiguration.openshift.io resource" PoolResource *PoolResourceRef `json:"poolResource,omitempty"` // informers is a list of insight producers, each carries a list of insights relevant for control plane From 7903be05b606feedce55680d37c681e75336659a Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Fri, 7 Mar 2025 17:59:34 +0100 Subject: [PATCH 44/45] status: review feedback addressed --- .../UpgradeStatus.yaml | 796 ++++++++++-------- update/v1alpha1/types_update_status.go | 148 +++- update/v1alpha1/types_update_status_health.go | 14 +- .../v1alpha1/types_update_status_progress.go | 65 +- 4 files changed, 609 insertions(+), 414 deletions(-) diff --git a/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml b/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml index c02584a66e8..9520c481ebe 100644 --- a/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml +++ b/update/v1alpha1/tests/updatestatuses.update.openshift.io/UpgradeStatus.yaml @@ -38,29 +38,30 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: ClusterVersion - clusterVersion: - resource: - group: config.openshift.io - resource: clusterversions - name: version - assessment: Progressing - versions: - previous: - version: "" - metadata: - - key: Installation - target: - version: 4.18.0 - completion: 42 - startedAt: "2021-01-01T00:00:00Z" - estimatedCompletedAt: "2021-01-01T02:00:00Z" - conditions: - - type: Updating - status: "True" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: ClusterVersionProgressing - message: "Installing version 4.18.0" + insight: + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: "" + metadata: + - key: Installation + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" conditions: - type: Updating status: "True" @@ -86,29 +87,30 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: ClusterVersion - clusterVersion: - resource: - group: config.openshift.io - resource: clusterversions - name: version - assessment: Progressing - versions: - previous: - version: "" - metadata: - - key: Installation - target: - version: 4.18.0 - completion: 42 - startedAt: "2021-01-01T00:00:00Z" - estimatedCompletedAt: "2021-01-01T02:00:00Z" - conditions: - - type: Updating - status: "True" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: ClusterVersionProgressing - message: "Installing version 4.18.0" + insight: + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: "" + metadata: + - key: Installation + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" conditions: - type: Updating status: "True" @@ -140,29 +142,30 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: ClusterVersion - clusterVersion: - resource: - group: config.openshift.io - resource: clusterversions - name: version - assessment: Progressing - versions: - previous: - version: 4.17.0 - metadata: - - key: Partial - target: - version: 4.18.0 - completion: 42 - startedAt: "2021-01-01T00:00:00Z" - estimatedCompletedAt: "2021-01-01T02:00:00Z" - conditions: - - type: Updating - status: "True" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: ClusterVersionProgressing - message: "Installing version 4.18.0" + insight: + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: 4.17.0 + metadata: + - key: Partial + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" conditions: - type: Updating status: "True" @@ -188,29 +191,30 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: ClusterVersion - clusterVersion: - resource: - group: config.openshift.io - resource: clusterversions - name: version - assessment: Progressing - versions: - previous: - version: 4.17.0 - metadata: - - key: Partial - target: - version: 4.18.0 - completion: 42 - startedAt: "2021-01-01T00:00:00Z" - estimatedCompletedAt: "2021-01-01T02:00:00Z" - conditions: - - type: Updating - status: "True" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: ClusterVersionProgressing - message: "Installing version 4.18.0" + insight: + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: 4.17.0 + metadata: + - key: Partial + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" conditions: - type: Updating status: "True" @@ -242,27 +246,28 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: ClusterVersion - clusterVersion: - resource: - group: config.openshift.io - resource: clusterversions - name: version - assessment: Progressing - versions: - previous: - version: - target: - version: 4.18.0 - completion: 42 - startedAt: "2021-01-01T00:00:00Z" - estimatedCompletedAt: "2021-01-01T02:00:00Z" - conditions: - - type: Updating - status: "True" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: ClusterVersionProgressing - message: "Installing version 4.18.0" + insight: + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" conditions: - type: Updating status: "True" @@ -298,29 +303,30 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: ClusterVersion - clusterVersion: - resource: - group: config.openshift.io - resource: clusterversions - name: version - assessment: Progressing - versions: - previous: - version: 4.17.0 - metadata: - - key: Installation - target: - version: 4.18.0 - completion: 42 - startedAt: "2021-01-01T00:00:00Z" - estimatedCompletedAt: "2021-01-01T02:00:00Z" - conditions: - - type: Updating - status: "True" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: ClusterVersionProgressing - message: "Installing version 4.18.0" + insight: + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: 4.17.0 + metadata: + - key: Installation + target: + version: 4.18.0 + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" conditions: - type: Updating status: "True" @@ -356,29 +362,30 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: ClusterVersion - clusterVersion: - resource: - group: config.openshift.io - resource: clusterversions - name: version - assessment: Progressing - versions: - previous: - version: 4.17.0 - target: - version: - metadata: - - key: Installation - completion: 42 - startedAt: "2021-01-01T00:00:00Z" - estimatedCompletedAt: "2021-01-01T02:00:00Z" - conditions: - - type: Updating - status: "True" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: ClusterVersionProgressing - message: "Installing version 4.18.0" + insight: + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: 4.17.0 + target: + version: + metadata: + - key: Installation + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" conditions: - type: Updating status: "True" @@ -414,29 +421,30 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: ClusterVersion - clusterVersion: - resource: - group: config.openshift.io - resource: clusterversions - name: version - assessment: Progressing - versions: - previous: - version: 4.17.0 - target: - version: 4.18.0 - metadata: - - key: Installation - completion: 42 - startedAt: "2021-01-01T00:00:00Z" - estimatedCompletedAt: "2021-01-01T02:00:00Z" - conditions: - - type: Updating - status: "True" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: ClusterVersionProgressing - message: "Installing version 4.18.0" + insight: + type: ClusterVersion + clusterVersion: + resource: + group: config.openshift.io + resource: clusterversions + name: version + assessment: Progressing + versions: + previous: + version: 4.17.0 + target: + version: 4.18.0 + metadata: + - key: Installation + completion: 42 + startedAt: "2021-01-01T00:00:00Z" + estimatedCompletedAt: "2021-01-01T02:00:00Z" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: ClusterVersionProgressing + message: "Installing version 4.18.0" conditions: - type: Updating status: "True" @@ -511,6 +519,106 @@ tests: spec: {} expectedStatusError: "Invalid value: \"object\": controlPlane.poolResource must be a machineconfigpools.machineconfiguration.openshift.io resource" + - name: UpdateStatus can contain a workerPools item represented by MCP + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + workerPools: + - name: worker + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + workerPools: + - name: worker + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + + - name: UpdateStatus can contain a workerPools item represented by NodePool + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + workerPools: + - name: worker + resource: + group: hypershift.openshift.io + resource: nodepools + name: worker + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + workerPools: + - name: worker + resource: + group: hypershift.openshift.io + resource: nodepools + name: worker + + - name: UpdateStatus refuses workerPools item that is not represented by MCP or NodePool + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + workerPools: + - name: worker + resource: + group: config.openshift.io + resource: clusteroperators + name: worker + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + expectedStatusError: "Invalid value: \"object\": workerPools[].poolResource must be a machineconfigpools.machineconfiguration.openshift.io or hostedclusters.hypershift.openshift.io resource" + + - name: UpdateStatus refuses workerPools item where name does not match the resource + initial: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + updated: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + status: + workerPools: + - name: worker + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: not-worker + expected: | + apiVersion: update.openshift.io/v1alpha1 + kind: UpdateStatus + spec: {} + expectedStatusError: "Invalid value: \"object\": workerPools .name must match .resource.name" + - name: UpdateStatus can contain a ClusterOperator insight initial: | apiVersion: update.openshift.io/v1alpha1 @@ -531,24 +639,25 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: ClusterOperator - clusterOperator: - name: image-registry - resource: - group: config.openshift.io - resource: clusteroperators + insight: + type: ClusterOperator + clusterOperator: name: image-registry - conditions: - - type: Updating - status: "False" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: Pending - message: Waiting to be updated - - type: Healthy - status: "False" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: Degraded - message: Image registry is degraded + resource: + group: config.openshift.io + resource: clusteroperators + name: image-registry + conditions: + - type: Updating + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Pending + message: Waiting to be updated + - type: Healthy + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Degraded + message: Image registry is degraded conditions: [] expected: | apiVersion: update.openshift.io/v1alpha1 @@ -565,24 +674,25 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: ClusterOperator - clusterOperator: - name: image-registry - resource: - group: config.openshift.io - resource: clusteroperators + insight: + type: ClusterOperator + clusterOperator: name: image-registry - conditions: - - type: Updating - status: "False" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: Pending - message: Waiting to be updated - - type: Healthy - status: "False" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: Degraded - message: Image registry is degraded + resource: + group: config.openshift.io + resource: clusteroperators + name: image-registry + conditions: + - type: Updating + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Pending + message: Waiting to be updated + - type: Healthy + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Degraded + message: Image registry is degraded conditions: [] - name: UpdateStatus can contain a MachineConfigPool insight @@ -613,21 +723,22 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: MachineConfigPool - machineConfigPool: - name: image-registry - resource: - group: machineconfiguration.openshift.io - resource: machineconfigpools - name: worker - scopeType: WorkerPool - assessment: Completed - completion: 100 - summaries: - - type: Total - count: 8 - - type: Outdated - count: 0 + insight: + type: MachineConfigPool + machineConfigPool: + name: image-registry + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + scopeType: WorkerPool + assessment: Completed + completion: 100 + summaries: + - type: Total + count: 8 + - type: Outdated + count: 0 conditions: [] expected: | apiVersion: update.openshift.io/v1alpha1 @@ -652,21 +763,22 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: MachineConfigPool - machineConfigPool: - name: image-registry - resource: - group: machineconfiguration.openshift.io - resource: machineconfigpools - name: worker - scopeType: WorkerPool - assessment: Completed - completion: 100 - summaries: - - type: Total - count: 8 - - type: Outdated - count: 0 + insight: + type: MachineConfigPool + machineConfigPool: + name: image-registry + resource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + scopeType: WorkerPool + assessment: Completed + completion: 100 + summaries: + - type: Total + count: 8 + - type: Outdated + count: 0 conditions: [] - name: UpdateStatus can contain a Node insight initial: | @@ -696,36 +808,37 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: Node - node: - name: node-42 - resource: - resource: nodes + insight: + type: Node + node: name: node-42 - poolResource: - group: machineconfiguration.openshift.io - resource: machineconfigpools - name: worker - scopeType: WorkerPool - version: 4.18.0 - estToComplete: 42m - message: "Unschedulable | Disk Pressure" - conditions: - - type: Updating - status: "True" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: Draining - message: "Node is draining" - - type: Degraded - status: "False" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: AsExpected - message: "All is well" - - type: Available - status: "False" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: MultipleReasons + resource: + resource: nodes + name: node-42 + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + scopeType: WorkerPool + version: 4.18.0 + estToComplete: 42m message: "Unschedulable | Disk Pressure" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Draining + message: "Node is draining" + - type: Degraded + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: AsExpected + message: "All is well" + - type: Available + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: MultipleReasons + message: "Unschedulable | Disk Pressure" expected: | apiVersion: update.openshift.io/v1alpha1 kind: UpdateStatus @@ -749,36 +862,37 @@ tests: insights: - uid: "1234" acquiredAt: "2021-01-01T00:00:00Z" - type: Node - node: - name: node-42 - resource: - resource: nodes + insight: + type: Node + node: name: node-42 - poolResource: - group: machineconfiguration.openshift.io - resource: machineconfigpools - name: worker - scopeType: WorkerPool - version: 4.18.0 - estToComplete: 42m - message: "Unschedulable | Disk Pressure" - conditions: - - type: Updating - status: "True" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: Draining - message: "Node is draining" - - type: Degraded - status: "False" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: AsExpected - message: "All is well" - - type: Available - status: "False" - lastTransitionTime: "2021-01-01T00:00:00Z" - reason: MultipleReasons + resource: + resource: nodes + name: node-42 + poolResource: + group: machineconfiguration.openshift.io + resource: machineconfigpools + name: worker + scopeType: WorkerPool + version: 4.18.0 + estToComplete: 42m message: "Unschedulable | Disk Pressure" + conditions: + - type: Updating + status: "True" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: Draining + message: "Node is draining" + - type: Degraded + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: AsExpected + message: "All is well" + - type: Available + status: "False" + lastTransitionTime: "2021-01-01T00:00:00Z" + reason: MultipleReasons + message: "Unschedulable | Disk Pressure" - name: UpdateStatus can contain a Health insight initial: | @@ -800,25 +914,26 @@ tests: insights: - uid: "4331" acquiredAt: "2021-01-01T00:00:00Z" - type: Health - health: - startedAt: "2021-01-01T00:00:00Z" - scope: - type: ControlPlane - resources: - - group: config.openshift.io - resource: clusterversions - name: version - - resource: nodes - name: node-42 - impact: - level: Error - type: Cluster Capacity - summary: Something that involves a CV and node-42 and affects capacity - description: Potentially longer description of the issue - remediation: - reference: https://access.redhat.com/solutions/1234 - estimatedFinish: "2021-01-01T02:00:00Z" + insight: + type: Health + health: + startedAt: "2021-01-01T00:00:00Z" + scope: + type: ControlPlane + resources: + - group: config.openshift.io + resource: clusterversions + name: version + - resource: nodes + name: node-42 + impact: + level: Error + type: Cluster Capacity + summary: Something that involves a CV and node-42 and affects capacity + description: Potentially longer description of the issue + remediation: + reference: https://access.redhat.com/solutions/1234 + estimatedFinish: "2021-01-01T02:00:00Z" conditions: [] expected: | apiVersion: update.openshift.io/v1alpha1 @@ -835,23 +950,24 @@ tests: insights: - uid: "4331" acquiredAt: "2021-01-01T00:00:00Z" - type: Health - health: - startedAt: "2021-01-01T00:00:00Z" - scope: - type: ControlPlane - resources: - - group: config.openshift.io - resource: clusterversions - name: version - - resource: nodes - name: node-42 - impact: - level: Error - type: Cluster Capacity - summary: Something that involves a CV and node-42 and affects capacity - description: Potentially longer description of the issue - remediation: - reference: https://access.redhat.com/solutions/1234 - estimatedFinish: "2021-01-01T02:00:00Z" + insight: + type: Health + health: + startedAt: "2021-01-01T00:00:00Z" + scope: + type: ControlPlane + resources: + - group: config.openshift.io + resource: clusterversions + name: version + - resource: nodes + name: node-42 + impact: + level: Error + type: Cluster Capacity + summary: Something that involves a CV and node-42 and affects capacity + description: Potentially longer description of the issue + remediation: + reference: https://access.redhat.com/solutions/1234 + estimatedFinish: "2021-01-01T02:00:00Z" conditions: [] diff --git a/update/v1alpha1/types_update_status.go b/update/v1alpha1/types_update_status.go index 0588b7fb7f2..6f57a56702b 100644 --- a/update/v1alpha1/types_update_status.go +++ b/update/v1alpha1/types_update_status.go @@ -22,6 +22,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" type UpdateStatus struct { metav1.TypeMeta `json:",inline"` + // metadata is standard Kubernetes object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty"` @@ -48,7 +49,7 @@ type UpdateStatusStatus struct { // UpdateStatus is functioning well, receives insights from individual informers, and is able to interpret them and // relay them through this UpdateStatus. These condition do not communicate anything about the state of the update // itself but may indicate whether the UpdateStatus content is reliable or not. - // TODO(UpdateStatus API GA): Update the list of conditions expected to be present + // +TODO(UpdateStatus API GA): Update the list of conditions expected to be present // +listType=map // +listMapKey=type // +patchStrategy=merge @@ -63,8 +64,8 @@ type UpdateStatusStatus struct { // workerPools contains summaries and insights related to the worker pools update. Each item in the list represents // a single worker pool and carries all insights reported for it by informers. It has at most 32 items. - // TODO(UpdateStatus API GA): Determine a proper limit for MCPs / NodePool - // TODO(UpdateStatus): How to handle degenerate clusters with many pools? Worst case clusters can have per-node pools + // +TODO(UpdateStatus API GA): Determine a proper limit for MCPs / NodePool + // +TODO(UpdateStatus): How to handle degenerate clusters with many pools? Worst case clusters can have per-node pools // so hundreds, and hypothetically more empty ones. // +listType=map // +listMapKey=name @@ -77,7 +78,7 @@ type UpdateStatusStatus struct { // ControlPlane contains a summary and insights related to the control plane update. type ControlPlane struct { - // conditions provides details about the control plane update. This is a high-level status of an abstract control place + // conditions provides details about the control plane update. This is a high-level status of an abstract control plane // concept, and will typically be the controller's interpretation / summarization of the insights it received (that // will be placed in .informers[].insights for clients that want to perform further analysis of the data). // Known condition types are: @@ -95,10 +96,10 @@ type ControlPlane struct { // in standalone OpenShift and HostedCluster in Hosted Control Planes. This field is optional because the information // may be unknown temporarily. // - // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows - // only the "correct" resource types to be referenced (here, ClusterVersion and HostedCluster). However, because we - // use resource references in many places and this API is intended to be consumed by clients, not produced, consistency - // seems to be more valuable than type safety for producers. + // +Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + // +only the "correct" resource types to be referenced (here, ClusterVersion and HostedCluster). However, because we + // +use resource references in many places and this API is intended to be consumed by clients, not produced, consistency + // +seems to be more valuable than type safety for producers. // +optional // +kubebuilder:validation:XValidation:rule="(self.group == 'config.openshift.io' && self.resource == 'clusterversions') || (self.group == 'hypershift.openshift.io' && self.resource == 'hostedclusters')",message="controlPlane.resource must be either a clusterversions.config.openshift.io or a hostedclusters.hypershift.openshift.io resource" Resource *ResourceRef `json:"resource"` @@ -107,15 +108,19 @@ type ControlPlane struct { // is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools, // and also because the information may be unknown temporarily. // - // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows - // only the "correct" resource types to be referenced (here, MachineConfigPool). However, because we use resource - // references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be - // more valuable than type safety for producers. + // +Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + // +only the "correct" resource types to be referenced (here, MachineConfigPool). However, because we use resource + // +references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be + // +more valuable than type safety for producers. // +optional // +kubebuilder:validation:XValidation:rule="(self.group == 'machineconfiguration.openshift.io' && self.resource == 'machineconfigpools')",message="controlPlane.poolResource must be a machineconfigpools.machineconfiguration.openshift.io resource" PoolResource *PoolResourceRef `json:"poolResource,omitempty"` - // informers is a list of insight producers, each carries a list of insights relevant for control plane + // informers is a list of insight producers. An informer is a system, internal or external to the cluster, that + // produces units of information relevant to the update process, either about its progress or its health. Each + // informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, + // relevant to the control plane update. Contains at most 16 items. + // // +listType=map // +listMapKey=name // +patchStrategy=merge @@ -151,8 +156,13 @@ const ( ) // Pool contains a summary and insights related to a node pool update +// +kubebuilder:validation:XValidation:rule="self.name == self.resource.name",message="workerPools .name must match .resource.name" type Pool struct { - // conditions provide details about the pool + // conditions provides details about the node pool update. This is a high-level status of an abstract "pool of nodes" + // concept, and will typically be the controller's interpretation / summarization of the insights it received (that + // will be placed in .informers[].insights for clients that want to perform further analysis of the data). + // Known condition types are: + // * "Updating": Whether the pool of nodes is currently updating or not // +listType=map // +listMapKey=type // +patchStrategy=merge @@ -161,24 +171,27 @@ type Pool struct { // +kubebuilder:validation:MaxItems=10 Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` - // name is the name of the pool + // name is the name of the pool, follows the same rules as a Kubernetes resource name (RFC-1123 subdomain) // +required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=63 - // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +kubebuilder:validation:MaxLength:=253 Name string `json:"name"` - // resource is the resource that represents the pool + // resource is the resource that represents the pool, either a MachineConfigPool in Standalone OpenShift or a NodePool + // in Hosted Control Planes. // - // Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows - // only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use - // resource references in many places and this API is intended to be consumed by clients, not produced, consistency - // seems to be more valuable than type safety for producers. + // +Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + // +only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + // +resource references in many places and this API is intended to be consumed by clients, not produced, consistency + // +seems to be more valuable than type safety for producers. // +required + // +kubebuilder:validation:XValidation:rule="(self.group == 'machineconfiguration.openshift.io' && self.resource == 'machineconfigpools') || (self.group == 'hypershift.openshift.io' && self.resource == 'nodepools')",message="workerPools[].poolResource must be a machineconfigpools.machineconfiguration.openshift.io or hostedclusters.hypershift.openshift.io resource" Resource PoolResourceRef `json:"resource"` - // informers is a list of insight producers, each carries a list of insights + // informers is a list of insight producers. An informer is a system, internal or external to the cluster, that + // produces units of information relevant to the update process, either about its progress or its health. Each + // informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, + // relevant to the process of updating this pool of nodes. // +listType=map // +listMapKey=name // +patchStrategy=merge @@ -188,17 +201,28 @@ type Pool struct { Informers []WorkerPoolInformer `json:"informers,omitempty" patchStrategy:"merge" patchMergeKey:"name"` } -// ControlPlaneInformer is an insight producer identified by a name, carrying a list of insights it produced +// ControlPlaneInformer represents a system, internal or external to the cluster, that produces units of information +// relevant to the update process, either about its progress or its health. Each informer is identified by a name, and +// contains a list of insights it contributed to the Update Status API, relevant to the control plane update. type ControlPlaneInformer struct { // name is the name of the insight producer // +required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=63 - // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +kubebuilder:validation:MaxLength:=253 Name string `json:"name"` - // insights is a list of insights produced by this producer + // insights is a list of insights produced by this producer. Insights are units of information relevant to an update + // progress or health information. There are two types of update insights: status insights and health insights. The + // first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not. + // + // Status Insights expose the state of a single resource that is directly involved in the update process, usually a resource + // that either has a notion of "being updated," (such as a Node or ClusterOperator) or represents a higher-level + // abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents + // a pool of nodes). + // + // Health Insights report a state or condition in the cluster that is abnormal or negative and either affects or is + // affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate + // a condition that warrants attention by the cluster administrator. // +listType=map // +listMapKey=uid // +patchStrategy=merge @@ -208,17 +232,28 @@ type ControlPlaneInformer struct { Insights []ControlPlaneInsight `json:"insights,omitempty" patchStrategy:"merge" patchMergeKey:"uid"` } -// WorkerPoolInformer is an insight producer identified by a name, carrying a list of insights it produced +// WorkerPoolInformer represents a system, internal or external to the cluster, that produces units of information +// relevant to the update process, either about its progress or its health. Each informer is identified by a name, and +// contains a list of insights it contributed to the Update Status API, relevant to a specific worker pool. type WorkerPoolInformer struct { // name is the name of the insight producer // +required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=63 - // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +kubebuilder:validation:MaxLength:=253 Name string `json:"name"` - // insights is a list of insights produced by this producer + // insights is a list of insights produced by this producer. Insights are units of information relevant to an update + // progress or health information. There are two types of update insights: status insights and health insights. The + // first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not. + // + // Status Insights expose the state of a single resource that is directly involved in the update process, usually a resource + // that either has a notion of "being updated," (such as a Node or ClusterOperator) or represents a higher-level + // abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents + // a pool of nodes). + // + // Health Insights report a state or condition in the cluster that is abnormal or negative and either affects or is + // affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate + // a condition that warrants attention by the cluster administrator. // +listType=map // +listMapKey=uid // +patchStrategy=merge @@ -244,7 +279,9 @@ type ControlPlaneInsight struct { // +kubebuilder:validation:Format=date-time AcquiredAt metav1.Time `json:"acquiredAt"` - ControlPlaneInsightUnion `json:",inline"` + // insight is a discriminated union of all insights types that can be reported for the control plane + // +required + Insight ControlPlaneInsightUnion `json:"insight"` } // WorkerPoolInsight is a unique piece of either status/progress or update health information produced by update informer @@ -263,13 +300,25 @@ type WorkerPoolInsight struct { // +kubebuilder:validation:Format=date-time AcquiredAt metav1.Time `json:"acquiredAt"` - WorkerPoolInsightUnion `json:",inline"` + // insight is a discriminated union of all insights types that can be reported for a worker pool + // +required + Insight WorkerPoolInsightUnion `json:"insight"` } // ControlPlaneInsightUnion is the discriminated union of all insights types that can be reported for the control plane, // identified by type field +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'ClusterVersion' ? has(self.clusterVersion) : !has(self.clusterVersion)",message="clusterVersion is required when type is ClusterVersion, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'ClusterOperator' ? has(self.clusterOperator) : !has(self.clusterOperator)",message="clusterOperator is required when type is ClusterOperator, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'MachineConfigPool' ? has(self.machineConfigPool) : !has(self.machineConfigPool)",message="machineConfigPool is required when type is MachineConfigPool, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Node' ? has(self.node) : !has(self.node)",message="node is required when type is Node, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Health' ? has(self.health) : !has(self.health)",message="health is required when type is Health, and forbidden otherwise" +// +union type ControlPlaneInsightUnion struct { - // type identifies the type of the update insight + // type identifies the type of the update insight, one of: ClusterVersion, ClusterOperator, MachineConfigPool, Node, Health + // ClusterVersion, ClusterOperator, MachineConfigPool, Node types are progress insights about a resource directly + // involved in the update process + // Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is + // affected by the update. // +unionDiscriminator // +required // +kubebuilder:validation:Enum=ClusterVersion;ClusterOperator;MachineConfigPool;Node;Health @@ -308,8 +357,15 @@ type ControlPlaneInsightUnion struct { // WorkerPoolInsightUnion is the discriminated union of insights types that can be reported for a worker pool, // identified by type field +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'MachineConfigPool' ? has(self.machineConfigPool) : !has(self.machineConfigPool)",message="machineConfigPool is required when type is MachineConfigPool, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Node' ? has(self.node) : !has(self.node)",message="node is required when type is Node, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Health' ? has(self.health) : !has(self.health)",message="health is required when type is Health, and forbidden otherwise" +// +union type WorkerPoolInsightUnion struct { - // type identifies the type of the update insight + // type identifies the type of the update insight, one of: MachineConfigPool, Node, Health + // MachineConfigPool, Node types are progress insights about a resource directly involved in the update process + // Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is + // affected by the update. // +unionDiscriminator // +required // +kubebuilder:validation:Enum=MachineConfigPool;Node;Health @@ -363,22 +419,22 @@ const ( type ResourceRef struct { // group of the object being referenced, if any // +optional - // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." Group string `json:"group,omitempty"` // resource of object being referenced // +required // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=253 - // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." Resource string `json:"resource"` // name of the object being referenced // +required // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=253 - // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." Name string `json:"name"` // namespace of the object being referenced, if any @@ -390,6 +446,7 @@ type ResourceRef struct { } // PoolResourceRef is a reference to a kubernetes resource that represents a node pool +// +kubebuilder:validation:XValidation:rule="has(self.resource) && (self.resource == 'machineconfigpools' && self.group == 'machineconfiguration.openshift.io'",message="a poolResource must be a machineconfigpools.machineconfiguration.openshift.io resource" type PoolResourceRef struct { ResourceRef `json:",inline"` } @@ -402,11 +459,12 @@ type PoolResourceRef struct { // +openshift:compatibility-gen:level=4 type UpdateStatusList struct { metav1.TypeMeta `json:",inline"` + // metadata is standard Kubernetes object metadata // +optional metav1.ListMeta `json:"metadata"` // items is a list of UpdateStatus resources // +optional - // +kubebuilder:validation:MaxItems=32 + // +kubebuilder:validation:MaxItems=1024 Items []UpdateStatus `json:"items"` } diff --git a/update/v1alpha1/types_update_status_health.go b/update/v1alpha1/types_update_status_health.go index 6891ad8c42b..f1a54940c85 100644 --- a/update/v1alpha1/types_update_status_health.go +++ b/update/v1alpha1/types_update_status_health.go @@ -30,7 +30,7 @@ type InsightScope struct { // +required Type ScopeType `json:"type"` - // resources is a list of resources involved in the insight, of any group/kind + // resources is a list of resources involved in the insight, of any group/kind. Maximum 16 resources can be listed. // +optional // +listType=atomic // +kubebuilder:validation:MaxItems=16 @@ -50,22 +50,24 @@ const ( // InsightImpact describes the impact the reported condition has on the cluster or update type InsightImpact struct { - // level is the severity of the impact + // level is the severity of the impact. Valid values are Unknown, Info, Warning, Error, Critical. // +required Level InsightImpactLevel `json:"level"` - // type is the type of the impact + // type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, + // Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled. // +required Type InsightImpactType `json:"type"` - // summary is a short summary of the impact + // summary is a short summary of the impact. It must not be empty and must be shorter than 256 characters. // +required // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=256 // +kubebuilder:validation:MinLength=1 Summary string `json:"summary"` - // description is a human-oriented, possibly longer-form description of the condition reported by the insight + // description is a human-oriented, possibly longer-form description of the condition reported by the insight It must + // be shorter than 4096 characters. // +optional // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=4096 @@ -117,8 +119,8 @@ type InsightRemediation struct { // reference is a URL where administrators can find information to resolve or prevent the reported condition // +required // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Format=uri // +kubebuilder:validation:MaxLength=512 + // +kubebuilder:validation:XValidation:rule="isURL(self)",message="reference must a valid URL" Reference string `json:"reference"` // estimatedFinish is the estimated time when the informer expects the condition to be resolved, if applicable. diff --git a/update/v1alpha1/types_update_status_progress.go b/update/v1alpha1/types_update_status_progress.go index 085a749ac9d..83977256410 100644 --- a/update/v1alpha1/types_update_status_progress.go +++ b/update/v1alpha1/types_update_status_progress.go @@ -5,7 +5,9 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // ClusterVersionStatusInsight reports the state of a ClusterVersion resource (which represents a control plane // update in standalone clusters), during the update. type ClusterVersionStatusInsight struct { - // conditions provides detailed observed conditions about ClusterVersion + // conditions provides detailed observed conditions about ClusterVersion. It contains at most 10 items. + // Known conditions are: + // - Updating: whether the control plane (represented by this ClusterVersion) is updating // +listType=map // +listMapKey=type // +patchStrategy=merge @@ -16,14 +18,15 @@ type ClusterVersionStatusInsight struct { // resource is the ClusterVersion resource that represents the control plane // - // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to - // resource name (because the rest is implied by status insight type). However, because we use resource references in - // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable - // than type safety for producers. + // +Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + // +resource name (because the rest is implied by status insight type). However, because we use resource references in + // +many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + // +than type safety for producers. // +required + // +kubebuilder:validation:XValidation:rule="self.group == 'config.openshift.io' && self.resource == 'clusterversions'",message="resource must be a clusterversions.config.openshift.io resource" Resource ResourceRef `json:"resource"` - // assessment is the assessment of the control plane update process + // assessment is the assessment of the control plane update process. Valid values are: Unknown, Progressing, Completed, Degraded // +required Assessment ControlPlaneAssessment `json:"assessment"` @@ -92,12 +95,14 @@ type Version struct { // with key 'Installation' // +required // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MinLength=5 // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:Pattern=`^()|((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$` + // +kubebuilder:validation:XValidation:rule="self.version == '' ? (has(self.metadata) && self.metadata.exists(m, m.key == 'Installation')) : !(has(self.metadata) && self.metadata.exists(m, m.key == 'Installation'))",message="previous version must be '' iff marked with Installation metadata" Version string `json:"version"` // metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional - // and when not provided, the metadata item has boolean semantics (presence indicates true) + // and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' + // metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items. // +listType=map // +listMapKey=key // +patchStrategy=merge @@ -110,11 +115,13 @@ type Version struct { // VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata // have boolean semantics (true when present, false when absent) type VersionMetadata struct { - // key is the name of this metadata value + // key is the name of this metadata value. Valid values are: Installation, Partial, Architecture // +required Key VersionMetadataKey `json:"key"` - // value is the value for the metadata + // value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation + // and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the + // payload image of the version involved in the upgrade, when relevant. // +optional // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=32 @@ -159,7 +166,9 @@ const ( // ClusterOperatorStatusInsight reports the state of a ClusterOperator resource (which represents a control plane // component update in standalone clusters), during the update type ClusterOperatorStatusInsight struct { - // conditions provide details about the operator + // conditions provide details about the operator. It contains at most 10 items. Known conditions are: + // - Updating: whether the operator is updating; When Updating=False, the reason field can be Pending or Updated + // - Healthy: whether the operator is considered healthy; When Healthy=False, the reason field can be Unavailable or Degraded, and Unavailable is "stronger" than Degraded // +listType=map // +listMapKey=type // +patchStrategy=merge @@ -178,11 +187,12 @@ type ClusterOperatorStatusInsight struct { // resource is the ClusterOperator resource that represents the operator // - // Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to - // resource name (because the rest is implied by status insight type). However, because we use resource references in - // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable - // than type safety for producers. + // +Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + // +resource name (because the rest is implied by status insight type). However, because we use resource references in + // +many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + // +than type safety for producers. // +required + // +kubebuilder:validation:XValidation:rule="self.group == 'config.openshift.io' && self.resource == 'clusteroperators'",message="resource must be a clusteroperators.config.openshift.io resource" Resource ResourceRef `json:"resource"` } @@ -226,7 +236,8 @@ const ( // MachineConfigPoolStatusInsight reports the state of a MachineConfigPool resource during the update type MachineConfigPoolStatusInsight struct { - // conditions provide details about the machine config pool update + // conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: + // - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded // +listType=map // +listMapKey=type // +patchStrategy=merge @@ -250,13 +261,14 @@ type MachineConfigPoolStatusInsight struct { // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable // than type safety for producers. // +required + // +kubebuilder:validation:XValidation:rule="self.group == 'machineconfiguration.openshift.io' && self.resource == 'machineconfigpools'",message="resource must be a machineconfigpools.machineconfiguration.openshift.io resource" Resource PoolResourceRef `json:"resource"` // scopeType describes whether the pool is a control plane or a worker pool // +required Scope ScopeType `json:"scopeType"` - // assessment is the assessment of the machine config pool update process + // assessment is the assessment of the machine config pool update process. Valid values are: Pending, Completed, Degraded, Excluded, Progressing // +required Assessment PoolAssessment `json:"assessment"` @@ -266,7 +278,7 @@ type MachineConfigPoolStatusInsight struct { // +kubebuilder:validation:Maximum=100 Completion int32 `json:"completion"` - // summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.) + // summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.). Maximum 16 items can be listed. // +listType=map // +listMapKey=type // +patchStrategy=merge @@ -296,7 +308,8 @@ const ( // NodeSummary is a count of nodes matching certain criteria (e.g. updated, degraded, etc.) type NodeSummary struct { - // type is the type of the summary + // type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded + // The summaries are not exclusive, a single node may be counted in multiple summaries. // +required Type NodeSummaryType `json:"type"` @@ -332,7 +345,10 @@ const ( // NodeStatusInsight reports the state of a Node during the update type NodeStatusInsight struct { - // conditions provides details about the control plane update + // conditions provides details about the control plane update. Known conditions are: + // - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting + // - Available: whether the Node is available (accepting workloads) + // - Degraded: whether the Node is degraded (problem observed) // +listType=map // +listMapKey=type // +patchStrategy=merge @@ -355,6 +371,7 @@ type NodeStatusInsight struct { // many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable // than type safety for producers. // +required + // +kubebuilder:validation:XValidation:rule="self.group == '' && self.resource == 'nodes'",message="resource must be a nodes.core.k8s.io resource" Resource ResourceRef `json:"resource"` // poolResource is the resource that represents the pool the node is a member of @@ -364,6 +381,7 @@ type NodeStatusInsight struct { // resource references in many places and this API is intended to be consumed by clients, not produced, consistency // seems to be more valuable than type safety for producers. // +required + // +kubebuilder:validation:XValidation:rule="self.group == 'machineconfiguration.openshift.io' && self.resource == 'machineconfigpools'",message="resource must be a machineconfigpools.machineconfiguration.openshift.io resource" PoolResource PoolResourceRef `json:"poolResource"` // scopeType describes whether the node belongs to control plane or a worker pool @@ -374,15 +392,16 @@ type NodeStatusInsight struct { // +optional // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:Pattern=`^((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$` Version string `json:"version,omitempty"` - // estToComplete is the estimated time to complete the update, when known + // estimatedToComplete is the estimated time to complete the update, when known // +optional // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=duration - EstToComplete *metav1.Duration `json:"estToComplete,omitempty"` + EstimatedToComplete *metav1.Duration `json:"estimatedToComplete,omitempty"` - // message is a short human-readable message about the node update status + // message is a short human-readable message about the node update status. It must be shorter than 100 characters. // +optional // +kubebuilder:validation:Type=string // +kubebuilder:validation:MaxLength=100 From 8495ca67b053c5fbb5a59ad272ea6004502f7891 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Mon, 20 Jan 2025 16:35:33 +0100 Subject: [PATCH 45/45] `make update` --- .../generated_openapi/zz_generated.openapi.go | 1379 ++++++++++ openapi/openapi.json | 843 ++++++ ...02_updatestatuses-CustomNoUpgrade.crd.yaml | 2323 +++++++++++++++++ ...pdatestatuses-DevPreviewNoUpgrade.crd.yaml | 2323 +++++++++++++++++ ...datestatuses-TechPreviewNoUpgrade.crd.yaml | 2323 +++++++++++++++++ .../zz_generated.crd-manifests/doc.go | 1 + update/v1alpha1/zz_generated.deepcopy.go | 646 +++++ ..._generated.featuregated-crd-manifests.yaml | 25 + .../UpgradeStatus.yaml | 2323 +++++++++++++++++ .../zz_generated.swagger_doc_generated.go | 308 +++ 10 files changed, 12494 insertions(+) create mode 100644 update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-CustomNoUpgrade.crd.yaml create mode 100644 update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-DevPreviewNoUpgrade.crd.yaml create mode 100644 update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-TechPreviewNoUpgrade.crd.yaml create mode 100644 update/v1alpha1/zz_generated.crd-manifests/doc.go create mode 100644 update/v1alpha1/zz_generated.deepcopy.go create mode 100644 update/v1alpha1/zz_generated.featuregated-crd-manifests.yaml create mode 100644 update/v1alpha1/zz_generated.featuregated-crd-manifests/updatestatuses.update.openshift.io/UpgradeStatus.yaml create mode 100644 update/v1alpha1/zz_generated.swagger_doc_generated.go diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index f8bbb3a4a34..677ba38df7c 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -1251,6 +1251,32 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/template/v1.TemplateInstanceSpec": schema_openshift_api_template_v1_TemplateInstanceSpec(ref), "github.com/openshift/api/template/v1.TemplateInstanceStatus": schema_openshift_api_template_v1_TemplateInstanceStatus(ref), "github.com/openshift/api/template/v1.TemplateList": schema_openshift_api_template_v1_TemplateList(ref), + "github.com/openshift/api/update/v1alpha1.ClusterOperatorStatusInsight": schema_openshift_api_update_v1alpha1_ClusterOperatorStatusInsight(ref), + "github.com/openshift/api/update/v1alpha1.ClusterVersionStatusInsight": schema_openshift_api_update_v1alpha1_ClusterVersionStatusInsight(ref), + "github.com/openshift/api/update/v1alpha1.ControlPlane": schema_openshift_api_update_v1alpha1_ControlPlane(ref), + "github.com/openshift/api/update/v1alpha1.ControlPlaneInformer": schema_openshift_api_update_v1alpha1_ControlPlaneInformer(ref), + "github.com/openshift/api/update/v1alpha1.ControlPlaneInsight": schema_openshift_api_update_v1alpha1_ControlPlaneInsight(ref), + "github.com/openshift/api/update/v1alpha1.ControlPlaneInsightUnion": schema_openshift_api_update_v1alpha1_ControlPlaneInsightUnion(ref), + "github.com/openshift/api/update/v1alpha1.ControlPlaneUpdateVersions": schema_openshift_api_update_v1alpha1_ControlPlaneUpdateVersions(ref), + "github.com/openshift/api/update/v1alpha1.HealthInsight": schema_openshift_api_update_v1alpha1_HealthInsight(ref), + "github.com/openshift/api/update/v1alpha1.InsightImpact": schema_openshift_api_update_v1alpha1_InsightImpact(ref), + "github.com/openshift/api/update/v1alpha1.InsightRemediation": schema_openshift_api_update_v1alpha1_InsightRemediation(ref), + "github.com/openshift/api/update/v1alpha1.InsightScope": schema_openshift_api_update_v1alpha1_InsightScope(ref), + "github.com/openshift/api/update/v1alpha1.MachineConfigPoolStatusInsight": schema_openshift_api_update_v1alpha1_MachineConfigPoolStatusInsight(ref), + "github.com/openshift/api/update/v1alpha1.NodeStatusInsight": schema_openshift_api_update_v1alpha1_NodeStatusInsight(ref), + "github.com/openshift/api/update/v1alpha1.NodeSummary": schema_openshift_api_update_v1alpha1_NodeSummary(ref), + "github.com/openshift/api/update/v1alpha1.Pool": schema_openshift_api_update_v1alpha1_Pool(ref), + "github.com/openshift/api/update/v1alpha1.PoolResourceRef": schema_openshift_api_update_v1alpha1_PoolResourceRef(ref), + "github.com/openshift/api/update/v1alpha1.ResourceRef": schema_openshift_api_update_v1alpha1_ResourceRef(ref), + "github.com/openshift/api/update/v1alpha1.UpdateStatus": schema_openshift_api_update_v1alpha1_UpdateStatus(ref), + "github.com/openshift/api/update/v1alpha1.UpdateStatusList": schema_openshift_api_update_v1alpha1_UpdateStatusList(ref), + "github.com/openshift/api/update/v1alpha1.UpdateStatusSpec": schema_openshift_api_update_v1alpha1_UpdateStatusSpec(ref), + "github.com/openshift/api/update/v1alpha1.UpdateStatusStatus": schema_openshift_api_update_v1alpha1_UpdateStatusStatus(ref), + "github.com/openshift/api/update/v1alpha1.Version": schema_openshift_api_update_v1alpha1_Version(ref), + "github.com/openshift/api/update/v1alpha1.VersionMetadata": schema_openshift_api_update_v1alpha1_VersionMetadata(ref), + "github.com/openshift/api/update/v1alpha1.WorkerPoolInformer": schema_openshift_api_update_v1alpha1_WorkerPoolInformer(ref), + "github.com/openshift/api/update/v1alpha1.WorkerPoolInsight": schema_openshift_api_update_v1alpha1_WorkerPoolInsight(ref), + "github.com/openshift/api/update/v1alpha1.WorkerPoolInsightUnion": schema_openshift_api_update_v1alpha1_WorkerPoolInsightUnion(ref), "github.com/openshift/api/user/v1.Group": schema_openshift_api_user_v1_Group(ref), "github.com/openshift/api/user/v1.GroupList": schema_openshift_api_user_v1_GroupList(ref), "github.com/openshift/api/user/v1.Identity": schema_openshift_api_user_v1_Identity(ref), @@ -64138,6 +64164,1359 @@ func schema_openshift_api_template_v1_TemplateList(ref common.ReferenceCallback) } } +func schema_openshift_api_update_v1alpha1_ClusterOperatorStatusInsight(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterOperatorStatusInsight reports the state of a ClusterOperator resource (which represents a control plane component update in standalone clusters), during the update", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions provide details about the operator. It contains at most 10 items. Known conditions are: - Updating: whether the operator is updating; When Updating=False, the reason field can be Pending or Updated - Healthy: whether the operator is considered healthy; When Healthy=False, the reason field can be Unavailable or Degraded, and Unavailable is \"stronger\" than Degraded", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the operator", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "resource is the ClusterOperator resource that represents the operator", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.ResourceRef"), + }, + }, + }, + Required: []string{"name", "resource"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.ResourceRef", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, + } +} + +func schema_openshift_api_update_v1alpha1_ClusterVersionStatusInsight(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterVersionStatusInsight reports the state of a ClusterVersion resource (which represents a control plane update in standalone clusters), during the update.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions provides detailed observed conditions about ClusterVersion. It contains at most 10 items. Known conditions are: - Updating: whether the control plane (represented by this ClusterVersion) is updating", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "resource is the ClusterVersion resource that represents the control plane", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.ResourceRef"), + }, + }, + "assessment": { + SchemaProps: spec.SchemaProps{ + Description: "assessment is the assessment of the control plane update process. Valid values are: Unknown, Progressing, Completed, Degraded", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "versions": { + SchemaProps: spec.SchemaProps{ + Description: "versions contains the original and target versions of the upgrade", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.ControlPlaneUpdateVersions"), + }, + }, + "completion": { + SchemaProps: spec.SchemaProps{ + Description: "completion is a percentage of the update completion (0-100)", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "startedAt": { + SchemaProps: spec.SchemaProps{ + Description: "startedAt is the time when the update started", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "completedAt": { + SchemaProps: spec.SchemaProps{ + Description: "completedAt is the time when the update completed", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "estimatedCompletedAt": { + SchemaProps: spec.SchemaProps{ + Description: "estimatedCompletedAt is the estimated time when the update will complete", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + }, + Required: []string{"resource", "assessment", "versions", "completion", "startedAt"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.ControlPlaneUpdateVersions", "github.com/openshift/api/update/v1alpha1.ResourceRef", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_openshift_api_update_v1alpha1_ControlPlane(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlane contains a summary and insights related to the control plane update.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions provides details about the control plane update. This is a high-level status of an abstract control plane concept, and will typically be the controller's interpretation / summarization of the insights it received (that will be placed in .informers[].insights for clients that want to perform further analysis of the data). Known condition types are: * \"Updating\": Whether the cluster control plane is currently updating or not", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "resource is the resource that represents the control plane. It will typically be a ClusterVersion resource in standalone OpenShift and HostedCluster in Hosted Control Planes. This field is optional because the information may be unknown temporarily.", + Ref: ref("github.com/openshift/api/update/v1alpha1.ResourceRef"), + }, + }, + "poolResource": { + SchemaProps: spec.SchemaProps{ + Description: "poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools, and also because the information may be unknown temporarily.", + Ref: ref("github.com/openshift/api/update/v1alpha1.PoolResourceRef"), + }, + }, + "informers": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "informers is a list of insight producers. An informer is a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to the control plane update. Contains at most 16 items.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.ControlPlaneInformer"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.ControlPlaneInformer", "github.com/openshift/api/update/v1alpha1.PoolResourceRef", "github.com/openshift/api/update/v1alpha1.ResourceRef", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, + } +} + +func schema_openshift_api_update_v1alpha1_ControlPlaneInformer(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneInformer represents a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to the control plane update.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the insight producer", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "insights": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "uid", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "uid", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "insights is a list of insights produced by this producer. Insights are units of information relevant to an update progress or health information. There are two types of update insights: status insights and health insights. The first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not.\n\nStatus Insights expose the state of a single resource that is directly involved in the update process, usually a resource that either has a notion of \"being updated,\" (such as a Node or ClusterOperator) or represents a higher-level abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents a pool of nodes).\n\nHealth Insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate a condition that warrants attention by the cluster administrator.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.ControlPlaneInsight"), + }, + }, + }, + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.ControlPlaneInsight"}, + } +} + +func schema_openshift_api_update_v1alpha1_ControlPlaneInsight(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneInsight is a unique piece of either status/progress or update health information produced by update informer", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "uid": { + SchemaProps: spec.SchemaProps{ + Description: "uid identifies the insight over time", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "acquiredAt": { + SchemaProps: spec.SchemaProps{ + Description: "acquiredAt is the time when the data was acquired by the producer", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "insight": { + SchemaProps: spec.SchemaProps{ + Description: "insight is a discriminated union of all insights types that can be reported for the control plane", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.ControlPlaneInsightUnion"), + }, + }, + }, + Required: []string{"uid", "acquiredAt", "insight"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.ControlPlaneInsightUnion", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_openshift_api_update_v1alpha1_ControlPlaneInsightUnion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneInsightUnion is the discriminated union of all insights types that can be reported for the control plane, identified by type field", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type identifies the type of the update insight, one of: ClusterVersion, ClusterOperator, MachineConfigPool, Node, Health ClusterVersion, ClusterOperator, MachineConfigPool, Node types are progress insights about a resource directly involved in the update process Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "clusterVersion": { + SchemaProps: spec.SchemaProps{ + Description: "clusterVersion is a status insight about the state of a control plane update, where the control plane is represented by a ClusterVersion resource usually managed by CVO", + Ref: ref("github.com/openshift/api/update/v1alpha1.ClusterVersionStatusInsight"), + }, + }, + "clusterOperator": { + SchemaProps: spec.SchemaProps{ + Description: "clusterOperator is a status insight about the state of a control plane cluster operator update represented by a ClusterOperator resource", + Ref: ref("github.com/openshift/api/update/v1alpha1.ClusterOperatorStatusInsight"), + }, + }, + "machineConfigPool": { + SchemaProps: spec.SchemaProps{ + Description: "machineConfigPool is a status insight about the state of a worker pool update, where the worker pool is represented by a MachineConfigPool resource", + Ref: ref("github.com/openshift/api/update/v1alpha1.MachineConfigPoolStatusInsight"), + }, + }, + "node": { + SchemaProps: spec.SchemaProps{ + Description: "node is a status insight about the state of a worker node update, where the worker node is represented by a Node resource", + Ref: ref("github.com/openshift/api/update/v1alpha1.NodeStatusInsight"), + }, + }, + "health": { + SchemaProps: spec.SchemaProps{ + Description: "health is a generic health insight about the update. It does not represent a status of any specific resource but surfaces actionable information about the health of the cluster or an update", + Ref: ref("github.com/openshift/api/update/v1alpha1.HealthInsight"), + }, + }, + }, + Required: []string{"type"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "type", + "fields-to-discriminateBy": map[string]interface{}{ + "clusterOperator": "ClusterOperatorStatusInsight", + "clusterVersion": "ClusterVersionStatusInsight", + "health": "HealthInsight", + "machineConfigPool": "MachineConfigPoolStatusInsight", + "node": "NodeStatusInsight", + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.ClusterOperatorStatusInsight", "github.com/openshift/api/update/v1alpha1.ClusterVersionStatusInsight", "github.com/openshift/api/update/v1alpha1.HealthInsight", "github.com/openshift/api/update/v1alpha1.MachineConfigPoolStatusInsight", "github.com/openshift/api/update/v1alpha1.NodeStatusInsight"}, + } +} + +func schema_openshift_api_update_v1alpha1_ControlPlaneUpdateVersions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneUpdateVersions contains the original and target versions of the upgrade", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "previous": { + SchemaProps: spec.SchemaProps{ + Description: "previous is the version of the control plane before the update. When the cluster is being installed for the first time, the version will have a placeholder value '' and carry 'Installation' metadata", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.Version"), + }, + }, + "target": { + SchemaProps: spec.SchemaProps{ + Description: "target is the version of the control plane after the update. It may never be '' or have `Installation` metadata", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.Version"), + }, + }, + }, + Required: []string{"previous", "target"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.Version"}, + } +} + +func schema_openshift_api_update_v1alpha1_HealthInsight(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "HealthInsight is a piece of actionable information produced by an insight producer about the health of the cluster or an update", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "startedAt": { + SchemaProps: spec.SchemaProps{ + Description: "startedAt is the time when the condition reported by the insight started", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "scope": { + SchemaProps: spec.SchemaProps{ + Description: "scope is list of objects involved in the insight", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.InsightScope"), + }, + }, + "impact": { + SchemaProps: spec.SchemaProps{ + Description: "impact describes the impact the reported condition has on the cluster or update", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.InsightImpact"), + }, + }, + "remediation": { + SchemaProps: spec.SchemaProps{ + Description: "remediation contains information about how to resolve or prevent the reported condition", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.InsightRemediation"), + }, + }, + }, + Required: []string{"startedAt", "scope", "impact", "remediation"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.InsightImpact", "github.com/openshift/api/update/v1alpha1.InsightRemediation", "github.com/openshift/api/update/v1alpha1.InsightScope", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_openshift_api_update_v1alpha1_InsightImpact(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "InsightImpact describes the impact the reported condition has on the cluster or update", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "level": { + SchemaProps: spec.SchemaProps{ + Description: "level is the severity of the impact. Valid values are Unknown, Info, Warning, Error, Critical.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "summary": { + SchemaProps: spec.SchemaProps{ + Description: "summary is a short summary of the impact. It must not be empty and must be shorter than 256 characters.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "description": { + SchemaProps: spec.SchemaProps{ + Description: "description is a human-oriented, possibly longer-form description of the condition reported by the insight It must be shorter than 4096 characters.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"level", "type", "summary"}, + }, + }, + } +} + +func schema_openshift_api_update_v1alpha1_InsightRemediation(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "InsightRemediation contains information about how to resolve or prevent the reported condition", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "reference": { + SchemaProps: spec.SchemaProps{ + Description: "reference is a URL where administrators can find information to resolve or prevent the reported condition", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "estimatedFinish": { + SchemaProps: spec.SchemaProps{ + Description: "estimatedFinish is the estimated time when the informer expects the condition to be resolved, if applicable.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + }, + Required: []string{"reference"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_openshift_api_update_v1alpha1_InsightScope(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "InsightScope is a list of resources involved in the insight", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type is either ControlPlane or WorkerPool", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resources": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "resources is a list of resources involved in the insight, of any group/kind. Maximum 16 resources can be listed.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.ResourceRef"), + }, + }, + }, + }, + }, + }, + Required: []string{"type"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.ResourceRef"}, + } +} + +func schema_openshift_api_update_v1alpha1_MachineConfigPoolStatusInsight(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineConfigPoolStatusInsight reports the state of a MachineConfigPool resource during the update", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the machine config pool", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "resource is the MachineConfigPool resource that represents the pool\n\nNote: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to resource name (because the rest is implied by status insight type). However, because we use resource references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable than type safety for producers.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.PoolResourceRef"), + }, + }, + "scopeType": { + SchemaProps: spec.SchemaProps{ + Description: "scopeType describes whether the pool is a control plane or a worker pool", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "assessment": { + SchemaProps: spec.SchemaProps{ + Description: "assessment is the assessment of the machine config pool update process. Valid values are: Pending, Completed, Degraded, Excluded, Progressing", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "completion": { + SchemaProps: spec.SchemaProps{ + Description: "completion is a percentage of the update completion (0-100)", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "summaries": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.). Maximum 16 items can be listed.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.NodeSummary"), + }, + }, + }, + }, + }, + }, + Required: []string{"name", "resource", "scopeType", "assessment", "completion"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.NodeSummary", "github.com/openshift/api/update/v1alpha1.PoolResourceRef", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, + } +} + +func schema_openshift_api_update_v1alpha1_NodeStatusInsight(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeStatusInsight reports the state of a Node during the update", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions provides details about the control plane update. Known conditions are: - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting - Available: whether the Node is available (accepting workloads) - Degraded: whether the Node is degraded (problem observed)", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the node", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "resource is the Node resource that represents the node\n\nNote: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to resource name (because the rest is implied by status insight type). However, because we use resource references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable than type safety for producers.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.ResourceRef"), + }, + }, + "poolResource": { + SchemaProps: spec.SchemaProps{ + Description: "poolResource is the resource that represents the pool the node is a member of\n\nNote: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows only the \"correct\" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use resource references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable than type safety for producers.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.PoolResourceRef"), + }, + }, + "scopeType": { + SchemaProps: spec.SchemaProps{ + Description: "scopeType describes whether the node belongs to control plane or a worker pool", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "version is the version of the node, when known", + Type: []string{"string"}, + Format: "", + }, + }, + "estimatedToComplete": { + SchemaProps: spec.SchemaProps{ + Description: "estimatedToComplete is the estimated time to complete the update, when known", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "message is a short human-readable message about the node update status. It must be shorter than 100 characters.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "resource", "poolResource", "scopeType"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.PoolResourceRef", "github.com/openshift/api/update/v1alpha1.ResourceRef", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"}, + } +} + +func schema_openshift_api_update_v1alpha1_NodeSummary(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeSummary is a count of nodes matching certain criteria (e.g. updated, degraded, etc.)", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded The summaries are not exclusive, a single node may be counted in multiple summaries.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "count": { + SchemaProps: spec.SchemaProps{ + Description: "count is the number of nodes matching the criteria", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"type", "count"}, + }, + }, + } +} + +func schema_openshift_api_update_v1alpha1_Pool(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Pool contains a summary and insights related to a node pool update", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions provides details about the node pool update. This is a high-level status of an abstract \"pool of nodes\" concept, and will typically be the controller's interpretation / summarization of the insights it received (that will be placed in .informers[].insights for clients that want to perform further analysis of the data). Known condition types are: * \"Updating\": Whether the pool of nodes is currently updating or not", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the pool, follows the same rules as a Kubernetes resource name (RFC-1123 subdomain)", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "resource is the resource that represents the pool, either a MachineConfigPool in Standalone OpenShift or a NodePool in Hosted Control Planes.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.PoolResourceRef"), + }, + }, + "informers": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "informers is a list of insight producers. An informer is a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to the process of updating this pool of nodes.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.WorkerPoolInformer"), + }, + }, + }, + }, + }, + }, + Required: []string{"name", "resource"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.PoolResourceRef", "github.com/openshift/api/update/v1alpha1.WorkerPoolInformer", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, + } +} + +func schema_openshift_api_update_v1alpha1_PoolResourceRef(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PoolResourceRef is a reference to a kubernetes resource that represents a node pool", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Description: "group of the object being referenced, if any", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "resource of object being referenced", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the object being referenced", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "namespace of the object being referenced, if any", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"resource", "name"}, + }, + }, + } +} + +func schema_openshift_api_update_v1alpha1_ResourceRef(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ResourceRef is a reference to a kubernetes resource, typically involved in an insight", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Description: "group of the object being referenced, if any", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "resource of object being referenced", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the object being referenced", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "namespace of the object being referenced, if any", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"resource", "name"}, + }, + }, + } +} + +func schema_openshift_api_update_v1alpha1_UpdateStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "UpdateStatus reports status for in-progress cluster version updates\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is standard Kubernetes object metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold configuration to drive what information is surfaced and how", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.UpdateStatusSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status exposes the health and status of the ongoing cluster update", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.UpdateStatusStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.UpdateStatusSpec", "github.com/openshift/api/update/v1alpha1.UpdateStatusStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_openshift_api_update_v1alpha1_UpdateStatusList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "UpdateStatusList is a list of UpdateStatus resources\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is standard Kubernetes object metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is a list of UpdateStatus resources", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.UpdateStatus"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.UpdateStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_openshift_api_update_v1alpha1_UpdateStatusSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "UpdateStatusSpec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold configuration to drive what information is surfaced and how", + Type: []string{"object"}, + }, + }, + } +} + +func schema_openshift_api_update_v1alpha1_UpdateStatusStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "UpdateStatusStatus is the API about in-progress updates. It aggregates and summarizes UpdateInsights produced by update informers", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions provide details about the controller operational matters, exposing whether the controller managing this UpdateStatus is functioning well, receives insights from individual informers, and is able to interpret them and relay them through this UpdateStatus. These condition do not communicate anything about the state of the update itself but may indicate whether the UpdateStatus content is reliable or not.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "controlPlane": { + SchemaProps: spec.SchemaProps{ + Description: "controlPlane contains a summary and insights related to the control plane update", + Ref: ref("github.com/openshift/api/update/v1alpha1.ControlPlane"), + }, + }, + "workerPools": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "workerPools contains summaries and insights related to the worker pools update. Each item in the list represents a single worker pool and carries all insights reported for it by informers. It has at most 32 items.\n so hundreds, and hypothetically more empty ones.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.Pool"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.ControlPlane", "github.com/openshift/api/update/v1alpha1.Pool", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, + } +} + +func schema_openshift_api_update_v1alpha1_Version(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Version describes a version involved in an update, typically on one side of an update edge", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "version": { + SchemaProps: spec.SchemaProps{ + Description: "version is a semantic version string, or a placeholder '' for the special case where this is a \"previous\" version in a new installation, in which case the metadata must contain an item with key 'Installation'", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "key", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "key", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.VersionMetadata"), + }, + }, + }, + }, + }, + }, + Required: []string{"version"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.VersionMetadata"}, + } +} + +func schema_openshift_api_update_v1alpha1_VersionMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata have boolean semantics (true when present, false when absent)", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Description: "key is the name of this metadata value. Valid values are: Installation, Partial, Architecture", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the payload image of the version involved in the upgrade, when relevant.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"key"}, + }, + }, + } +} + +func schema_openshift_api_update_v1alpha1_WorkerPoolInformer(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WorkerPoolInformer represents a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to a specific worker pool.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the insight producer", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "insights": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "uid", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "uid", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "insights is a list of insights produced by this producer. Insights are units of information relevant to an update progress or health information. There are two types of update insights: status insights and health insights. The first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not.\n\nStatus Insights expose the state of a single resource that is directly involved in the update process, usually a resource that either has a notion of \"being updated,\" (such as a Node or ClusterOperator) or represents a higher-level abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents a pool of nodes).\n\nHealth Insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate a condition that warrants attention by the cluster administrator.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.WorkerPoolInsight"), + }, + }, + }, + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.WorkerPoolInsight"}, + } +} + +func schema_openshift_api_update_v1alpha1_WorkerPoolInsight(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WorkerPoolInsight is a unique piece of either status/progress or update health information produced by update informer", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "uid": { + SchemaProps: spec.SchemaProps{ + Description: "uid identifies the insight over time", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "acquiredAt": { + SchemaProps: spec.SchemaProps{ + Description: "acquiredAt is the time when the data was acquired by the producer", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "insight": { + SchemaProps: spec.SchemaProps{ + Description: "insight is a discriminated union of all insights types that can be reported for a worker pool", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/update/v1alpha1.WorkerPoolInsightUnion"), + }, + }, + }, + Required: []string{"uid", "acquiredAt", "insight"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.WorkerPoolInsightUnion", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_openshift_api_update_v1alpha1_WorkerPoolInsightUnion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WorkerPoolInsightUnion is the discriminated union of insights types that can be reported for a worker pool, identified by type field", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type identifies the type of the update insight, one of: MachineConfigPool, Node, Health MachineConfigPool, Node types are progress insights about a resource directly involved in the update process Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "machineConfigPool": { + SchemaProps: spec.SchemaProps{ + Description: "machineConfigPool is a status insight about the state of a worker pool update, where the worker pool is represented by a MachineConfigPool resource", + Ref: ref("github.com/openshift/api/update/v1alpha1.MachineConfigPoolStatusInsight"), + }, + }, + "node": { + SchemaProps: spec.SchemaProps{ + Description: "node is a status insight about the state of a worker node update, where the worker node is represented by a Node resource", + Ref: ref("github.com/openshift/api/update/v1alpha1.NodeStatusInsight"), + }, + }, + "health": { + SchemaProps: spec.SchemaProps{ + Description: "health is a generic health insight about the update. It does not represent a status of any specific resource but surfaces actionable information about the health of the cluster or an update", + Ref: ref("github.com/openshift/api/update/v1alpha1.HealthInsight"), + }, + }, + }, + Required: []string{"type"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "type", + "fields-to-discriminateBy": map[string]interface{}{ + "health": "HealthInsight", + "machineConfigPool": "MachineConfigPoolStatusInsight", + "node": "NodeStatusInsight", + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/update/v1alpha1.HealthInsight", "github.com/openshift/api/update/v1alpha1.MachineConfigPoolStatusInsight", "github.com/openshift/api/update/v1alpha1.NodeStatusInsight"}, + } +} + func schema_openshift_api_user_v1_Group(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/openapi/openapi.json b/openapi/openapi.json index 24945234fde..bf8c3decf9c 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -37593,6 +37593,849 @@ } } }, + "com.github.openshift.api.update.v1alpha1.ClusterOperatorStatusInsight": { + "description": "ClusterOperatorStatusInsight reports the state of a ClusterOperator resource (which represents a control plane component update in standalone clusters), during the update", + "type": "object", + "required": [ + "name", + "resource" + ], + "properties": { + "conditions": { + "description": "conditions provide details about the operator. It contains at most 10 items. Known conditions are: - Updating: whether the operator is updating; When Updating=False, the reason field can be Pending or Updated - Healthy: whether the operator is considered healthy; When Healthy=False, the reason field can be Unavailable or Degraded, and Unavailable is \"stronger\" than Degraded", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" + }, + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" + }, + "name": { + "description": "name is the name of the operator", + "type": "string", + "default": "" + }, + "resource": { + "description": "resource is the ClusterOperator resource that represents the operator", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ResourceRef" + } + } + }, + "com.github.openshift.api.update.v1alpha1.ClusterVersionStatusInsight": { + "description": "ClusterVersionStatusInsight reports the state of a ClusterVersion resource (which represents a control plane update in standalone clusters), during the update.", + "type": "object", + "required": [ + "resource", + "assessment", + "versions", + "completion", + "startedAt" + ], + "properties": { + "assessment": { + "description": "assessment is the assessment of the control plane update process. Valid values are: Unknown, Progressing, Completed, Degraded", + "type": "string", + "default": "" + }, + "completedAt": { + "description": "completedAt is the time when the update completed", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + }, + "completion": { + "description": "completion is a percentage of the update completion (0-100)", + "type": "integer", + "format": "int32", + "default": 0 + }, + "conditions": { + "description": "conditions provides detailed observed conditions about ClusterVersion. It contains at most 10 items. Known conditions are: - Updating: whether the control plane (represented by this ClusterVersion) is updating", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" + }, + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" + }, + "estimatedCompletedAt": { + "description": "estimatedCompletedAt is the estimated time when the update will complete", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + }, + "resource": { + "description": "resource is the ClusterVersion resource that represents the control plane", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ResourceRef" + }, + "startedAt": { + "description": "startedAt is the time when the update started", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + }, + "versions": { + "description": "versions contains the original and target versions of the upgrade", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ControlPlaneUpdateVersions" + } + } + }, + "com.github.openshift.api.update.v1alpha1.ControlPlane": { + "description": "ControlPlane contains a summary and insights related to the control plane update.", + "type": "object", + "properties": { + "conditions": { + "description": "conditions provides details about the control plane update. This is a high-level status of an abstract control plane concept, and will typically be the controller's interpretation / summarization of the insights it received (that will be placed in .informers[].insights for clients that want to perform further analysis of the data). Known condition types are: * \"Updating\": Whether the cluster control plane is currently updating or not", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" + }, + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" + }, + "informers": { + "description": "informers is a list of insight producers. An informer is a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to the control plane update. Contains at most 16 items.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ControlPlaneInformer" + }, + "x-kubernetes-list-map-keys": [ + "name" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge" + }, + "poolResource": { + "description": "poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools, and also because the information may be unknown temporarily.", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.PoolResourceRef" + }, + "resource": { + "description": "resource is the resource that represents the control plane. It will typically be a ClusterVersion resource in standalone OpenShift and HostedCluster in Hosted Control Planes. This field is optional because the information may be unknown temporarily.", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ResourceRef" + } + } + }, + "com.github.openshift.api.update.v1alpha1.ControlPlaneInformer": { + "description": "ControlPlaneInformer represents a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to the control plane update.", + "type": "object", + "required": [ + "name" + ], + "properties": { + "insights": { + "description": "insights is a list of insights produced by this producer. Insights are units of information relevant to an update progress or health information. There are two types of update insights: status insights and health insights. The first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not.\n\nStatus Insights expose the state of a single resource that is directly involved in the update process, usually a resource that either has a notion of \"being updated,\" (such as a Node or ClusterOperator) or represents a higher-level abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents a pool of nodes).\n\nHealth Insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate a condition that warrants attention by the cluster administrator.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ControlPlaneInsight" + }, + "x-kubernetes-list-map-keys": [ + "uid" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "uid", + "x-kubernetes-patch-strategy": "merge" + }, + "name": { + "description": "name is the name of the insight producer", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.ControlPlaneInsight": { + "description": "ControlPlaneInsight is a unique piece of either status/progress or update health information produced by update informer", + "type": "object", + "required": [ + "uid", + "acquiredAt", + "insight" + ], + "properties": { + "acquiredAt": { + "description": "acquiredAt is the time when the data was acquired by the producer", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + }, + "insight": { + "description": "insight is a discriminated union of all insights types that can be reported for the control plane", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ControlPlaneInsightUnion" + }, + "uid": { + "description": "uid identifies the insight over time", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.ControlPlaneInsightUnion": { + "description": "ControlPlaneInsightUnion is the discriminated union of all insights types that can be reported for the control plane, identified by type field", + "type": "object", + "required": [ + "type" + ], + "properties": { + "clusterOperator": { + "description": "clusterOperator is a status insight about the state of a control plane cluster operator update represented by a ClusterOperator resource", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ClusterOperatorStatusInsight" + }, + "clusterVersion": { + "description": "clusterVersion is a status insight about the state of a control plane update, where the control plane is represented by a ClusterVersion resource usually managed by CVO", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ClusterVersionStatusInsight" + }, + "health": { + "description": "health is a generic health insight about the update. It does not represent a status of any specific resource but surfaces actionable information about the health of the cluster or an update", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.HealthInsight" + }, + "machineConfigPool": { + "description": "machineConfigPool is a status insight about the state of a worker pool update, where the worker pool is represented by a MachineConfigPool resource", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.MachineConfigPoolStatusInsight" + }, + "node": { + "description": "node is a status insight about the state of a worker node update, where the worker node is represented by a Node resource", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.NodeStatusInsight" + }, + "type": { + "description": "type identifies the type of the update insight, one of: ClusterVersion, ClusterOperator, MachineConfigPool, Node, Health ClusterVersion, ClusterOperator, MachineConfigPool, Node types are progress insights about a resource directly involved in the update process Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update.", + "type": "string", + "default": "" + } + }, + "x-kubernetes-unions": [ + { + "discriminator": "type", + "fields-to-discriminateBy": { + "clusterOperator": "ClusterOperatorStatusInsight", + "clusterVersion": "ClusterVersionStatusInsight", + "health": "HealthInsight", + "machineConfigPool": "MachineConfigPoolStatusInsight", + "node": "NodeStatusInsight" + } + } + ] + }, + "com.github.openshift.api.update.v1alpha1.ControlPlaneUpdateVersions": { + "description": "ControlPlaneUpdateVersions contains the original and target versions of the upgrade", + "type": "object", + "required": [ + "previous", + "target" + ], + "properties": { + "previous": { + "description": "previous is the version of the control plane before the update. When the cluster is being installed for the first time, the version will have a placeholder value '' and carry 'Installation' metadata", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.Version" + }, + "target": { + "description": "target is the version of the control plane after the update. It may never be '' or have `Installation` metadata", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.Version" + } + } + }, + "com.github.openshift.api.update.v1alpha1.HealthInsight": { + "description": "HealthInsight is a piece of actionable information produced by an insight producer about the health of the cluster or an update", + "type": "object", + "required": [ + "startedAt", + "scope", + "impact", + "remediation" + ], + "properties": { + "impact": { + "description": "impact describes the impact the reported condition has on the cluster or update", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.InsightImpact" + }, + "remediation": { + "description": "remediation contains information about how to resolve or prevent the reported condition", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.InsightRemediation" + }, + "scope": { + "description": "scope is list of objects involved in the insight", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.InsightScope" + }, + "startedAt": { + "description": "startedAt is the time when the condition reported by the insight started", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + } + } + }, + "com.github.openshift.api.update.v1alpha1.InsightImpact": { + "description": "InsightImpact describes the impact the reported condition has on the cluster or update", + "type": "object", + "required": [ + "level", + "type", + "summary" + ], + "properties": { + "description": { + "description": "description is a human-oriented, possibly longer-form description of the condition reported by the insight It must be shorter than 4096 characters.", + "type": "string" + }, + "level": { + "description": "level is the severity of the impact. Valid values are Unknown, Info, Warning, Error, Critical.", + "type": "string", + "default": "" + }, + "summary": { + "description": "summary is a short summary of the impact. It must not be empty and must be shorter than 256 characters.", + "type": "string", + "default": "" + }, + "type": { + "description": "type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled.", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.InsightRemediation": { + "description": "InsightRemediation contains information about how to resolve or prevent the reported condition", + "type": "object", + "required": [ + "reference" + ], + "properties": { + "estimatedFinish": { + "description": "estimatedFinish is the estimated time when the informer expects the condition to be resolved, if applicable.", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + }, + "reference": { + "description": "reference is a URL where administrators can find information to resolve or prevent the reported condition", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.InsightScope": { + "description": "InsightScope is a list of resources involved in the insight", + "type": "object", + "required": [ + "type" + ], + "properties": { + "resources": { + "description": "resources is a list of resources involved in the insight, of any group/kind. Maximum 16 resources can be listed.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ResourceRef" + }, + "x-kubernetes-list-type": "atomic" + }, + "type": { + "description": "type is either ControlPlane or WorkerPool", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.MachineConfigPoolStatusInsight": { + "description": "MachineConfigPoolStatusInsight reports the state of a MachineConfigPool resource during the update", + "type": "object", + "required": [ + "name", + "resource", + "scopeType", + "assessment", + "completion" + ], + "properties": { + "assessment": { + "description": "assessment is the assessment of the machine config pool update process. Valid values are: Pending, Completed, Degraded, Excluded, Progressing", + "type": "string", + "default": "" + }, + "completion": { + "description": "completion is a percentage of the update completion (0-100)", + "type": "integer", + "format": "int32", + "default": 0 + }, + "conditions": { + "description": "conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" + }, + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" + }, + "name": { + "description": "name is the name of the machine config pool", + "type": "string", + "default": "" + }, + "resource": { + "description": "resource is the MachineConfigPool resource that represents the pool\n\nNote: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to resource name (because the rest is implied by status insight type). However, because we use resource references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable than type safety for producers.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.PoolResourceRef" + }, + "scopeType": { + "description": "scopeType describes whether the pool is a control plane or a worker pool", + "type": "string", + "default": "" + }, + "summaries": { + "description": "summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.). Maximum 16 items can be listed.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.NodeSummary" + }, + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" + } + } + }, + "com.github.openshift.api.update.v1alpha1.NodeStatusInsight": { + "description": "NodeStatusInsight reports the state of a Node during the update", + "type": "object", + "required": [ + "name", + "resource", + "poolResource", + "scopeType" + ], + "properties": { + "conditions": { + "description": "conditions provides details about the control plane update. Known conditions are: - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting - Available: whether the Node is available (accepting workloads) - Degraded: whether the Node is degraded (problem observed)", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" + }, + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" + }, + "estimatedToComplete": { + "description": "estimatedToComplete is the estimated time to complete the update, when known", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Duration" + }, + "message": { + "description": "message is a short human-readable message about the node update status. It must be shorter than 100 characters.", + "type": "string" + }, + "name": { + "description": "name is the name of the node", + "type": "string", + "default": "" + }, + "poolResource": { + "description": "poolResource is the resource that represents the pool the node is a member of\n\nNote: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows only the \"correct\" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use resource references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable than type safety for producers.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.PoolResourceRef" + }, + "resource": { + "description": "resource is the Node resource that represents the node\n\nNote: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to resource name (because the rest is implied by status insight type). However, because we use resource references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable than type safety for producers.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ResourceRef" + }, + "scopeType": { + "description": "scopeType describes whether the node belongs to control plane or a worker pool", + "type": "string", + "default": "" + }, + "version": { + "description": "version is the version of the node, when known", + "type": "string" + } + } + }, + "com.github.openshift.api.update.v1alpha1.NodeSummary": { + "description": "NodeSummary is a count of nodes matching certain criteria (e.g. updated, degraded, etc.)", + "type": "object", + "required": [ + "type", + "count" + ], + "properties": { + "count": { + "description": "count is the number of nodes matching the criteria", + "type": "integer", + "format": "int32", + "default": 0 + }, + "type": { + "description": "type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded The summaries are not exclusive, a single node may be counted in multiple summaries.", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.Pool": { + "description": "Pool contains a summary and insights related to a node pool update", + "type": "object", + "required": [ + "name", + "resource" + ], + "properties": { + "conditions": { + "description": "conditions provides details about the node pool update. This is a high-level status of an abstract \"pool of nodes\" concept, and will typically be the controller's interpretation / summarization of the insights it received (that will be placed in .informers[].insights for clients that want to perform further analysis of the data). Known condition types are: * \"Updating\": Whether the pool of nodes is currently updating or not", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" + }, + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" + }, + "informers": { + "description": "informers is a list of insight producers. An informer is a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to the process of updating this pool of nodes.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.WorkerPoolInformer" + }, + "x-kubernetes-list-map-keys": [ + "name" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge" + }, + "name": { + "description": "name is the name of the pool, follows the same rules as a Kubernetes resource name (RFC-1123 subdomain)", + "type": "string", + "default": "" + }, + "resource": { + "description": "resource is the resource that represents the pool, either a MachineConfigPool in Standalone OpenShift or a NodePool in Hosted Control Planes.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.PoolResourceRef" + } + } + }, + "com.github.openshift.api.update.v1alpha1.PoolResourceRef": { + "description": "PoolResourceRef is a reference to a kubernetes resource that represents a node pool", + "type": "object", + "required": [ + "resource", + "name" + ], + "properties": { + "group": { + "description": "group of the object being referenced, if any", + "type": "string" + }, + "name": { + "description": "name of the object being referenced", + "type": "string", + "default": "" + }, + "namespace": { + "description": "namespace of the object being referenced, if any", + "type": "string" + }, + "resource": { + "description": "resource of object being referenced", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.ResourceRef": { + "description": "ResourceRef is a reference to a kubernetes resource, typically involved in an insight", + "type": "object", + "required": [ + "resource", + "name" + ], + "properties": { + "group": { + "description": "group of the object being referenced, if any", + "type": "string" + }, + "name": { + "description": "name of the object being referenced", + "type": "string", + "default": "" + }, + "namespace": { + "description": "namespace of the object being referenced, if any", + "type": "string" + }, + "resource": { + "description": "resource of object being referenced", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.UpdateStatus": { + "description": "UpdateStatus reports status for in-progress cluster version updates\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + "type": "object", + "required": [ + "spec" + ], + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "description": "metadata is standard Kubernetes object metadata", + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" + }, + "spec": { + "description": "spec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold configuration to drive what information is surfaced and how", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.UpdateStatusSpec" + }, + "status": { + "description": "status exposes the health and status of the ongoing cluster update", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.UpdateStatusStatus" + } + } + }, + "com.github.openshift.api.update.v1alpha1.UpdateStatusList": { + "description": "UpdateStatusList is a list of UpdateStatus resources\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + "type": "object", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "items": { + "description": "items is a list of UpdateStatus resources", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.UpdateStatus" + } + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "description": "metadata is standard Kubernetes object metadata", + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" + } + } + }, + "com.github.openshift.api.update.v1alpha1.UpdateStatusSpec": { + "description": "UpdateStatusSpec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold configuration to drive what information is surfaced and how", + "type": "object" + }, + "com.github.openshift.api.update.v1alpha1.UpdateStatusStatus": { + "description": "UpdateStatusStatus is the API about in-progress updates. It aggregates and summarizes UpdateInsights produced by update informers", + "type": "object", + "properties": { + "conditions": { + "description": "conditions provide details about the controller operational matters, exposing whether the controller managing this UpdateStatus is functioning well, receives insights from individual informers, and is able to interpret them and relay them through this UpdateStatus. These condition do not communicate anything about the state of the update itself but may indicate whether the UpdateStatus content is reliable or not.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" + }, + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge" + }, + "controlPlane": { + "description": "controlPlane contains a summary and insights related to the control plane update", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.ControlPlane" + }, + "workerPools": { + "description": "workerPools contains summaries and insights related to the worker pools update. Each item in the list represents a single worker pool and carries all insights reported for it by informers. It has at most 32 items.\n so hundreds, and hypothetically more empty ones.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.Pool" + }, + "x-kubernetes-list-map-keys": [ + "name" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge" + } + } + }, + "com.github.openshift.api.update.v1alpha1.Version": { + "description": "Version describes a version involved in an update, typically on one side of an update edge", + "type": "object", + "required": [ + "version" + ], + "properties": { + "metadata": { + "description": "metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.VersionMetadata" + }, + "x-kubernetes-list-map-keys": [ + "key" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "key", + "x-kubernetes-patch-strategy": "merge" + }, + "version": { + "description": "version is a semantic version string, or a placeholder '' for the special case where this is a \"previous\" version in a new installation, in which case the metadata must contain an item with key 'Installation'", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.VersionMetadata": { + "description": "VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata have boolean semantics (true when present, false when absent)", + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "description": "key is the name of this metadata value. Valid values are: Installation, Partial, Architecture", + "type": "string", + "default": "" + }, + "value": { + "description": "value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the payload image of the version involved in the upgrade, when relevant.", + "type": "string" + } + } + }, + "com.github.openshift.api.update.v1alpha1.WorkerPoolInformer": { + "description": "WorkerPoolInformer represents a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to a specific worker pool.", + "type": "object", + "required": [ + "name" + ], + "properties": { + "insights": { + "description": "insights is a list of insights produced by this producer. Insights are units of information relevant to an update progress or health information. There are two types of update insights: status insights and health insights. The first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not.\n\nStatus Insights expose the state of a single resource that is directly involved in the update process, usually a resource that either has a notion of \"being updated,\" (such as a Node or ClusterOperator) or represents a higher-level abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents a pool of nodes).\n\nHealth Insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate a condition that warrants attention by the cluster administrator.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.WorkerPoolInsight" + }, + "x-kubernetes-list-map-keys": [ + "uid" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "uid", + "x-kubernetes-patch-strategy": "merge" + }, + "name": { + "description": "name is the name of the insight producer", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.WorkerPoolInsight": { + "description": "WorkerPoolInsight is a unique piece of either status/progress or update health information produced by update informer", + "type": "object", + "required": [ + "uid", + "acquiredAt", + "insight" + ], + "properties": { + "acquiredAt": { + "description": "acquiredAt is the time when the data was acquired by the producer", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + }, + "insight": { + "description": "insight is a discriminated union of all insights types that can be reported for a worker pool", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.WorkerPoolInsightUnion" + }, + "uid": { + "description": "uid identifies the insight over time", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.update.v1alpha1.WorkerPoolInsightUnion": { + "description": "WorkerPoolInsightUnion is the discriminated union of insights types that can be reported for a worker pool, identified by type field", + "type": "object", + "required": [ + "type" + ], + "properties": { + "health": { + "description": "health is a generic health insight about the update. It does not represent a status of any specific resource but surfaces actionable information about the health of the cluster or an update", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.HealthInsight" + }, + "machineConfigPool": { + "description": "machineConfigPool is a status insight about the state of a worker pool update, where the worker pool is represented by a MachineConfigPool resource", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.MachineConfigPoolStatusInsight" + }, + "node": { + "description": "node is a status insight about the state of a worker node update, where the worker node is represented by a Node resource", + "$ref": "#/definitions/com.github.openshift.api.update.v1alpha1.NodeStatusInsight" + }, + "type": { + "description": "type identifies the type of the update insight, one of: MachineConfigPool, Node, Health MachineConfigPool, Node types are progress insights about a resource directly involved in the update process Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update.", + "type": "string", + "default": "" + } + }, + "x-kubernetes-unions": [ + { + "discriminator": "type", + "fields-to-discriminateBy": { + "health": "HealthInsight", + "machineConfigPool": "MachineConfigPoolStatusInsight", + "node": "NodeStatusInsight" + } + } + ] + }, "com.github.openshift.api.user.v1.Group": { "description": "Group represents a referenceable set of Users\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "type": "object", diff --git a/update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-CustomNoUpgrade.crd.yaml b/update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-CustomNoUpgrade.crd.yaml new file mode 100644 index 00000000000..7dbbb6b6803 --- /dev/null +++ b/update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-CustomNoUpgrade.crd.yaml @@ -0,0 +1,2323 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/2012 + api.openshift.io/merged-by-featuregates: "true" + description: Provides health and status information about OpenShift cluster updates. + displayName: UpdateStatuses + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: CustomNoUpgrade + name: updatestatuses.update.openshift.io +spec: + group: update.openshift.io + names: + kind: UpdateStatus + listKind: UpdateStatusList + plural: updatestatuses + singular: updatestatus + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + UpdateStatus reports status for in-progress cluster version updates + + Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: |- + spec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold + configuration to drive what information is surfaced and how + type: object + status: + description: status exposes the health and status of the ongoing cluster + update + properties: + conditions: + description: |- + conditions provide details about the controller operational matters, exposing whether the controller managing this + UpdateStatus is functioning well, receives insights from individual informers, and is able to interpret them and + relay them through this UpdateStatus. These condition do not communicate anything about the state of the update + itself but may indicate whether the UpdateStatus content is reliable or not. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + controlPlane: + description: controlPlane contains a summary and insights related + to the control plane update + properties: + conditions: + description: |- + conditions provides details about the control plane update. This is a high-level status of an abstract control plane + concept, and will typically be the controller's interpretation / summarization of the insights it received (that + will be placed in .informers[].insights for clients that want to perform further analysis of the data). + Known condition types are: + * "Updating": Whether the cluster control plane is currently updating or not + items: + description: Condition contains details for one aspect of the + current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + informers: + description: |- + informers is a list of insight producers. An informer is a system, internal or external to the cluster, that + produces units of information relevant to the update process, either about its progress or its health. Each + informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, + relevant to the control plane update. Contains at most 16 items. + items: + description: |- + ControlPlaneInformer represents a system, internal or external to the cluster, that produces units of information + relevant to the update process, either about its progress or its health. Each informer is identified by a name, and + contains a list of insights it contributed to the Update Status API, relevant to the control plane update. + properties: + insights: + description: |- + insights is a list of insights produced by this producer. Insights are units of information relevant to an update + progress or health information. There are two types of update insights: status insights and health insights. The + first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not. + + Status Insights expose the state of a single resource that is directly involved in the update process, usually a resource + that either has a notion of "being updated," (such as a Node or ClusterOperator) or represents a higher-level + abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents + a pool of nodes). + + Health Insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate + a condition that warrants attention by the cluster administrator. + items: + description: ControlPlaneInsight is a unique piece of + either status/progress or update health information + produced by update informer + properties: + acquiredAt: + description: acquiredAt is the time when the data + was acquired by the producer + format: date-time + type: string + insight: + description: insight is a discriminated union of all + insights types that can be reported for the control + plane + properties: + clusterOperator: + description: |- + clusterOperator is a status insight about the state of a control plane cluster operator update + represented by a ClusterOperator resource + properties: + conditions: + description: |- + conditions provide details about the operator. It contains at most 10 items. Known conditions are: + - Updating: whether the operator is updating; When Updating=False, the reason field can be Pending or Updated + - Healthy: whether the operator is considered healthy; When Healthy=False, the reason field can be Unavailable or Degraded, and Unavailable is "stronger" than Degraded + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the operator + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: resource is the ClusterOperator + resource that represents the operator + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a clusteroperators.config.openshift.io + resource + rule: self.group == 'config.openshift.io' + && self.resource == 'clusteroperators' + required: + - name + - resource + type: object + clusterVersion: + description: |- + clusterVersion is a status insight about the state of a control plane update, where + the control plane is represented by a ClusterVersion resource usually managed by CVO + properties: + assessment: + description: 'assessment is the assessment + of the control plane update process. Valid + values are: Unknown, Progressing, Completed, + Degraded' + enum: + - Unknown + - Progressing + - Completed + - Degraded + type: string + completedAt: + description: completedAt is the time when + the update completed + format: date-time + type: string + completion: + description: completion is a percentage of + the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provides detailed observed conditions about ClusterVersion. It contains at most 10 items. + Known conditions are: + - Updating: whether the control plane (represented by this ClusterVersion) is updating + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedCompletedAt: + description: estimatedCompletedAt is the estimated + time when the update will complete + format: date-time + type: string + resource: + description: resource is the ClusterVersion + resource that represents the control plane + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a clusterversions.config.openshift.io + resource + rule: self.group == 'config.openshift.io' + && self.resource == 'clusterversions' + startedAt: + description: startedAt is the time when the + update started + format: date-time + type: string + versions: + description: versions contains the original + and target versions of the upgrade + properties: + previous: + description: |- + previous is the version of the control plane before the update. When the cluster is being installed + for the first time, the version will have a placeholder value '' and carry 'Installation' metadata + properties: + metadata: + description: |- + metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional + and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' + metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items. + items: + description: |- + VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata + have boolean semantics (true when present, false when absent) + properties: + key: + description: 'key is the name + of this metadata value. Valid + values are: Installation, + Partial, Architecture' + enum: + - Installation + - Partial + - Architecture + type: string + value: + description: |- + value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation + and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the + payload image of the version involved in the upgrade, when relevant. + maxLength: 32 + type: string + required: + - key + type: object + maxItems: 5 + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + version: + description: |- + version is a semantic version string, or a placeholder '' for the special case where this + is a "previous" version in a new installation, in which case the metadata must contain an item + with key 'Installation' + maxLength: 64 + pattern: ^()|((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + x-kubernetes-validations: + - message: previous version must be + '' iff marked with Installation + metadata + rule: 'self.version == '''' + ? (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : + !(has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation''))' + required: + - version + type: object + x-kubernetes-validations: + - message: previous version must be '' + iff marked with Installation metadata + rule: 'self.version == '''' ? + (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : !(has(self.metadata) + && self.metadata.exists(m, m.key == + ''Installation''))' + target: + description: target is the version of + the control plane after the update. + It may never be '' or have `Installation` + metadata + properties: + metadata: + description: |- + metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional + and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' + metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items. + items: + description: |- + VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata + have boolean semantics (true when present, false when absent) + properties: + key: + description: 'key is the name + of this metadata value. Valid + values are: Installation, + Partial, Architecture' + enum: + - Installation + - Partial + - Architecture + type: string + value: + description: |- + value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation + and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the + payload image of the version involved in the upgrade, when relevant. + maxLength: 32 + type: string + required: + - key + type: object + maxItems: 5 + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + version: + description: |- + version is a semantic version string, or a placeholder '' for the special case where this + is a "previous" version in a new installation, in which case the metadata must contain an item + with key 'Installation' + maxLength: 64 + pattern: ^()|((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + x-kubernetes-validations: + - message: previous version must be + '' iff marked with Installation + metadata + rule: 'self.version == '''' + ? (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : + !(has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation''))' + required: + - version + type: object + x-kubernetes-validations: + - message: target version must not be + '' or have Installation metadata + rule: self.version != '' && !(has(self.metadata) + && self.metadata.exists(m, m.key == + 'Installation')) + required: + - previous + - target + type: object + required: + - assessment + - completion + - resource + - startedAt + - versions + type: object + health: + description: |- + health is a generic health insight about the update. It does not represent a status of any specific + resource but surfaces actionable information about the health of the cluster or an update + properties: + impact: + description: impact describes the impact the + reported condition has on the cluster or + update + properties: + description: + description: |- + description is a human-oriented, possibly longer-form description of the condition reported by the insight It must + be shorter than 4096 characters. + maxLength: 4096 + type: string + level: + description: level is the severity of + the impact. Valid values are Unknown, + Info, Warning, Error, Critical. + enum: + - Unknown + - Info + - Warning + - Error + - Critical + type: string + summary: + description: summary is a short summary + of the impact. It must not be empty + and must be shorter than 256 characters. + maxLength: 256 + minLength: 1 + type: string + type: + description: |- + type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, + Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled. + enum: + - None + - Unknown + - API Availability + - Cluster Capacity + - Application Availability + - Application Outage + - Data Loss + - Update Speed + - Update Stalled + type: string + required: + - level + - summary + - type + type: object + remediation: + description: remediation contains information + about how to resolve or prevent the reported + condition + properties: + estimatedFinish: + description: estimatedFinish is the estimated + time when the informer expects the condition + to be resolved, if applicable. + format: date-time + type: string + reference: + description: reference is a URL where + administrators can find information + to resolve or prevent the reported condition + maxLength: 512 + type: string + x-kubernetes-validations: + - message: reference must a valid URL + rule: isURL(self) + required: + - reference + type: object + scope: + description: scope is list of objects involved + in the insight + properties: + resources: + description: resources is a list of resources + involved in the insight, of any group/kind. + Maximum 16 resources can be listed. + items: + description: ResourceRef is a reference + to a kubernetes resource, typically + involved in an insight + properties: + group: + description: group of the object + being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + maxItems: 16 + type: array + x-kubernetes-list-type: atomic + type: + description: type is either ControlPlane + or WorkerPool + enum: + - ControlPlane + - WorkerPool + type: string + required: + - type + type: object + startedAt: + description: startedAt is the time when the + condition reported by the insight started + format: date-time + type: string + required: + - impact + - remediation + - scope + - startedAt + type: object + machineConfigPool: + description: |- + machineConfigPool is a status insight about the state of a worker pool update, where the worker pool + is represented by a MachineConfigPool resource + properties: + assessment: + description: 'assessment is the assessment + of the machine config pool update process. + Valid values are: Pending, Completed, Degraded, + Excluded, Progressing' + enum: + - Pending + - Completed + - Degraded + - Excluded + - Progressing + type: string + completion: + description: completion is a percentage of + the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: + - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the machine + config pool + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: |- + resource is the MachineConfigPool resource that represents the pool + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + scopeType: + description: scopeType describes whether the + pool is a control plane or a worker pool + enum: + - ControlPlane + - WorkerPool + type: string + summaries: + description: summaries is a list of counts + of nodes matching certain criteria (e.g. + updated, degraded, etc.). Maximum 16 items + can be listed. + items: + description: NodeSummary is a count of nodes + matching certain criteria (e.g. updated, + degraded, etc.) + properties: + count: + description: count is the number of + nodes matching the criteria + format: int32 + maximum: 4096 + minimum: 0 + type: integer + type: + description: |- + type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded + The summaries are not exclusive, a single node may be counted in multiple summaries. + enum: + - Total + - Available + - Progressing + - Outdated + - Draining + - Excluded + - Degraded + type: string + required: + - count + - type + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + required: + - assessment + - completion + - name + - resource + - scopeType + type: object + node: + description: |- + node is a status insight about the state of a worker node update, where the worker node is represented + by a Node resource + properties: + conditions: + description: |- + conditions provides details about the control plane update. Known conditions are: + - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting + - Available: whether the Node is available (accepting workloads) + - Degraded: whether the Node is degraded (problem observed) + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedToComplete: + description: estimatedToComplete is the estimated + time to complete the update, when known + format: duration + type: string + message: + description: message is a short human-readable + message about the node update status. It + must be shorter than 100 characters. + maxLength: 100 + type: string + name: + description: name is the name of the node + maxLength: 253 + minLength: 1 + type: string + poolResource: + description: |- + poolResource is the resource that represents the pool the node is a member of + + Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + resource references in many places and this API is intended to be consumed by clients, not produced, consistency + seems to be more valuable than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the Node resource that represents the node + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a nodes.core.k8s.io + resource + rule: self.group == '' && self.resource + == 'nodes' + scopeType: + description: scopeType describes whether the + node belongs to control plane or a worker + pool + enum: + - ControlPlane + - WorkerPool + type: string + version: + description: version is the version of the + node, when known + maxLength: 64 + pattern: ^((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + required: + - name + - poolResource + - resource + - scopeType + type: object + type: + description: |- + type identifies the type of the update insight, one of: ClusterVersion, ClusterOperator, MachineConfigPool, Node, Health + ClusterVersion, ClusterOperator, MachineConfigPool, Node types are progress insights about a resource directly + involved in the update process + Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. + enum: + - ClusterVersion + - ClusterOperator + - MachineConfigPool + - Node + - Health + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: clusterVersion is required when type is + ClusterVersion, and forbidden otherwise + rule: 'has(self.type) && self.type == ''ClusterVersion'' + ? has(self.clusterVersion) : !has(self.clusterVersion)' + - message: clusterOperator is required when type is + ClusterOperator, and forbidden otherwise + rule: 'has(self.type) && self.type == ''ClusterOperator'' + ? has(self.clusterOperator) : !has(self.clusterOperator)' + - message: machineConfigPool is required when type + is MachineConfigPool, and forbidden otherwise + rule: 'has(self.type) && self.type == ''MachineConfigPool'' + ? has(self.machineConfigPool) : !has(self.machineConfigPool)' + - message: node is required when type is Node, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Node'' ? has(self.node) + : !has(self.node)' + - message: health is required when type is Health, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Health'' + ? has(self.health) : !has(self.health)' + uid: + description: uid identifies the insight over time + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - acquiredAt + - insight + - uid + type: object + maxItems: 128 + type: array + x-kubernetes-list-map-keys: + - uid + x-kubernetes-list-type: map + name: + description: name is the name of the insight producer + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + poolResource: + description: |- + poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field + is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools, + and also because the information may be unknown temporarily. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: controlPlane.poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: (self.group == 'machineconfiguration.openshift.io' && + self.resource == 'machineconfigpools') + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource == 'machineconfigpools' + && self.group == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the resource that represents the control plane. It will typically be a ClusterVersion resource + in standalone OpenShift and HostedCluster in Hosted Control Planes. This field is optional because the information + may be unknown temporarily. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: controlPlane.resource must be either a clusterversions.config.openshift.io + or a hostedclusters.hypershift.openshift.io resource + rule: (self.group == 'config.openshift.io' && self.resource + == 'clusterversions') || (self.group == 'hypershift.openshift.io' + && self.resource == 'hostedclusters') + type: object + workerPools: + description: |- + workerPools contains summaries and insights related to the worker pools update. Each item in the list represents + a single worker pool and carries all insights reported for it by informers. It has at most 32 items. + so hundreds, and hypothetically more empty ones. + items: + description: Pool contains a summary and insights related to a node + pool update + properties: + conditions: + description: |- + conditions provides details about the node pool update. This is a high-level status of an abstract "pool of nodes" + concept, and will typically be the controller's interpretation / summarization of the insights it received (that + will be placed in .informers[].insights for clients that want to perform further analysis of the data). + Known condition types are: + * "Updating": Whether the pool of nodes is currently updating or not + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + informers: + description: |- + informers is a list of insight producers. An informer is a system, internal or external to the cluster, that + produces units of information relevant to the update process, either about its progress or its health. Each + informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, + relevant to the process of updating this pool of nodes. + items: + description: |- + WorkerPoolInformer represents a system, internal or external to the cluster, that produces units of information + relevant to the update process, either about its progress or its health. Each informer is identified by a name, and + contains a list of insights it contributed to the Update Status API, relevant to a specific worker pool. + properties: + insights: + description: |- + insights is a list of insights produced by this producer. Insights are units of information relevant to an update + progress or health information. There are two types of update insights: status insights and health insights. The + first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not. + + Status Insights expose the state of a single resource that is directly involved in the update process, usually a resource + that either has a notion of "being updated," (such as a Node or ClusterOperator) or represents a higher-level + abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents + a pool of nodes). + + Health Insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate + a condition that warrants attention by the cluster administrator. + items: + description: WorkerPoolInsight is a unique piece of + either status/progress or update health information + produced by update informer + properties: + acquiredAt: + description: acquiredAt is the time when the data + was acquired by the producer + format: date-time + type: string + insight: + description: insight is a discriminated union of + all insights types that can be reported for a + worker pool + properties: + health: + description: |- + health is a generic health insight about the update. It does not represent a status of any specific + resource but surfaces actionable information about the health of the cluster or an update + properties: + impact: + description: impact describes the impact + the reported condition has on the cluster + or update + properties: + description: + description: |- + description is a human-oriented, possibly longer-form description of the condition reported by the insight It must + be shorter than 4096 characters. + maxLength: 4096 + type: string + level: + description: level is the severity of + the impact. Valid values are Unknown, + Info, Warning, Error, Critical. + enum: + - Unknown + - Info + - Warning + - Error + - Critical + type: string + summary: + description: summary is a short summary + of the impact. It must not be empty + and must be shorter than 256 characters. + maxLength: 256 + minLength: 1 + type: string + type: + description: |- + type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, + Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled. + enum: + - None + - Unknown + - API Availability + - Cluster Capacity + - Application Availability + - Application Outage + - Data Loss + - Update Speed + - Update Stalled + type: string + required: + - level + - summary + - type + type: object + remediation: + description: remediation contains information + about how to resolve or prevent the reported + condition + properties: + estimatedFinish: + description: estimatedFinish is the + estimated time when the informer expects + the condition to be resolved, if applicable. + format: date-time + type: string + reference: + description: reference is a URL where + administrators can find information + to resolve or prevent the reported + condition + maxLength: 512 + type: string + x-kubernetes-validations: + - message: reference must a valid URL + rule: isURL(self) + required: + - reference + type: object + scope: + description: scope is list of objects involved + in the insight + properties: + resources: + description: resources is a list of + resources involved in the insight, + of any group/kind. Maximum 16 resources + can be listed. + items: + description: ResourceRef is a reference + to a kubernetes resource, typically + involved in an insight + properties: + group: + description: group of the object + being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the + object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + maxItems: 16 + type: array + x-kubernetes-list-type: atomic + type: + description: type is either ControlPlane + or WorkerPool + enum: + - ControlPlane + - WorkerPool + type: string + required: + - type + type: object + startedAt: + description: startedAt is the time when + the condition reported by the insight + started + format: date-time + type: string + required: + - impact + - remediation + - scope + - startedAt + type: object + machineConfigPool: + description: |- + machineConfigPool is a status insight about the state of a worker pool update, where the worker pool + is represented by a MachineConfigPool resource + properties: + assessment: + description: 'assessment is the assessment + of the machine config pool update process. + Valid values are: Pending, Completed, + Degraded, Excluded, Progressing' + enum: + - Pending + - Completed + - Degraded + - Excluded + - Progressing + type: string + completion: + description: completion is a percentage + of the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: + - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded + items: + description: Condition contains details + for one aspect of the current state + of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in + CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the machine + config pool + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: |- + resource is the MachineConfigPool resource that represents the pool + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + scopeType: + description: scopeType describes whether + the pool is a control plane or a worker + pool + enum: + - ControlPlane + - WorkerPool + type: string + summaries: + description: summaries is a list of counts + of nodes matching certain criteria (e.g. + updated, degraded, etc.). Maximum 16 items + can be listed. + items: + description: NodeSummary is a count of + nodes matching certain criteria (e.g. + updated, degraded, etc.) + properties: + count: + description: count is the number of + nodes matching the criteria + format: int32 + maximum: 4096 + minimum: 0 + type: integer + type: + description: |- + type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded + The summaries are not exclusive, a single node may be counted in multiple summaries. + enum: + - Total + - Available + - Progressing + - Outdated + - Draining + - Excluded + - Degraded + type: string + required: + - count + - type + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + required: + - assessment + - completion + - name + - resource + - scopeType + type: object + node: + description: |- + node is a status insight about the state of a worker node update, where the worker node is represented + by a Node resource + properties: + conditions: + description: |- + conditions provides details about the control plane update. Known conditions are: + - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting + - Available: whether the Node is available (accepting workloads) + - Degraded: whether the Node is degraded (problem observed) + items: + description: Condition contains details + for one aspect of the current state + of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in + CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedToComplete: + description: estimatedToComplete is the + estimated time to complete the update, + when known + format: duration + type: string + message: + description: message is a short human-readable + message about the node update status. + It must be shorter than 100 characters. + maxLength: 100 + type: string + name: + description: name is the name of the node + maxLength: 253 + minLength: 1 + type: string + poolResource: + description: |- + poolResource is the resource that represents the pool the node is a member of + + Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + resource references in many places and this API is intended to be consumed by clients, not produced, consistency + seems to be more valuable than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the Node resource that represents the node + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a nodes.core.k8s.io + resource + rule: self.group == '' && self.resource + == 'nodes' + scopeType: + description: scopeType describes whether + the node belongs to control plane or a + worker pool + enum: + - ControlPlane + - WorkerPool + type: string + version: + description: version is the version of the + node, when known + maxLength: 64 + pattern: ^((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + required: + - name + - poolResource + - resource + - scopeType + type: object + type: + description: |- + type identifies the type of the update insight, one of: MachineConfigPool, Node, Health + MachineConfigPool, Node types are progress insights about a resource directly involved in the update process + Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. + enum: + - MachineConfigPool + - Node + - Health + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: machineConfigPool is required when type + is MachineConfigPool, and forbidden otherwise + rule: 'has(self.type) && self.type == ''MachineConfigPool'' + ? has(self.machineConfigPool) : !has(self.machineConfigPool)' + - message: node is required when type is Node, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Node'' + ? has(self.node) : !has(self.node)' + - message: health is required when type is Health, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Health'' + ? has(self.health) : !has(self.health)' + uid: + description: uid identifies the insight over time + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - acquiredAt + - insight + - uid + type: object + maxItems: 1024 + type: array + x-kubernetes-list-map-keys: + - uid + x-kubernetes-list-type: map + name: + description: name is the name of the insight producer + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist + of lower case alphanumeric characters, '-' or '.', + and must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + name: + description: name is the name of the pool, follows the same + rules as a Kubernetes resource name (RFC-1123 subdomain) + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + resource: + description: |- + resource is the resource that represents the pool, either a MachineConfigPool in Standalone OpenShift or a NodePool + in Hosted Control Planes. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: workerPools[].poolResource must be a machineconfigpools.machineconfiguration.openshift.io + or hostedclusters.hypershift.openshift.io resource + rule: (self.group == 'machineconfiguration.openshift.io' && + self.resource == 'machineconfigpools') || (self.group == + 'hypershift.openshift.io' && self.resource == 'nodepools') + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource == 'machineconfigpools' + && self.group == 'machineconfiguration.openshift.io' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: workerPools .name must match .resource.name + rule: self.name == self.resource.name + maxItems: 32 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-DevPreviewNoUpgrade.crd.yaml b/update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-DevPreviewNoUpgrade.crd.yaml new file mode 100644 index 00000000000..5ddb61c2b9b --- /dev/null +++ b/update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-DevPreviewNoUpgrade.crd.yaml @@ -0,0 +1,2323 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/2012 + api.openshift.io/merged-by-featuregates: "true" + description: Provides health and status information about OpenShift cluster updates. + displayName: UpdateStatuses + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: DevPreviewNoUpgrade + name: updatestatuses.update.openshift.io +spec: + group: update.openshift.io + names: + kind: UpdateStatus + listKind: UpdateStatusList + plural: updatestatuses + singular: updatestatus + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + UpdateStatus reports status for in-progress cluster version updates + + Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: |- + spec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold + configuration to drive what information is surfaced and how + type: object + status: + description: status exposes the health and status of the ongoing cluster + update + properties: + conditions: + description: |- + conditions provide details about the controller operational matters, exposing whether the controller managing this + UpdateStatus is functioning well, receives insights from individual informers, and is able to interpret them and + relay them through this UpdateStatus. These condition do not communicate anything about the state of the update + itself but may indicate whether the UpdateStatus content is reliable or not. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + controlPlane: + description: controlPlane contains a summary and insights related + to the control plane update + properties: + conditions: + description: |- + conditions provides details about the control plane update. This is a high-level status of an abstract control plane + concept, and will typically be the controller's interpretation / summarization of the insights it received (that + will be placed in .informers[].insights for clients that want to perform further analysis of the data). + Known condition types are: + * "Updating": Whether the cluster control plane is currently updating or not + items: + description: Condition contains details for one aspect of the + current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + informers: + description: |- + informers is a list of insight producers. An informer is a system, internal or external to the cluster, that + produces units of information relevant to the update process, either about its progress or its health. Each + informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, + relevant to the control plane update. Contains at most 16 items. + items: + description: |- + ControlPlaneInformer represents a system, internal or external to the cluster, that produces units of information + relevant to the update process, either about its progress or its health. Each informer is identified by a name, and + contains a list of insights it contributed to the Update Status API, relevant to the control plane update. + properties: + insights: + description: |- + insights is a list of insights produced by this producer. Insights are units of information relevant to an update + progress or health information. There are two types of update insights: status insights and health insights. The + first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not. + + Status Insights expose the state of a single resource that is directly involved in the update process, usually a resource + that either has a notion of "being updated," (such as a Node or ClusterOperator) or represents a higher-level + abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents + a pool of nodes). + + Health Insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate + a condition that warrants attention by the cluster administrator. + items: + description: ControlPlaneInsight is a unique piece of + either status/progress or update health information + produced by update informer + properties: + acquiredAt: + description: acquiredAt is the time when the data + was acquired by the producer + format: date-time + type: string + insight: + description: insight is a discriminated union of all + insights types that can be reported for the control + plane + properties: + clusterOperator: + description: |- + clusterOperator is a status insight about the state of a control plane cluster operator update + represented by a ClusterOperator resource + properties: + conditions: + description: |- + conditions provide details about the operator. It contains at most 10 items. Known conditions are: + - Updating: whether the operator is updating; When Updating=False, the reason field can be Pending or Updated + - Healthy: whether the operator is considered healthy; When Healthy=False, the reason field can be Unavailable or Degraded, and Unavailable is "stronger" than Degraded + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the operator + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: resource is the ClusterOperator + resource that represents the operator + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a clusteroperators.config.openshift.io + resource + rule: self.group == 'config.openshift.io' + && self.resource == 'clusteroperators' + required: + - name + - resource + type: object + clusterVersion: + description: |- + clusterVersion is a status insight about the state of a control plane update, where + the control plane is represented by a ClusterVersion resource usually managed by CVO + properties: + assessment: + description: 'assessment is the assessment + of the control plane update process. Valid + values are: Unknown, Progressing, Completed, + Degraded' + enum: + - Unknown + - Progressing + - Completed + - Degraded + type: string + completedAt: + description: completedAt is the time when + the update completed + format: date-time + type: string + completion: + description: completion is a percentage of + the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provides detailed observed conditions about ClusterVersion. It contains at most 10 items. + Known conditions are: + - Updating: whether the control plane (represented by this ClusterVersion) is updating + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedCompletedAt: + description: estimatedCompletedAt is the estimated + time when the update will complete + format: date-time + type: string + resource: + description: resource is the ClusterVersion + resource that represents the control plane + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a clusterversions.config.openshift.io + resource + rule: self.group == 'config.openshift.io' + && self.resource == 'clusterversions' + startedAt: + description: startedAt is the time when the + update started + format: date-time + type: string + versions: + description: versions contains the original + and target versions of the upgrade + properties: + previous: + description: |- + previous is the version of the control plane before the update. When the cluster is being installed + for the first time, the version will have a placeholder value '' and carry 'Installation' metadata + properties: + metadata: + description: |- + metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional + and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' + metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items. + items: + description: |- + VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata + have boolean semantics (true when present, false when absent) + properties: + key: + description: 'key is the name + of this metadata value. Valid + values are: Installation, + Partial, Architecture' + enum: + - Installation + - Partial + - Architecture + type: string + value: + description: |- + value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation + and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the + payload image of the version involved in the upgrade, when relevant. + maxLength: 32 + type: string + required: + - key + type: object + maxItems: 5 + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + version: + description: |- + version is a semantic version string, or a placeholder '' for the special case where this + is a "previous" version in a new installation, in which case the metadata must contain an item + with key 'Installation' + maxLength: 64 + pattern: ^()|((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + x-kubernetes-validations: + - message: previous version must be + '' iff marked with Installation + metadata + rule: 'self.version == '''' + ? (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : + !(has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation''))' + required: + - version + type: object + x-kubernetes-validations: + - message: previous version must be '' + iff marked with Installation metadata + rule: 'self.version == '''' ? + (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : !(has(self.metadata) + && self.metadata.exists(m, m.key == + ''Installation''))' + target: + description: target is the version of + the control plane after the update. + It may never be '' or have `Installation` + metadata + properties: + metadata: + description: |- + metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional + and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' + metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items. + items: + description: |- + VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata + have boolean semantics (true when present, false when absent) + properties: + key: + description: 'key is the name + of this metadata value. Valid + values are: Installation, + Partial, Architecture' + enum: + - Installation + - Partial + - Architecture + type: string + value: + description: |- + value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation + and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the + payload image of the version involved in the upgrade, when relevant. + maxLength: 32 + type: string + required: + - key + type: object + maxItems: 5 + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + version: + description: |- + version is a semantic version string, or a placeholder '' for the special case where this + is a "previous" version in a new installation, in which case the metadata must contain an item + with key 'Installation' + maxLength: 64 + pattern: ^()|((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + x-kubernetes-validations: + - message: previous version must be + '' iff marked with Installation + metadata + rule: 'self.version == '''' + ? (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : + !(has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation''))' + required: + - version + type: object + x-kubernetes-validations: + - message: target version must not be + '' or have Installation metadata + rule: self.version != '' && !(has(self.metadata) + && self.metadata.exists(m, m.key == + 'Installation')) + required: + - previous + - target + type: object + required: + - assessment + - completion + - resource + - startedAt + - versions + type: object + health: + description: |- + health is a generic health insight about the update. It does not represent a status of any specific + resource but surfaces actionable information about the health of the cluster or an update + properties: + impact: + description: impact describes the impact the + reported condition has on the cluster or + update + properties: + description: + description: |- + description is a human-oriented, possibly longer-form description of the condition reported by the insight It must + be shorter than 4096 characters. + maxLength: 4096 + type: string + level: + description: level is the severity of + the impact. Valid values are Unknown, + Info, Warning, Error, Critical. + enum: + - Unknown + - Info + - Warning + - Error + - Critical + type: string + summary: + description: summary is a short summary + of the impact. It must not be empty + and must be shorter than 256 characters. + maxLength: 256 + minLength: 1 + type: string + type: + description: |- + type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, + Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled. + enum: + - None + - Unknown + - API Availability + - Cluster Capacity + - Application Availability + - Application Outage + - Data Loss + - Update Speed + - Update Stalled + type: string + required: + - level + - summary + - type + type: object + remediation: + description: remediation contains information + about how to resolve or prevent the reported + condition + properties: + estimatedFinish: + description: estimatedFinish is the estimated + time when the informer expects the condition + to be resolved, if applicable. + format: date-time + type: string + reference: + description: reference is a URL where + administrators can find information + to resolve or prevent the reported condition + maxLength: 512 + type: string + x-kubernetes-validations: + - message: reference must a valid URL + rule: isURL(self) + required: + - reference + type: object + scope: + description: scope is list of objects involved + in the insight + properties: + resources: + description: resources is a list of resources + involved in the insight, of any group/kind. + Maximum 16 resources can be listed. + items: + description: ResourceRef is a reference + to a kubernetes resource, typically + involved in an insight + properties: + group: + description: group of the object + being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + maxItems: 16 + type: array + x-kubernetes-list-type: atomic + type: + description: type is either ControlPlane + or WorkerPool + enum: + - ControlPlane + - WorkerPool + type: string + required: + - type + type: object + startedAt: + description: startedAt is the time when the + condition reported by the insight started + format: date-time + type: string + required: + - impact + - remediation + - scope + - startedAt + type: object + machineConfigPool: + description: |- + machineConfigPool is a status insight about the state of a worker pool update, where the worker pool + is represented by a MachineConfigPool resource + properties: + assessment: + description: 'assessment is the assessment + of the machine config pool update process. + Valid values are: Pending, Completed, Degraded, + Excluded, Progressing' + enum: + - Pending + - Completed + - Degraded + - Excluded + - Progressing + type: string + completion: + description: completion is a percentage of + the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: + - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the machine + config pool + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: |- + resource is the MachineConfigPool resource that represents the pool + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + scopeType: + description: scopeType describes whether the + pool is a control plane or a worker pool + enum: + - ControlPlane + - WorkerPool + type: string + summaries: + description: summaries is a list of counts + of nodes matching certain criteria (e.g. + updated, degraded, etc.). Maximum 16 items + can be listed. + items: + description: NodeSummary is a count of nodes + matching certain criteria (e.g. updated, + degraded, etc.) + properties: + count: + description: count is the number of + nodes matching the criteria + format: int32 + maximum: 4096 + minimum: 0 + type: integer + type: + description: |- + type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded + The summaries are not exclusive, a single node may be counted in multiple summaries. + enum: + - Total + - Available + - Progressing + - Outdated + - Draining + - Excluded + - Degraded + type: string + required: + - count + - type + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + required: + - assessment + - completion + - name + - resource + - scopeType + type: object + node: + description: |- + node is a status insight about the state of a worker node update, where the worker node is represented + by a Node resource + properties: + conditions: + description: |- + conditions provides details about the control plane update. Known conditions are: + - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting + - Available: whether the Node is available (accepting workloads) + - Degraded: whether the Node is degraded (problem observed) + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedToComplete: + description: estimatedToComplete is the estimated + time to complete the update, when known + format: duration + type: string + message: + description: message is a short human-readable + message about the node update status. It + must be shorter than 100 characters. + maxLength: 100 + type: string + name: + description: name is the name of the node + maxLength: 253 + minLength: 1 + type: string + poolResource: + description: |- + poolResource is the resource that represents the pool the node is a member of + + Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + resource references in many places and this API is intended to be consumed by clients, not produced, consistency + seems to be more valuable than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the Node resource that represents the node + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a nodes.core.k8s.io + resource + rule: self.group == '' && self.resource + == 'nodes' + scopeType: + description: scopeType describes whether the + node belongs to control plane or a worker + pool + enum: + - ControlPlane + - WorkerPool + type: string + version: + description: version is the version of the + node, when known + maxLength: 64 + pattern: ^((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + required: + - name + - poolResource + - resource + - scopeType + type: object + type: + description: |- + type identifies the type of the update insight, one of: ClusterVersion, ClusterOperator, MachineConfigPool, Node, Health + ClusterVersion, ClusterOperator, MachineConfigPool, Node types are progress insights about a resource directly + involved in the update process + Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. + enum: + - ClusterVersion + - ClusterOperator + - MachineConfigPool + - Node + - Health + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: clusterVersion is required when type is + ClusterVersion, and forbidden otherwise + rule: 'has(self.type) && self.type == ''ClusterVersion'' + ? has(self.clusterVersion) : !has(self.clusterVersion)' + - message: clusterOperator is required when type is + ClusterOperator, and forbidden otherwise + rule: 'has(self.type) && self.type == ''ClusterOperator'' + ? has(self.clusterOperator) : !has(self.clusterOperator)' + - message: machineConfigPool is required when type + is MachineConfigPool, and forbidden otherwise + rule: 'has(self.type) && self.type == ''MachineConfigPool'' + ? has(self.machineConfigPool) : !has(self.machineConfigPool)' + - message: node is required when type is Node, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Node'' ? has(self.node) + : !has(self.node)' + - message: health is required when type is Health, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Health'' + ? has(self.health) : !has(self.health)' + uid: + description: uid identifies the insight over time + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - acquiredAt + - insight + - uid + type: object + maxItems: 128 + type: array + x-kubernetes-list-map-keys: + - uid + x-kubernetes-list-type: map + name: + description: name is the name of the insight producer + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + poolResource: + description: |- + poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field + is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools, + and also because the information may be unknown temporarily. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: controlPlane.poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: (self.group == 'machineconfiguration.openshift.io' && + self.resource == 'machineconfigpools') + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource == 'machineconfigpools' + && self.group == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the resource that represents the control plane. It will typically be a ClusterVersion resource + in standalone OpenShift and HostedCluster in Hosted Control Planes. This field is optional because the information + may be unknown temporarily. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: controlPlane.resource must be either a clusterversions.config.openshift.io + or a hostedclusters.hypershift.openshift.io resource + rule: (self.group == 'config.openshift.io' && self.resource + == 'clusterversions') || (self.group == 'hypershift.openshift.io' + && self.resource == 'hostedclusters') + type: object + workerPools: + description: |- + workerPools contains summaries and insights related to the worker pools update. Each item in the list represents + a single worker pool and carries all insights reported for it by informers. It has at most 32 items. + so hundreds, and hypothetically more empty ones. + items: + description: Pool contains a summary and insights related to a node + pool update + properties: + conditions: + description: |- + conditions provides details about the node pool update. This is a high-level status of an abstract "pool of nodes" + concept, and will typically be the controller's interpretation / summarization of the insights it received (that + will be placed in .informers[].insights for clients that want to perform further analysis of the data). + Known condition types are: + * "Updating": Whether the pool of nodes is currently updating or not + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + informers: + description: |- + informers is a list of insight producers. An informer is a system, internal or external to the cluster, that + produces units of information relevant to the update process, either about its progress or its health. Each + informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, + relevant to the process of updating this pool of nodes. + items: + description: |- + WorkerPoolInformer represents a system, internal or external to the cluster, that produces units of information + relevant to the update process, either about its progress or its health. Each informer is identified by a name, and + contains a list of insights it contributed to the Update Status API, relevant to a specific worker pool. + properties: + insights: + description: |- + insights is a list of insights produced by this producer. Insights are units of information relevant to an update + progress or health information. There are two types of update insights: status insights and health insights. The + first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not. + + Status Insights expose the state of a single resource that is directly involved in the update process, usually a resource + that either has a notion of "being updated," (such as a Node or ClusterOperator) or represents a higher-level + abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents + a pool of nodes). + + Health Insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate + a condition that warrants attention by the cluster administrator. + items: + description: WorkerPoolInsight is a unique piece of + either status/progress or update health information + produced by update informer + properties: + acquiredAt: + description: acquiredAt is the time when the data + was acquired by the producer + format: date-time + type: string + insight: + description: insight is a discriminated union of + all insights types that can be reported for a + worker pool + properties: + health: + description: |- + health is a generic health insight about the update. It does not represent a status of any specific + resource but surfaces actionable information about the health of the cluster or an update + properties: + impact: + description: impact describes the impact + the reported condition has on the cluster + or update + properties: + description: + description: |- + description is a human-oriented, possibly longer-form description of the condition reported by the insight It must + be shorter than 4096 characters. + maxLength: 4096 + type: string + level: + description: level is the severity of + the impact. Valid values are Unknown, + Info, Warning, Error, Critical. + enum: + - Unknown + - Info + - Warning + - Error + - Critical + type: string + summary: + description: summary is a short summary + of the impact. It must not be empty + and must be shorter than 256 characters. + maxLength: 256 + minLength: 1 + type: string + type: + description: |- + type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, + Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled. + enum: + - None + - Unknown + - API Availability + - Cluster Capacity + - Application Availability + - Application Outage + - Data Loss + - Update Speed + - Update Stalled + type: string + required: + - level + - summary + - type + type: object + remediation: + description: remediation contains information + about how to resolve or prevent the reported + condition + properties: + estimatedFinish: + description: estimatedFinish is the + estimated time when the informer expects + the condition to be resolved, if applicable. + format: date-time + type: string + reference: + description: reference is a URL where + administrators can find information + to resolve or prevent the reported + condition + maxLength: 512 + type: string + x-kubernetes-validations: + - message: reference must a valid URL + rule: isURL(self) + required: + - reference + type: object + scope: + description: scope is list of objects involved + in the insight + properties: + resources: + description: resources is a list of + resources involved in the insight, + of any group/kind. Maximum 16 resources + can be listed. + items: + description: ResourceRef is a reference + to a kubernetes resource, typically + involved in an insight + properties: + group: + description: group of the object + being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the + object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + maxItems: 16 + type: array + x-kubernetes-list-type: atomic + type: + description: type is either ControlPlane + or WorkerPool + enum: + - ControlPlane + - WorkerPool + type: string + required: + - type + type: object + startedAt: + description: startedAt is the time when + the condition reported by the insight + started + format: date-time + type: string + required: + - impact + - remediation + - scope + - startedAt + type: object + machineConfigPool: + description: |- + machineConfigPool is a status insight about the state of a worker pool update, where the worker pool + is represented by a MachineConfigPool resource + properties: + assessment: + description: 'assessment is the assessment + of the machine config pool update process. + Valid values are: Pending, Completed, + Degraded, Excluded, Progressing' + enum: + - Pending + - Completed + - Degraded + - Excluded + - Progressing + type: string + completion: + description: completion is a percentage + of the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: + - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded + items: + description: Condition contains details + for one aspect of the current state + of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in + CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the machine + config pool + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: |- + resource is the MachineConfigPool resource that represents the pool + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + scopeType: + description: scopeType describes whether + the pool is a control plane or a worker + pool + enum: + - ControlPlane + - WorkerPool + type: string + summaries: + description: summaries is a list of counts + of nodes matching certain criteria (e.g. + updated, degraded, etc.). Maximum 16 items + can be listed. + items: + description: NodeSummary is a count of + nodes matching certain criteria (e.g. + updated, degraded, etc.) + properties: + count: + description: count is the number of + nodes matching the criteria + format: int32 + maximum: 4096 + minimum: 0 + type: integer + type: + description: |- + type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded + The summaries are not exclusive, a single node may be counted in multiple summaries. + enum: + - Total + - Available + - Progressing + - Outdated + - Draining + - Excluded + - Degraded + type: string + required: + - count + - type + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + required: + - assessment + - completion + - name + - resource + - scopeType + type: object + node: + description: |- + node is a status insight about the state of a worker node update, where the worker node is represented + by a Node resource + properties: + conditions: + description: |- + conditions provides details about the control plane update. Known conditions are: + - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting + - Available: whether the Node is available (accepting workloads) + - Degraded: whether the Node is degraded (problem observed) + items: + description: Condition contains details + for one aspect of the current state + of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in + CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedToComplete: + description: estimatedToComplete is the + estimated time to complete the update, + when known + format: duration + type: string + message: + description: message is a short human-readable + message about the node update status. + It must be shorter than 100 characters. + maxLength: 100 + type: string + name: + description: name is the name of the node + maxLength: 253 + minLength: 1 + type: string + poolResource: + description: |- + poolResource is the resource that represents the pool the node is a member of + + Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + resource references in many places and this API is intended to be consumed by clients, not produced, consistency + seems to be more valuable than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the Node resource that represents the node + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a nodes.core.k8s.io + resource + rule: self.group == '' && self.resource + == 'nodes' + scopeType: + description: scopeType describes whether + the node belongs to control plane or a + worker pool + enum: + - ControlPlane + - WorkerPool + type: string + version: + description: version is the version of the + node, when known + maxLength: 64 + pattern: ^((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + required: + - name + - poolResource + - resource + - scopeType + type: object + type: + description: |- + type identifies the type of the update insight, one of: MachineConfigPool, Node, Health + MachineConfigPool, Node types are progress insights about a resource directly involved in the update process + Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. + enum: + - MachineConfigPool + - Node + - Health + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: machineConfigPool is required when type + is MachineConfigPool, and forbidden otherwise + rule: 'has(self.type) && self.type == ''MachineConfigPool'' + ? has(self.machineConfigPool) : !has(self.machineConfigPool)' + - message: node is required when type is Node, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Node'' + ? has(self.node) : !has(self.node)' + - message: health is required when type is Health, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Health'' + ? has(self.health) : !has(self.health)' + uid: + description: uid identifies the insight over time + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - acquiredAt + - insight + - uid + type: object + maxItems: 1024 + type: array + x-kubernetes-list-map-keys: + - uid + x-kubernetes-list-type: map + name: + description: name is the name of the insight producer + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist + of lower case alphanumeric characters, '-' or '.', + and must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + name: + description: name is the name of the pool, follows the same + rules as a Kubernetes resource name (RFC-1123 subdomain) + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + resource: + description: |- + resource is the resource that represents the pool, either a MachineConfigPool in Standalone OpenShift or a NodePool + in Hosted Control Planes. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: workerPools[].poolResource must be a machineconfigpools.machineconfiguration.openshift.io + or hostedclusters.hypershift.openshift.io resource + rule: (self.group == 'machineconfiguration.openshift.io' && + self.resource == 'machineconfigpools') || (self.group == + 'hypershift.openshift.io' && self.resource == 'nodepools') + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource == 'machineconfigpools' + && self.group == 'machineconfiguration.openshift.io' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: workerPools .name must match .resource.name + rule: self.name == self.resource.name + maxItems: 32 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-TechPreviewNoUpgrade.crd.yaml b/update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-TechPreviewNoUpgrade.crd.yaml new file mode 100644 index 00000000000..64ee529728d --- /dev/null +++ b/update/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_02_updatestatuses-TechPreviewNoUpgrade.crd.yaml @@ -0,0 +1,2323 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/2012 + api.openshift.io/merged-by-featuregates: "true" + description: Provides health and status information about OpenShift cluster updates. + displayName: UpdateStatuses + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: TechPreviewNoUpgrade + name: updatestatuses.update.openshift.io +spec: + group: update.openshift.io + names: + kind: UpdateStatus + listKind: UpdateStatusList + plural: updatestatuses + singular: updatestatus + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + UpdateStatus reports status for in-progress cluster version updates + + Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: |- + spec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold + configuration to drive what information is surfaced and how + type: object + status: + description: status exposes the health and status of the ongoing cluster + update + properties: + conditions: + description: |- + conditions provide details about the controller operational matters, exposing whether the controller managing this + UpdateStatus is functioning well, receives insights from individual informers, and is able to interpret them and + relay them through this UpdateStatus. These condition do not communicate anything about the state of the update + itself but may indicate whether the UpdateStatus content is reliable or not. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + controlPlane: + description: controlPlane contains a summary and insights related + to the control plane update + properties: + conditions: + description: |- + conditions provides details about the control plane update. This is a high-level status of an abstract control plane + concept, and will typically be the controller's interpretation / summarization of the insights it received (that + will be placed in .informers[].insights for clients that want to perform further analysis of the data). + Known condition types are: + * "Updating": Whether the cluster control plane is currently updating or not + items: + description: Condition contains details for one aspect of the + current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + informers: + description: |- + informers is a list of insight producers. An informer is a system, internal or external to the cluster, that + produces units of information relevant to the update process, either about its progress or its health. Each + informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, + relevant to the control plane update. Contains at most 16 items. + items: + description: |- + ControlPlaneInformer represents a system, internal or external to the cluster, that produces units of information + relevant to the update process, either about its progress or its health. Each informer is identified by a name, and + contains a list of insights it contributed to the Update Status API, relevant to the control plane update. + properties: + insights: + description: |- + insights is a list of insights produced by this producer. Insights are units of information relevant to an update + progress or health information. There are two types of update insights: status insights and health insights. The + first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not. + + Status Insights expose the state of a single resource that is directly involved in the update process, usually a resource + that either has a notion of "being updated," (such as a Node or ClusterOperator) or represents a higher-level + abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents + a pool of nodes). + + Health Insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate + a condition that warrants attention by the cluster administrator. + items: + description: ControlPlaneInsight is a unique piece of + either status/progress or update health information + produced by update informer + properties: + acquiredAt: + description: acquiredAt is the time when the data + was acquired by the producer + format: date-time + type: string + insight: + description: insight is a discriminated union of all + insights types that can be reported for the control + plane + properties: + clusterOperator: + description: |- + clusterOperator is a status insight about the state of a control plane cluster operator update + represented by a ClusterOperator resource + properties: + conditions: + description: |- + conditions provide details about the operator. It contains at most 10 items. Known conditions are: + - Updating: whether the operator is updating; When Updating=False, the reason field can be Pending or Updated + - Healthy: whether the operator is considered healthy; When Healthy=False, the reason field can be Unavailable or Degraded, and Unavailable is "stronger" than Degraded + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the operator + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: resource is the ClusterOperator + resource that represents the operator + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a clusteroperators.config.openshift.io + resource + rule: self.group == 'config.openshift.io' + && self.resource == 'clusteroperators' + required: + - name + - resource + type: object + clusterVersion: + description: |- + clusterVersion is a status insight about the state of a control plane update, where + the control plane is represented by a ClusterVersion resource usually managed by CVO + properties: + assessment: + description: 'assessment is the assessment + of the control plane update process. Valid + values are: Unknown, Progressing, Completed, + Degraded' + enum: + - Unknown + - Progressing + - Completed + - Degraded + type: string + completedAt: + description: completedAt is the time when + the update completed + format: date-time + type: string + completion: + description: completion is a percentage of + the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provides detailed observed conditions about ClusterVersion. It contains at most 10 items. + Known conditions are: + - Updating: whether the control plane (represented by this ClusterVersion) is updating + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedCompletedAt: + description: estimatedCompletedAt is the estimated + time when the update will complete + format: date-time + type: string + resource: + description: resource is the ClusterVersion + resource that represents the control plane + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a clusterversions.config.openshift.io + resource + rule: self.group == 'config.openshift.io' + && self.resource == 'clusterversions' + startedAt: + description: startedAt is the time when the + update started + format: date-time + type: string + versions: + description: versions contains the original + and target versions of the upgrade + properties: + previous: + description: |- + previous is the version of the control plane before the update. When the cluster is being installed + for the first time, the version will have a placeholder value '' and carry 'Installation' metadata + properties: + metadata: + description: |- + metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional + and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' + metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items. + items: + description: |- + VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata + have boolean semantics (true when present, false when absent) + properties: + key: + description: 'key is the name + of this metadata value. Valid + values are: Installation, + Partial, Architecture' + enum: + - Installation + - Partial + - Architecture + type: string + value: + description: |- + value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation + and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the + payload image of the version involved in the upgrade, when relevant. + maxLength: 32 + type: string + required: + - key + type: object + maxItems: 5 + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + version: + description: |- + version is a semantic version string, or a placeholder '' for the special case where this + is a "previous" version in a new installation, in which case the metadata must contain an item + with key 'Installation' + maxLength: 64 + pattern: ^()|((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + x-kubernetes-validations: + - message: previous version must be + '' iff marked with Installation + metadata + rule: 'self.version == '''' + ? (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : + !(has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation''))' + required: + - version + type: object + x-kubernetes-validations: + - message: previous version must be '' + iff marked with Installation metadata + rule: 'self.version == '''' ? + (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : !(has(self.metadata) + && self.metadata.exists(m, m.key == + ''Installation''))' + target: + description: target is the version of + the control plane after the update. + It may never be '' or have `Installation` + metadata + properties: + metadata: + description: |- + metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional + and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' + metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items. + items: + description: |- + VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata + have boolean semantics (true when present, false when absent) + properties: + key: + description: 'key is the name + of this metadata value. Valid + values are: Installation, + Partial, Architecture' + enum: + - Installation + - Partial + - Architecture + type: string + value: + description: |- + value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation + and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the + payload image of the version involved in the upgrade, when relevant. + maxLength: 32 + type: string + required: + - key + type: object + maxItems: 5 + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + version: + description: |- + version is a semantic version string, or a placeholder '' for the special case where this + is a "previous" version in a new installation, in which case the metadata must contain an item + with key 'Installation' + maxLength: 64 + pattern: ^()|((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + x-kubernetes-validations: + - message: previous version must be + '' iff marked with Installation + metadata + rule: 'self.version == '''' + ? (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : + !(has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation''))' + required: + - version + type: object + x-kubernetes-validations: + - message: target version must not be + '' or have Installation metadata + rule: self.version != '' && !(has(self.metadata) + && self.metadata.exists(m, m.key == + 'Installation')) + required: + - previous + - target + type: object + required: + - assessment + - completion + - resource + - startedAt + - versions + type: object + health: + description: |- + health is a generic health insight about the update. It does not represent a status of any specific + resource but surfaces actionable information about the health of the cluster or an update + properties: + impact: + description: impact describes the impact the + reported condition has on the cluster or + update + properties: + description: + description: |- + description is a human-oriented, possibly longer-form description of the condition reported by the insight It must + be shorter than 4096 characters. + maxLength: 4096 + type: string + level: + description: level is the severity of + the impact. Valid values are Unknown, + Info, Warning, Error, Critical. + enum: + - Unknown + - Info + - Warning + - Error + - Critical + type: string + summary: + description: summary is a short summary + of the impact. It must not be empty + and must be shorter than 256 characters. + maxLength: 256 + minLength: 1 + type: string + type: + description: |- + type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, + Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled. + enum: + - None + - Unknown + - API Availability + - Cluster Capacity + - Application Availability + - Application Outage + - Data Loss + - Update Speed + - Update Stalled + type: string + required: + - level + - summary + - type + type: object + remediation: + description: remediation contains information + about how to resolve or prevent the reported + condition + properties: + estimatedFinish: + description: estimatedFinish is the estimated + time when the informer expects the condition + to be resolved, if applicable. + format: date-time + type: string + reference: + description: reference is a URL where + administrators can find information + to resolve or prevent the reported condition + maxLength: 512 + type: string + x-kubernetes-validations: + - message: reference must a valid URL + rule: isURL(self) + required: + - reference + type: object + scope: + description: scope is list of objects involved + in the insight + properties: + resources: + description: resources is a list of resources + involved in the insight, of any group/kind. + Maximum 16 resources can be listed. + items: + description: ResourceRef is a reference + to a kubernetes resource, typically + involved in an insight + properties: + group: + description: group of the object + being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + maxItems: 16 + type: array + x-kubernetes-list-type: atomic + type: + description: type is either ControlPlane + or WorkerPool + enum: + - ControlPlane + - WorkerPool + type: string + required: + - type + type: object + startedAt: + description: startedAt is the time when the + condition reported by the insight started + format: date-time + type: string + required: + - impact + - remediation + - scope + - startedAt + type: object + machineConfigPool: + description: |- + machineConfigPool is a status insight about the state of a worker pool update, where the worker pool + is represented by a MachineConfigPool resource + properties: + assessment: + description: 'assessment is the assessment + of the machine config pool update process. + Valid values are: Pending, Completed, Degraded, + Excluded, Progressing' + enum: + - Pending + - Completed + - Degraded + - Excluded + - Progressing + type: string + completion: + description: completion is a percentage of + the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: + - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the machine + config pool + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: |- + resource is the MachineConfigPool resource that represents the pool + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + scopeType: + description: scopeType describes whether the + pool is a control plane or a worker pool + enum: + - ControlPlane + - WorkerPool + type: string + summaries: + description: summaries is a list of counts + of nodes matching certain criteria (e.g. + updated, degraded, etc.). Maximum 16 items + can be listed. + items: + description: NodeSummary is a count of nodes + matching certain criteria (e.g. updated, + degraded, etc.) + properties: + count: + description: count is the number of + nodes matching the criteria + format: int32 + maximum: 4096 + minimum: 0 + type: integer + type: + description: |- + type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded + The summaries are not exclusive, a single node may be counted in multiple summaries. + enum: + - Total + - Available + - Progressing + - Outdated + - Draining + - Excluded + - Degraded + type: string + required: + - count + - type + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + required: + - assessment + - completion + - name + - resource + - scopeType + type: object + node: + description: |- + node is a status insight about the state of a worker node update, where the worker node is represented + by a Node resource + properties: + conditions: + description: |- + conditions provides details about the control plane update. Known conditions are: + - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting + - Available: whether the Node is available (accepting workloads) + - Degraded: whether the Node is degraded (problem observed) + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedToComplete: + description: estimatedToComplete is the estimated + time to complete the update, when known + format: duration + type: string + message: + description: message is a short human-readable + message about the node update status. It + must be shorter than 100 characters. + maxLength: 100 + type: string + name: + description: name is the name of the node + maxLength: 253 + minLength: 1 + type: string + poolResource: + description: |- + poolResource is the resource that represents the pool the node is a member of + + Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + resource references in many places and this API is intended to be consumed by clients, not produced, consistency + seems to be more valuable than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the Node resource that represents the node + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a nodes.core.k8s.io + resource + rule: self.group == '' && self.resource + == 'nodes' + scopeType: + description: scopeType describes whether the + node belongs to control plane or a worker + pool + enum: + - ControlPlane + - WorkerPool + type: string + version: + description: version is the version of the + node, when known + maxLength: 64 + pattern: ^((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + required: + - name + - poolResource + - resource + - scopeType + type: object + type: + description: |- + type identifies the type of the update insight, one of: ClusterVersion, ClusterOperator, MachineConfigPool, Node, Health + ClusterVersion, ClusterOperator, MachineConfigPool, Node types are progress insights about a resource directly + involved in the update process + Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. + enum: + - ClusterVersion + - ClusterOperator + - MachineConfigPool + - Node + - Health + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: clusterVersion is required when type is + ClusterVersion, and forbidden otherwise + rule: 'has(self.type) && self.type == ''ClusterVersion'' + ? has(self.clusterVersion) : !has(self.clusterVersion)' + - message: clusterOperator is required when type is + ClusterOperator, and forbidden otherwise + rule: 'has(self.type) && self.type == ''ClusterOperator'' + ? has(self.clusterOperator) : !has(self.clusterOperator)' + - message: machineConfigPool is required when type + is MachineConfigPool, and forbidden otherwise + rule: 'has(self.type) && self.type == ''MachineConfigPool'' + ? has(self.machineConfigPool) : !has(self.machineConfigPool)' + - message: node is required when type is Node, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Node'' ? has(self.node) + : !has(self.node)' + - message: health is required when type is Health, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Health'' + ? has(self.health) : !has(self.health)' + uid: + description: uid identifies the insight over time + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - acquiredAt + - insight + - uid + type: object + maxItems: 128 + type: array + x-kubernetes-list-map-keys: + - uid + x-kubernetes-list-type: map + name: + description: name is the name of the insight producer + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + poolResource: + description: |- + poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field + is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools, + and also because the information may be unknown temporarily. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: controlPlane.poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: (self.group == 'machineconfiguration.openshift.io' && + self.resource == 'machineconfigpools') + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource == 'machineconfigpools' + && self.group == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the resource that represents the control plane. It will typically be a ClusterVersion resource + in standalone OpenShift and HostedCluster in Hosted Control Planes. This field is optional because the information + may be unknown temporarily. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: controlPlane.resource must be either a clusterversions.config.openshift.io + or a hostedclusters.hypershift.openshift.io resource + rule: (self.group == 'config.openshift.io' && self.resource + == 'clusterversions') || (self.group == 'hypershift.openshift.io' + && self.resource == 'hostedclusters') + type: object + workerPools: + description: |- + workerPools contains summaries and insights related to the worker pools update. Each item in the list represents + a single worker pool and carries all insights reported for it by informers. It has at most 32 items. + so hundreds, and hypothetically more empty ones. + items: + description: Pool contains a summary and insights related to a node + pool update + properties: + conditions: + description: |- + conditions provides details about the node pool update. This is a high-level status of an abstract "pool of nodes" + concept, and will typically be the controller's interpretation / summarization of the insights it received (that + will be placed in .informers[].insights for clients that want to perform further analysis of the data). + Known condition types are: + * "Updating": Whether the pool of nodes is currently updating or not + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + informers: + description: |- + informers is a list of insight producers. An informer is a system, internal or external to the cluster, that + produces units of information relevant to the update process, either about its progress or its health. Each + informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, + relevant to the process of updating this pool of nodes. + items: + description: |- + WorkerPoolInformer represents a system, internal or external to the cluster, that produces units of information + relevant to the update process, either about its progress or its health. Each informer is identified by a name, and + contains a list of insights it contributed to the Update Status API, relevant to a specific worker pool. + properties: + insights: + description: |- + insights is a list of insights produced by this producer. Insights are units of information relevant to an update + progress or health information. There are two types of update insights: status insights and health insights. The + first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not. + + Status Insights expose the state of a single resource that is directly involved in the update process, usually a resource + that either has a notion of "being updated," (such as a Node or ClusterOperator) or represents a higher-level + abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents + a pool of nodes). + + Health Insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate + a condition that warrants attention by the cluster administrator. + items: + description: WorkerPoolInsight is a unique piece of + either status/progress or update health information + produced by update informer + properties: + acquiredAt: + description: acquiredAt is the time when the data + was acquired by the producer + format: date-time + type: string + insight: + description: insight is a discriminated union of + all insights types that can be reported for a + worker pool + properties: + health: + description: |- + health is a generic health insight about the update. It does not represent a status of any specific + resource but surfaces actionable information about the health of the cluster or an update + properties: + impact: + description: impact describes the impact + the reported condition has on the cluster + or update + properties: + description: + description: |- + description is a human-oriented, possibly longer-form description of the condition reported by the insight It must + be shorter than 4096 characters. + maxLength: 4096 + type: string + level: + description: level is the severity of + the impact. Valid values are Unknown, + Info, Warning, Error, Critical. + enum: + - Unknown + - Info + - Warning + - Error + - Critical + type: string + summary: + description: summary is a short summary + of the impact. It must not be empty + and must be shorter than 256 characters. + maxLength: 256 + minLength: 1 + type: string + type: + description: |- + type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, + Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled. + enum: + - None + - Unknown + - API Availability + - Cluster Capacity + - Application Availability + - Application Outage + - Data Loss + - Update Speed + - Update Stalled + type: string + required: + - level + - summary + - type + type: object + remediation: + description: remediation contains information + about how to resolve or prevent the reported + condition + properties: + estimatedFinish: + description: estimatedFinish is the + estimated time when the informer expects + the condition to be resolved, if applicable. + format: date-time + type: string + reference: + description: reference is a URL where + administrators can find information + to resolve or prevent the reported + condition + maxLength: 512 + type: string + x-kubernetes-validations: + - message: reference must a valid URL + rule: isURL(self) + required: + - reference + type: object + scope: + description: scope is list of objects involved + in the insight + properties: + resources: + description: resources is a list of + resources involved in the insight, + of any group/kind. Maximum 16 resources + can be listed. + items: + description: ResourceRef is a reference + to a kubernetes resource, typically + involved in an insight + properties: + group: + description: group of the object + being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the + object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + maxItems: 16 + type: array + x-kubernetes-list-type: atomic + type: + description: type is either ControlPlane + or WorkerPool + enum: + - ControlPlane + - WorkerPool + type: string + required: + - type + type: object + startedAt: + description: startedAt is the time when + the condition reported by the insight + started + format: date-time + type: string + required: + - impact + - remediation + - scope + - startedAt + type: object + machineConfigPool: + description: |- + machineConfigPool is a status insight about the state of a worker pool update, where the worker pool + is represented by a MachineConfigPool resource + properties: + assessment: + description: 'assessment is the assessment + of the machine config pool update process. + Valid values are: Pending, Completed, + Degraded, Excluded, Progressing' + enum: + - Pending + - Completed + - Degraded + - Excluded + - Progressing + type: string + completion: + description: completion is a percentage + of the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: + - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded + items: + description: Condition contains details + for one aspect of the current state + of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in + CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the machine + config pool + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: |- + resource is the MachineConfigPool resource that represents the pool + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + scopeType: + description: scopeType describes whether + the pool is a control plane or a worker + pool + enum: + - ControlPlane + - WorkerPool + type: string + summaries: + description: summaries is a list of counts + of nodes matching certain criteria (e.g. + updated, degraded, etc.). Maximum 16 items + can be listed. + items: + description: NodeSummary is a count of + nodes matching certain criteria (e.g. + updated, degraded, etc.) + properties: + count: + description: count is the number of + nodes matching the criteria + format: int32 + maximum: 4096 + minimum: 0 + type: integer + type: + description: |- + type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded + The summaries are not exclusive, a single node may be counted in multiple summaries. + enum: + - Total + - Available + - Progressing + - Outdated + - Draining + - Excluded + - Degraded + type: string + required: + - count + - type + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + required: + - assessment + - completion + - name + - resource + - scopeType + type: object + node: + description: |- + node is a status insight about the state of a worker node update, where the worker node is represented + by a Node resource + properties: + conditions: + description: |- + conditions provides details about the control plane update. Known conditions are: + - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting + - Available: whether the Node is available (accepting workloads) + - Degraded: whether the Node is degraded (problem observed) + items: + description: Condition contains details + for one aspect of the current state + of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in + CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedToComplete: + description: estimatedToComplete is the + estimated time to complete the update, + when known + format: duration + type: string + message: + description: message is a short human-readable + message about the node update status. + It must be shorter than 100 characters. + maxLength: 100 + type: string + name: + description: name is the name of the node + maxLength: 253 + minLength: 1 + type: string + poolResource: + description: |- + poolResource is the resource that represents the pool the node is a member of + + Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + resource references in many places and this API is intended to be consumed by clients, not produced, consistency + seems to be more valuable than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the Node resource that represents the node + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a nodes.core.k8s.io + resource + rule: self.group == '' && self.resource + == 'nodes' + scopeType: + description: scopeType describes whether + the node belongs to control plane or a + worker pool + enum: + - ControlPlane + - WorkerPool + type: string + version: + description: version is the version of the + node, when known + maxLength: 64 + pattern: ^((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + required: + - name + - poolResource + - resource + - scopeType + type: object + type: + description: |- + type identifies the type of the update insight, one of: MachineConfigPool, Node, Health + MachineConfigPool, Node types are progress insights about a resource directly involved in the update process + Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. + enum: + - MachineConfigPool + - Node + - Health + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: machineConfigPool is required when type + is MachineConfigPool, and forbidden otherwise + rule: 'has(self.type) && self.type == ''MachineConfigPool'' + ? has(self.machineConfigPool) : !has(self.machineConfigPool)' + - message: node is required when type is Node, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Node'' + ? has(self.node) : !has(self.node)' + - message: health is required when type is Health, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Health'' + ? has(self.health) : !has(self.health)' + uid: + description: uid identifies the insight over time + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - acquiredAt + - insight + - uid + type: object + maxItems: 1024 + type: array + x-kubernetes-list-map-keys: + - uid + x-kubernetes-list-type: map + name: + description: name is the name of the insight producer + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist + of lower case alphanumeric characters, '-' or '.', + and must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + name: + description: name is the name of the pool, follows the same + rules as a Kubernetes resource name (RFC-1123 subdomain) + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + resource: + description: |- + resource is the resource that represents the pool, either a MachineConfigPool in Standalone OpenShift or a NodePool + in Hosted Control Planes. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: workerPools[].poolResource must be a machineconfigpools.machineconfiguration.openshift.io + or hostedclusters.hypershift.openshift.io resource + rule: (self.group == 'machineconfiguration.openshift.io' && + self.resource == 'machineconfigpools') || (self.group == + 'hypershift.openshift.io' && self.resource == 'nodepools') + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource == 'machineconfigpools' + && self.group == 'machineconfiguration.openshift.io' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: workerPools .name must match .resource.name + rule: self.name == self.resource.name + maxItems: 32 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/update/v1alpha1/zz_generated.crd-manifests/doc.go b/update/v1alpha1/zz_generated.crd-manifests/doc.go new file mode 100644 index 00000000000..0125d82de7e --- /dev/null +++ b/update/v1alpha1/zz_generated.crd-manifests/doc.go @@ -0,0 +1 @@ +package update_v1alpha1_crdmanifests diff --git a/update/v1alpha1/zz_generated.deepcopy.go b/update/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 00000000000..c6472ad07fb --- /dev/null +++ b/update/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,646 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterOperatorStatusInsight) DeepCopyInto(out *ClusterOperatorStatusInsight) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.Resource = in.Resource + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterOperatorStatusInsight. +func (in *ClusterOperatorStatusInsight) DeepCopy() *ClusterOperatorStatusInsight { + if in == nil { + return nil + } + out := new(ClusterOperatorStatusInsight) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterVersionStatusInsight) DeepCopyInto(out *ClusterVersionStatusInsight) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.Resource = in.Resource + in.Versions.DeepCopyInto(&out.Versions) + in.StartedAt.DeepCopyInto(&out.StartedAt) + if in.CompletedAt != nil { + in, out := &in.CompletedAt, &out.CompletedAt + *out = (*in).DeepCopy() + } + if in.EstimatedCompletedAt != nil { + in, out := &in.EstimatedCompletedAt, &out.EstimatedCompletedAt + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVersionStatusInsight. +func (in *ClusterVersionStatusInsight) DeepCopy() *ClusterVersionStatusInsight { + if in == nil { + return nil + } + out := new(ClusterVersionStatusInsight) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlane) DeepCopyInto(out *ControlPlane) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Resource != nil { + in, out := &in.Resource, &out.Resource + *out = new(ResourceRef) + **out = **in + } + if in.PoolResource != nil { + in, out := &in.PoolResource, &out.PoolResource + *out = new(PoolResourceRef) + **out = **in + } + if in.Informers != nil { + in, out := &in.Informers, &out.Informers + *out = make([]ControlPlaneInformer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlane. +func (in *ControlPlane) DeepCopy() *ControlPlane { + if in == nil { + return nil + } + out := new(ControlPlane) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneInformer) DeepCopyInto(out *ControlPlaneInformer) { + *out = *in + if in.Insights != nil { + in, out := &in.Insights, &out.Insights + *out = make([]ControlPlaneInsight, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneInformer. +func (in *ControlPlaneInformer) DeepCopy() *ControlPlaneInformer { + if in == nil { + return nil + } + out := new(ControlPlaneInformer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneInsight) DeepCopyInto(out *ControlPlaneInsight) { + *out = *in + in.AcquiredAt.DeepCopyInto(&out.AcquiredAt) + in.Insight.DeepCopyInto(&out.Insight) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneInsight. +func (in *ControlPlaneInsight) DeepCopy() *ControlPlaneInsight { + if in == nil { + return nil + } + out := new(ControlPlaneInsight) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneInsightUnion) DeepCopyInto(out *ControlPlaneInsightUnion) { + *out = *in + if in.ClusterVersionStatusInsight != nil { + in, out := &in.ClusterVersionStatusInsight, &out.ClusterVersionStatusInsight + *out = new(ClusterVersionStatusInsight) + (*in).DeepCopyInto(*out) + } + if in.ClusterOperatorStatusInsight != nil { + in, out := &in.ClusterOperatorStatusInsight, &out.ClusterOperatorStatusInsight + *out = new(ClusterOperatorStatusInsight) + (*in).DeepCopyInto(*out) + } + if in.MachineConfigPoolStatusInsight != nil { + in, out := &in.MachineConfigPoolStatusInsight, &out.MachineConfigPoolStatusInsight + *out = new(MachineConfigPoolStatusInsight) + (*in).DeepCopyInto(*out) + } + if in.NodeStatusInsight != nil { + in, out := &in.NodeStatusInsight, &out.NodeStatusInsight + *out = new(NodeStatusInsight) + (*in).DeepCopyInto(*out) + } + if in.HealthInsight != nil { + in, out := &in.HealthInsight, &out.HealthInsight + *out = new(HealthInsight) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneInsightUnion. +func (in *ControlPlaneInsightUnion) DeepCopy() *ControlPlaneInsightUnion { + if in == nil { + return nil + } + out := new(ControlPlaneInsightUnion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneUpdateVersions) DeepCopyInto(out *ControlPlaneUpdateVersions) { + *out = *in + in.Previous.DeepCopyInto(&out.Previous) + in.Target.DeepCopyInto(&out.Target) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneUpdateVersions. +func (in *ControlPlaneUpdateVersions) DeepCopy() *ControlPlaneUpdateVersions { + if in == nil { + return nil + } + out := new(ControlPlaneUpdateVersions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthInsight) DeepCopyInto(out *HealthInsight) { + *out = *in + in.StartedAt.DeepCopyInto(&out.StartedAt) + in.Scope.DeepCopyInto(&out.Scope) + out.Impact = in.Impact + in.Remediation.DeepCopyInto(&out.Remediation) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthInsight. +func (in *HealthInsight) DeepCopy() *HealthInsight { + if in == nil { + return nil + } + out := new(HealthInsight) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InsightImpact) DeepCopyInto(out *InsightImpact) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InsightImpact. +func (in *InsightImpact) DeepCopy() *InsightImpact { + if in == nil { + return nil + } + out := new(InsightImpact) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InsightRemediation) DeepCopyInto(out *InsightRemediation) { + *out = *in + if in.EstimatedFinish != nil { + in, out := &in.EstimatedFinish, &out.EstimatedFinish + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InsightRemediation. +func (in *InsightRemediation) DeepCopy() *InsightRemediation { + if in == nil { + return nil + } + out := new(InsightRemediation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InsightScope) DeepCopyInto(out *InsightScope) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]ResourceRef, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InsightScope. +func (in *InsightScope) DeepCopy() *InsightScope { + if in == nil { + return nil + } + out := new(InsightScope) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigPoolStatusInsight) DeepCopyInto(out *MachineConfigPoolStatusInsight) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.Resource = in.Resource + if in.Summaries != nil { + in, out := &in.Summaries, &out.Summaries + *out = make([]NodeSummary, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigPoolStatusInsight. +func (in *MachineConfigPoolStatusInsight) DeepCopy() *MachineConfigPoolStatusInsight { + if in == nil { + return nil + } + out := new(MachineConfigPoolStatusInsight) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeStatusInsight) DeepCopyInto(out *NodeStatusInsight) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.Resource = in.Resource + out.PoolResource = in.PoolResource + if in.EstimatedToComplete != nil { + in, out := &in.EstimatedToComplete, &out.EstimatedToComplete + *out = new(v1.Duration) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeStatusInsight. +func (in *NodeStatusInsight) DeepCopy() *NodeStatusInsight { + if in == nil { + return nil + } + out := new(NodeStatusInsight) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeSummary) DeepCopyInto(out *NodeSummary) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSummary. +func (in *NodeSummary) DeepCopy() *NodeSummary { + if in == nil { + return nil + } + out := new(NodeSummary) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Pool) DeepCopyInto(out *Pool) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.Resource = in.Resource + if in.Informers != nil { + in, out := &in.Informers, &out.Informers + *out = make([]WorkerPoolInformer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pool. +func (in *Pool) DeepCopy() *Pool { + if in == nil { + return nil + } + out := new(Pool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PoolResourceRef) DeepCopyInto(out *PoolResourceRef) { + *out = *in + out.ResourceRef = in.ResourceRef + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolResourceRef. +func (in *PoolResourceRef) DeepCopy() *PoolResourceRef { + if in == nil { + return nil + } + out := new(PoolResourceRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceRef) DeepCopyInto(out *ResourceRef) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRef. +func (in *ResourceRef) DeepCopy() *ResourceRef { + if in == nil { + return nil + } + out := new(ResourceRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdateStatus) DeepCopyInto(out *UpdateStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateStatus. +func (in *UpdateStatus) DeepCopy() *UpdateStatus { + if in == nil { + return nil + } + out := new(UpdateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UpdateStatus) 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 *UpdateStatusList) DeepCopyInto(out *UpdateStatusList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]UpdateStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateStatusList. +func (in *UpdateStatusList) DeepCopy() *UpdateStatusList { + if in == nil { + return nil + } + out := new(UpdateStatusList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UpdateStatusList) 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 *UpdateStatusSpec) DeepCopyInto(out *UpdateStatusSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateStatusSpec. +func (in *UpdateStatusSpec) DeepCopy() *UpdateStatusSpec { + if in == nil { + return nil + } + out := new(UpdateStatusSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdateStatusStatus) DeepCopyInto(out *UpdateStatusStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ControlPlane != nil { + in, out := &in.ControlPlane, &out.ControlPlane + *out = new(ControlPlane) + (*in).DeepCopyInto(*out) + } + if in.WorkerPools != nil { + in, out := &in.WorkerPools, &out.WorkerPools + *out = make([]Pool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateStatusStatus. +func (in *UpdateStatusStatus) DeepCopy() *UpdateStatusStatus { + if in == nil { + return nil + } + out := new(UpdateStatusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Version) DeepCopyInto(out *Version) { + *out = *in + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make([]VersionMetadata, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Version. +func (in *Version) DeepCopy() *Version { + if in == nil { + return nil + } + out := new(Version) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VersionMetadata) DeepCopyInto(out *VersionMetadata) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionMetadata. +func (in *VersionMetadata) DeepCopy() *VersionMetadata { + if in == nil { + return nil + } + out := new(VersionMetadata) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkerPoolInformer) DeepCopyInto(out *WorkerPoolInformer) { + *out = *in + if in.Insights != nil { + in, out := &in.Insights, &out.Insights + *out = make([]WorkerPoolInsight, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerPoolInformer. +func (in *WorkerPoolInformer) DeepCopy() *WorkerPoolInformer { + if in == nil { + return nil + } + out := new(WorkerPoolInformer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkerPoolInsight) DeepCopyInto(out *WorkerPoolInsight) { + *out = *in + in.AcquiredAt.DeepCopyInto(&out.AcquiredAt) + in.Insight.DeepCopyInto(&out.Insight) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerPoolInsight. +func (in *WorkerPoolInsight) DeepCopy() *WorkerPoolInsight { + if in == nil { + return nil + } + out := new(WorkerPoolInsight) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkerPoolInsightUnion) DeepCopyInto(out *WorkerPoolInsightUnion) { + *out = *in + if in.MachineConfigPoolStatusInsight != nil { + in, out := &in.MachineConfigPoolStatusInsight, &out.MachineConfigPoolStatusInsight + *out = new(MachineConfigPoolStatusInsight) + (*in).DeepCopyInto(*out) + } + if in.NodeStatusInsight != nil { + in, out := &in.NodeStatusInsight, &out.NodeStatusInsight + *out = new(NodeStatusInsight) + (*in).DeepCopyInto(*out) + } + if in.HealthInsight != nil { + in, out := &in.HealthInsight, &out.HealthInsight + *out = new(HealthInsight) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerPoolInsightUnion. +func (in *WorkerPoolInsightUnion) DeepCopy() *WorkerPoolInsightUnion { + if in == nil { + return nil + } + out := new(WorkerPoolInsightUnion) + in.DeepCopyInto(out) + return out +} diff --git a/update/v1alpha1/zz_generated.featuregated-crd-manifests.yaml b/update/v1alpha1/zz_generated.featuregated-crd-manifests.yaml new file mode 100644 index 00000000000..e9b8212246c --- /dev/null +++ b/update/v1alpha1/zz_generated.featuregated-crd-manifests.yaml @@ -0,0 +1,25 @@ +updatestatuses.update.openshift.io: + Annotations: + description: Provides health and status information about OpenShift cluster updates. + displayName: UpdateStatuses + ApprovedPRNumber: https://github.com/openshift/api/pull/2012 + CRDName: updatestatuses.update.openshift.io + Capability: "" + Category: "" + FeatureGates: + - UpgradeStatus + FilenameOperatorName: cluster-version-operator + FilenameOperatorOrdering: "02" + FilenameRunLevel: "0000_00" + GroupName: update.openshift.io + HasStatus: true + KindName: UpdateStatus + Labels: {} + PluralName: updatestatuses + PrinterColumns: [] + Scope: Cluster + ShortNames: null + TopLevelFeatureGates: + - UpgradeStatus + Version: v1alpha1 + diff --git a/update/v1alpha1/zz_generated.featuregated-crd-manifests/updatestatuses.update.openshift.io/UpgradeStatus.yaml b/update/v1alpha1/zz_generated.featuregated-crd-manifests/updatestatuses.update.openshift.io/UpgradeStatus.yaml new file mode 100644 index 00000000000..31d9babe191 --- /dev/null +++ b/update/v1alpha1/zz_generated.featuregated-crd-manifests/updatestatuses.update.openshift.io/UpgradeStatus.yaml @@ -0,0 +1,2323 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/2012 + api.openshift.io/filename-cvo-runlevel: "0000_00" + api.openshift.io/filename-operator: cluster-version-operator + api.openshift.io/filename-ordering: "02" + description: Provides health and status information about OpenShift cluster updates. + displayName: UpdateStatuses + feature-gate.release.openshift.io/UpgradeStatus: "true" + name: updatestatuses.update.openshift.io +spec: + group: update.openshift.io + names: + kind: UpdateStatus + listKind: UpdateStatusList + plural: updatestatuses + singular: updatestatus + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + UpdateStatus reports status for in-progress cluster version updates + + Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: |- + spec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold + configuration to drive what information is surfaced and how + type: object + status: + description: status exposes the health and status of the ongoing cluster + update + properties: + conditions: + description: |- + conditions provide details about the controller operational matters, exposing whether the controller managing this + UpdateStatus is functioning well, receives insights from individual informers, and is able to interpret them and + relay them through this UpdateStatus. These condition do not communicate anything about the state of the update + itself but may indicate whether the UpdateStatus content is reliable or not. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + controlPlane: + description: controlPlane contains a summary and insights related + to the control plane update + properties: + conditions: + description: |- + conditions provides details about the control plane update. This is a high-level status of an abstract control plane + concept, and will typically be the controller's interpretation / summarization of the insights it received (that + will be placed in .informers[].insights for clients that want to perform further analysis of the data). + Known condition types are: + * "Updating": Whether the cluster control plane is currently updating or not + items: + description: Condition contains details for one aspect of the + current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + informers: + description: |- + informers is a list of insight producers. An informer is a system, internal or external to the cluster, that + produces units of information relevant to the update process, either about its progress or its health. Each + informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, + relevant to the control plane update. Contains at most 16 items. + items: + description: |- + ControlPlaneInformer represents a system, internal or external to the cluster, that produces units of information + relevant to the update process, either about its progress or its health. Each informer is identified by a name, and + contains a list of insights it contributed to the Update Status API, relevant to the control plane update. + properties: + insights: + description: |- + insights is a list of insights produced by this producer. Insights are units of information relevant to an update + progress or health information. There are two types of update insights: status insights and health insights. The + first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not. + + Status Insights expose the state of a single resource that is directly involved in the update process, usually a resource + that either has a notion of "being updated," (such as a Node or ClusterOperator) or represents a higher-level + abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents + a pool of nodes). + + Health Insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate + a condition that warrants attention by the cluster administrator. + items: + description: ControlPlaneInsight is a unique piece of + either status/progress or update health information + produced by update informer + properties: + acquiredAt: + description: acquiredAt is the time when the data + was acquired by the producer + format: date-time + type: string + insight: + description: insight is a discriminated union of all + insights types that can be reported for the control + plane + properties: + clusterOperator: + description: |- + clusterOperator is a status insight about the state of a control plane cluster operator update + represented by a ClusterOperator resource + properties: + conditions: + description: |- + conditions provide details about the operator. It contains at most 10 items. Known conditions are: + - Updating: whether the operator is updating; When Updating=False, the reason field can be Pending or Updated + - Healthy: whether the operator is considered healthy; When Healthy=False, the reason field can be Unavailable or Degraded, and Unavailable is "stronger" than Degraded + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the operator + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: resource is the ClusterOperator + resource that represents the operator + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a clusteroperators.config.openshift.io + resource + rule: self.group == 'config.openshift.io' + && self.resource == 'clusteroperators' + required: + - name + - resource + type: object + clusterVersion: + description: |- + clusterVersion is a status insight about the state of a control plane update, where + the control plane is represented by a ClusterVersion resource usually managed by CVO + properties: + assessment: + description: 'assessment is the assessment + of the control plane update process. Valid + values are: Unknown, Progressing, Completed, + Degraded' + enum: + - Unknown + - Progressing + - Completed + - Degraded + type: string + completedAt: + description: completedAt is the time when + the update completed + format: date-time + type: string + completion: + description: completion is a percentage of + the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provides detailed observed conditions about ClusterVersion. It contains at most 10 items. + Known conditions are: + - Updating: whether the control plane (represented by this ClusterVersion) is updating + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedCompletedAt: + description: estimatedCompletedAt is the estimated + time when the update will complete + format: date-time + type: string + resource: + description: resource is the ClusterVersion + resource that represents the control plane + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a clusterversions.config.openshift.io + resource + rule: self.group == 'config.openshift.io' + && self.resource == 'clusterversions' + startedAt: + description: startedAt is the time when the + update started + format: date-time + type: string + versions: + description: versions contains the original + and target versions of the upgrade + properties: + previous: + description: |- + previous is the version of the control plane before the update. When the cluster is being installed + for the first time, the version will have a placeholder value '' and carry 'Installation' metadata + properties: + metadata: + description: |- + metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional + and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' + metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items. + items: + description: |- + VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata + have boolean semantics (true when present, false when absent) + properties: + key: + description: 'key is the name + of this metadata value. Valid + values are: Installation, + Partial, Architecture' + enum: + - Installation + - Partial + - Architecture + type: string + value: + description: |- + value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation + and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the + payload image of the version involved in the upgrade, when relevant. + maxLength: 32 + type: string + required: + - key + type: object + maxItems: 5 + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + version: + description: |- + version is a semantic version string, or a placeholder '' for the special case where this + is a "previous" version in a new installation, in which case the metadata must contain an item + with key 'Installation' + maxLength: 64 + pattern: ^()|((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + x-kubernetes-validations: + - message: previous version must be + '' iff marked with Installation + metadata + rule: 'self.version == '''' + ? (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : + !(has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation''))' + required: + - version + type: object + x-kubernetes-validations: + - message: previous version must be '' + iff marked with Installation metadata + rule: 'self.version == '''' ? + (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : !(has(self.metadata) + && self.metadata.exists(m, m.key == + ''Installation''))' + target: + description: target is the version of + the control plane after the update. + It may never be '' or have `Installation` + metadata + properties: + metadata: + description: |- + metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional + and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' + metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items. + items: + description: |- + VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata + have boolean semantics (true when present, false when absent) + properties: + key: + description: 'key is the name + of this metadata value. Valid + values are: Installation, + Partial, Architecture' + enum: + - Installation + - Partial + - Architecture + type: string + value: + description: |- + value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation + and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the + payload image of the version involved in the upgrade, when relevant. + maxLength: 32 + type: string + required: + - key + type: object + maxItems: 5 + type: array + x-kubernetes-list-map-keys: + - key + x-kubernetes-list-type: map + version: + description: |- + version is a semantic version string, or a placeholder '' for the special case where this + is a "previous" version in a new installation, in which case the metadata must contain an item + with key 'Installation' + maxLength: 64 + pattern: ^()|((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + x-kubernetes-validations: + - message: previous version must be + '' iff marked with Installation + metadata + rule: 'self.version == '''' + ? (has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation'')) : + !(has(self.metadata) && self.metadata.exists(m, + m.key == ''Installation''))' + required: + - version + type: object + x-kubernetes-validations: + - message: target version must not be + '' or have Installation metadata + rule: self.version != '' && !(has(self.metadata) + && self.metadata.exists(m, m.key == + 'Installation')) + required: + - previous + - target + type: object + required: + - assessment + - completion + - resource + - startedAt + - versions + type: object + health: + description: |- + health is a generic health insight about the update. It does not represent a status of any specific + resource but surfaces actionable information about the health of the cluster or an update + properties: + impact: + description: impact describes the impact the + reported condition has on the cluster or + update + properties: + description: + description: |- + description is a human-oriented, possibly longer-form description of the condition reported by the insight It must + be shorter than 4096 characters. + maxLength: 4096 + type: string + level: + description: level is the severity of + the impact. Valid values are Unknown, + Info, Warning, Error, Critical. + enum: + - Unknown + - Info + - Warning + - Error + - Critical + type: string + summary: + description: summary is a short summary + of the impact. It must not be empty + and must be shorter than 256 characters. + maxLength: 256 + minLength: 1 + type: string + type: + description: |- + type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, + Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled. + enum: + - None + - Unknown + - API Availability + - Cluster Capacity + - Application Availability + - Application Outage + - Data Loss + - Update Speed + - Update Stalled + type: string + required: + - level + - summary + - type + type: object + remediation: + description: remediation contains information + about how to resolve or prevent the reported + condition + properties: + estimatedFinish: + description: estimatedFinish is the estimated + time when the informer expects the condition + to be resolved, if applicable. + format: date-time + type: string + reference: + description: reference is a URL where + administrators can find information + to resolve or prevent the reported condition + maxLength: 512 + type: string + x-kubernetes-validations: + - message: reference must a valid URL + rule: isURL(self) + required: + - reference + type: object + scope: + description: scope is list of objects involved + in the insight + properties: + resources: + description: resources is a list of resources + involved in the insight, of any group/kind. + Maximum 16 resources can be listed. + items: + description: ResourceRef is a reference + to a kubernetes resource, typically + involved in an insight + properties: + group: + description: group of the object + being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of lower + case alphanumeric characters, + '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + maxItems: 16 + type: array + x-kubernetes-list-type: atomic + type: + description: type is either ControlPlane + or WorkerPool + enum: + - ControlPlane + - WorkerPool + type: string + required: + - type + type: object + startedAt: + description: startedAt is the time when the + condition reported by the insight started + format: date-time + type: string + required: + - impact + - remediation + - scope + - startedAt + type: object + machineConfigPool: + description: |- + machineConfigPool is a status insight about the state of a worker pool update, where the worker pool + is represented by a MachineConfigPool resource + properties: + assessment: + description: 'assessment is the assessment + of the machine config pool update process. + Valid values are: Pending, Completed, Degraded, + Excluded, Progressing' + enum: + - Pending + - Completed + - Degraded + - Excluded + - Progressing + type: string + completion: + description: completion is a percentage of + the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: + - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the machine + config pool + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: |- + resource is the MachineConfigPool resource that represents the pool + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + scopeType: + description: scopeType describes whether the + pool is a control plane or a worker pool + enum: + - ControlPlane + - WorkerPool + type: string + summaries: + description: summaries is a list of counts + of nodes matching certain criteria (e.g. + updated, degraded, etc.). Maximum 16 items + can be listed. + items: + description: NodeSummary is a count of nodes + matching certain criteria (e.g. updated, + degraded, etc.) + properties: + count: + description: count is the number of + nodes matching the criteria + format: int32 + maximum: 4096 + minimum: 0 + type: integer + type: + description: |- + type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded + The summaries are not exclusive, a single node may be counted in multiple summaries. + enum: + - Total + - Available + - Progressing + - Outdated + - Draining + - Excluded + - Degraded + type: string + required: + - count + - type + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + required: + - assessment + - completion + - name + - resource + - scopeType + type: object + node: + description: |- + node is a status insight about the state of a worker node update, where the worker node is represented + by a Node resource + properties: + conditions: + description: |- + conditions provides details about the control plane update. Known conditions are: + - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting + - Available: whether the Node is available (accepting workloads) + - Degraded: whether the Node is degraded (problem observed) + items: + description: Condition contains details + for one aspect of the current state of + this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase + or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedToComplete: + description: estimatedToComplete is the estimated + time to complete the update, when known + format: duration + type: string + message: + description: message is a short human-readable + message about the node update status. It + must be shorter than 100 characters. + maxLength: 100 + type: string + name: + description: name is the name of the node + maxLength: 253 + minLength: 1 + type: string + poolResource: + description: |- + poolResource is the resource that represents the pool the node is a member of + + Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + resource references in many places and this API is intended to be consumed by clients, not produced, consistency + seems to be more valuable than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the Node resource that represents the node + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being + referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a nodes.core.k8s.io + resource + rule: self.group == '' && self.resource + == 'nodes' + scopeType: + description: scopeType describes whether the + node belongs to control plane or a worker + pool + enum: + - ControlPlane + - WorkerPool + type: string + version: + description: version is the version of the + node, when known + maxLength: 64 + pattern: ^((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + required: + - name + - poolResource + - resource + - scopeType + type: object + type: + description: |- + type identifies the type of the update insight, one of: ClusterVersion, ClusterOperator, MachineConfigPool, Node, Health + ClusterVersion, ClusterOperator, MachineConfigPool, Node types are progress insights about a resource directly + involved in the update process + Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. + enum: + - ClusterVersion + - ClusterOperator + - MachineConfigPool + - Node + - Health + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: clusterVersion is required when type is + ClusterVersion, and forbidden otherwise + rule: 'has(self.type) && self.type == ''ClusterVersion'' + ? has(self.clusterVersion) : !has(self.clusterVersion)' + - message: clusterOperator is required when type is + ClusterOperator, and forbidden otherwise + rule: 'has(self.type) && self.type == ''ClusterOperator'' + ? has(self.clusterOperator) : !has(self.clusterOperator)' + - message: machineConfigPool is required when type + is MachineConfigPool, and forbidden otherwise + rule: 'has(self.type) && self.type == ''MachineConfigPool'' + ? has(self.machineConfigPool) : !has(self.machineConfigPool)' + - message: node is required when type is Node, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Node'' ? has(self.node) + : !has(self.node)' + - message: health is required when type is Health, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Health'' + ? has(self.health) : !has(self.health)' + uid: + description: uid identifies the insight over time + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - acquiredAt + - insight + - uid + type: object + maxItems: 128 + type: array + x-kubernetes-list-map-keys: + - uid + x-kubernetes-list-type: map + name: + description: name is the name of the insight producer + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + poolResource: + description: |- + poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field + is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools, + and also because the information may be unknown temporarily. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: controlPlane.poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: (self.group == 'machineconfiguration.openshift.io' && + self.resource == 'machineconfigpools') + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource == 'machineconfigpools' + && self.group == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the resource that represents the control plane. It will typically be a ClusterVersion resource + in standalone OpenShift and HostedCluster in Hosted Control Planes. This field is optional because the information + may be unknown temporarily. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: controlPlane.resource must be either a clusterversions.config.openshift.io + or a hostedclusters.hypershift.openshift.io resource + rule: (self.group == 'config.openshift.io' && self.resource + == 'clusterversions') || (self.group == 'hypershift.openshift.io' + && self.resource == 'hostedclusters') + type: object + workerPools: + description: |- + workerPools contains summaries and insights related to the worker pools update. Each item in the list represents + a single worker pool and carries all insights reported for it by informers. It has at most 32 items. + so hundreds, and hypothetically more empty ones. + items: + description: Pool contains a summary and insights related to a node + pool update + properties: + conditions: + description: |- + conditions provides details about the node pool update. This is a high-level status of an abstract "pool of nodes" + concept, and will typically be the controller's interpretation / summarization of the insights it received (that + will be placed in .informers[].insights for clients that want to perform further analysis of the data). + Known condition types are: + * "Updating": Whether the pool of nodes is currently updating or not + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + informers: + description: |- + informers is a list of insight producers. An informer is a system, internal or external to the cluster, that + produces units of information relevant to the update process, either about its progress or its health. Each + informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, + relevant to the process of updating this pool of nodes. + items: + description: |- + WorkerPoolInformer represents a system, internal or external to the cluster, that produces units of information + relevant to the update process, either about its progress or its health. Each informer is identified by a name, and + contains a list of insights it contributed to the Update Status API, relevant to a specific worker pool. + properties: + insights: + description: |- + insights is a list of insights produced by this producer. Insights are units of information relevant to an update + progress or health information. There are two types of update insights: status insights and health insights. The + first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not. + + Status Insights expose the state of a single resource that is directly involved in the update process, usually a resource + that either has a notion of "being updated," (such as a Node or ClusterOperator) or represents a higher-level + abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents + a pool of nodes). + + Health Insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate + a condition that warrants attention by the cluster administrator. + items: + description: WorkerPoolInsight is a unique piece of + either status/progress or update health information + produced by update informer + properties: + acquiredAt: + description: acquiredAt is the time when the data + was acquired by the producer + format: date-time + type: string + insight: + description: insight is a discriminated union of + all insights types that can be reported for a + worker pool + properties: + health: + description: |- + health is a generic health insight about the update. It does not represent a status of any specific + resource but surfaces actionable information about the health of the cluster or an update + properties: + impact: + description: impact describes the impact + the reported condition has on the cluster + or update + properties: + description: + description: |- + description is a human-oriented, possibly longer-form description of the condition reported by the insight It must + be shorter than 4096 characters. + maxLength: 4096 + type: string + level: + description: level is the severity of + the impact. Valid values are Unknown, + Info, Warning, Error, Critical. + enum: + - Unknown + - Info + - Warning + - Error + - Critical + type: string + summary: + description: summary is a short summary + of the impact. It must not be empty + and must be shorter than 256 characters. + maxLength: 256 + minLength: 1 + type: string + type: + description: |- + type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, + Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled. + enum: + - None + - Unknown + - API Availability + - Cluster Capacity + - Application Availability + - Application Outage + - Data Loss + - Update Speed + - Update Stalled + type: string + required: + - level + - summary + - type + type: object + remediation: + description: remediation contains information + about how to resolve or prevent the reported + condition + properties: + estimatedFinish: + description: estimatedFinish is the + estimated time when the informer expects + the condition to be resolved, if applicable. + format: date-time + type: string + reference: + description: reference is a URL where + administrators can find information + to resolve or prevent the reported + condition + maxLength: 512 + type: string + x-kubernetes-validations: + - message: reference must a valid URL + rule: isURL(self) + required: + - reference + type: object + scope: + description: scope is list of objects involved + in the insight + properties: + resources: + description: resources is a list of + resources involved in the insight, + of any group/kind. Maximum 16 resources + can be listed. + items: + description: ResourceRef is a reference + to a kubernetes resource, typically + involved in an insight + properties: + group: + description: group of the object + being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the + object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object + being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 + subdomain must consist of + lower case alphanumeric characters, + '-' or '.', and must start + and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + maxItems: 16 + type: array + x-kubernetes-list-type: atomic + type: + description: type is either ControlPlane + or WorkerPool + enum: + - ControlPlane + - WorkerPool + type: string + required: + - type + type: object + startedAt: + description: startedAt is the time when + the condition reported by the insight + started + format: date-time + type: string + required: + - impact + - remediation + - scope + - startedAt + type: object + machineConfigPool: + description: |- + machineConfigPool is a status insight about the state of a worker pool update, where the worker pool + is represented by a MachineConfigPool resource + properties: + assessment: + description: 'assessment is the assessment + of the machine config pool update process. + Valid values are: Pending, Completed, + Degraded, Excluded, Progressing' + enum: + - Pending + - Completed + - Degraded + - Excluded + - Progressing + type: string + completion: + description: completion is a percentage + of the update completion (0-100) + format: int32 + maximum: 100 + minimum: 0 + type: integer + conditions: + description: |- + conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: + - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded + items: + description: Condition contains details + for one aspect of the current state + of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in + CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: name is the name of the machine + config pool + maxLength: 64 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + resource: + description: |- + resource is the MachineConfigPool resource that represents the pool + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + scopeType: + description: scopeType describes whether + the pool is a control plane or a worker + pool + enum: + - ControlPlane + - WorkerPool + type: string + summaries: + description: summaries is a list of counts + of nodes matching certain criteria (e.g. + updated, degraded, etc.). Maximum 16 items + can be listed. + items: + description: NodeSummary is a count of + nodes matching certain criteria (e.g. + updated, degraded, etc.) + properties: + count: + description: count is the number of + nodes matching the criteria + format: int32 + maximum: 4096 + minimum: 0 + type: integer + type: + description: |- + type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded + The summaries are not exclusive, a single node may be counted in multiple summaries. + enum: + - Total + - Available + - Progressing + - Outdated + - Draining + - Excluded + - Degraded + type: string + required: + - count + - type + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + required: + - assessment + - completion + - name + - resource + - scopeType + type: object + node: + description: |- + node is a status insight about the state of a worker node update, where the worker node is represented + by a Node resource + properties: + conditions: + description: |- + conditions provides details about the control plane update. Known conditions are: + - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting + - Available: whether the Node is available (accepting workloads) + - Degraded: whether the Node is degraded (problem observed) + items: + description: Condition contains details + for one aspect of the current state + of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, + one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in + CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 10 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + estimatedToComplete: + description: estimatedToComplete is the + estimated time to complete the update, + when known + format: duration + type: string + message: + description: message is a short human-readable + message about the node update status. + It must be shorter than 100 characters. + maxLength: 100 + type: string + name: + description: name is the name of the node + maxLength: 253 + minLength: 1 + type: string + poolResource: + description: |- + poolResource is the resource that represents the pool the node is a member of + + Note: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows + only the "correct" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use + resource references in many places and this API is intended to be consumed by clients, not produced, consistency + seems to be more valuable than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: self.group == 'machineconfiguration.openshift.io' + && self.resource == 'machineconfigpools' + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource + == 'machineconfigpools' && self.group + == 'machineconfiguration.openshift.io' + resource: + description: |- + resource is the Node resource that represents the node + + Note: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to + resource name (because the rest is implied by status insight type). However, because we use resource references in + many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable + than type safety for producers. + properties: + group: + description: group of the object being + referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object + being referenced, if any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being + referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain + must consist of lower case alphanumeric + characters, '-' or '.', and must + start and end with an alphanumeric + character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: resource must be a nodes.core.k8s.io + resource + rule: self.group == '' && self.resource + == 'nodes' + scopeType: + description: scopeType describes whether + the node belongs to control plane or a + worker pool + enum: + - ControlPlane + - WorkerPool + type: string + version: + description: version is the version of the + node, when known + maxLength: 64 + pattern: ^((?:0|[1-9]\d*)[.](?:0|[1-9]\d*)[.](?:0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:[.](?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?)?$ + type: string + required: + - name + - poolResource + - resource + - scopeType + type: object + type: + description: |- + type identifies the type of the update insight, one of: MachineConfigPool, Node, Health + MachineConfigPool, Node types are progress insights about a resource directly involved in the update process + Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is + affected by the update. + enum: + - MachineConfigPool + - Node + - Health + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: machineConfigPool is required when type + is MachineConfigPool, and forbidden otherwise + rule: 'has(self.type) && self.type == ''MachineConfigPool'' + ? has(self.machineConfigPool) : !has(self.machineConfigPool)' + - message: node is required when type is Node, and + forbidden otherwise + rule: 'has(self.type) && self.type == ''Node'' + ? has(self.node) : !has(self.node)' + - message: health is required when type is Health, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''Health'' + ? has(self.health) : !has(self.health)' + uid: + description: uid identifies the insight over time + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - acquiredAt + - insight + - uid + type: object + maxItems: 1024 + type: array + x-kubernetes-list-map-keys: + - uid + x-kubernetes-list-type: map + name: + description: name is the name of the insight producer + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist + of lower case alphanumeric characters, '-' or '.', + and must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + maxItems: 16 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + name: + description: name is the name of the pool, follows the same + rules as a Kubernetes resource name (RFC-1123 subdomain) + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + resource: + description: |- + resource is the resource that represents the pool, either a MachineConfigPool in Standalone OpenShift or a NodePool + in Hosted Control Planes. + properties: + group: + description: group of the object being referenced, if any + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + name: + description: name of the object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: namespace of the object being referenced, if + any + maxLength: 253 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + resource: + description: resource of object being referenced + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of + lower case alphanumeric characters, '-' or '.', and + must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: workerPools[].poolResource must be a machineconfigpools.machineconfiguration.openshift.io + or hostedclusters.hypershift.openshift.io resource + rule: (self.group == 'machineconfiguration.openshift.io' && + self.resource == 'machineconfigpools') || (self.group == + 'hypershift.openshift.io' && self.resource == 'nodepools') + - message: a poolResource must be a machineconfigpools.machineconfiguration.openshift.io + resource + rule: has(self.resource) && (self.resource == 'machineconfigpools' + && self.group == 'machineconfiguration.openshift.io' + required: + - name + - resource + type: object + x-kubernetes-validations: + - message: workerPools .name must match .resource.name + rule: self.name == self.resource.name + maxItems: 32 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/update/v1alpha1/zz_generated.swagger_doc_generated.go b/update/v1alpha1/zz_generated.swagger_doc_generated.go new file mode 100644 index 00000000000..641531d0ceb --- /dev/null +++ b/update/v1alpha1/zz_generated.swagger_doc_generated.go @@ -0,0 +1,308 @@ +package v1alpha1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE +var map_ControlPlane = map[string]string{ + "": "ControlPlane contains a summary and insights related to the control plane update.", + "conditions": "conditions provides details about the control plane update. This is a high-level status of an abstract control plane concept, and will typically be the controller's interpretation / summarization of the insights it received (that will be placed in .informers[].insights for clients that want to perform further analysis of the data). Known condition types are: * \"Updating\": Whether the cluster control plane is currently updating or not", + "resource": "resource is the resource that represents the control plane. It will typically be a ClusterVersion resource in standalone OpenShift and HostedCluster in Hosted Control Planes. This field is optional because the information may be unknown temporarily.", + "poolResource": "poolResource is the resource that represents control plane node pool, typically a MachineConfigPool. This field is optional because some form factors (like Hosted Control Planes) do not have dedicated control plane node pools, and also because the information may be unknown temporarily.", + "informers": "informers is a list of insight producers. An informer is a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to the control plane update. Contains at most 16 items.", +} + +func (ControlPlane) SwaggerDoc() map[string]string { + return map_ControlPlane +} + +var map_ControlPlaneInformer = map[string]string{ + "": "ControlPlaneInformer represents a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to the control plane update.", + "name": "name is the name of the insight producer", + "insights": "insights is a list of insights produced by this producer. Insights are units of information relevant to an update progress or health information. There are two types of update insights: status insights and health insights. The first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not.\n\nStatus Insights expose the state of a single resource that is directly involved in the update process, usually a resource that either has a notion of \"being updated,\" (such as a Node or ClusterOperator) or represents a higher-level abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents a pool of nodes).\n\nHealth Insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate a condition that warrants attention by the cluster administrator.", +} + +func (ControlPlaneInformer) SwaggerDoc() map[string]string { + return map_ControlPlaneInformer +} + +var map_ControlPlaneInsight = map[string]string{ + "": "ControlPlaneInsight is a unique piece of either status/progress or update health information produced by update informer", + "uid": "uid identifies the insight over time", + "acquiredAt": "acquiredAt is the time when the data was acquired by the producer", + "insight": "insight is a discriminated union of all insights types that can be reported for the control plane", +} + +func (ControlPlaneInsight) SwaggerDoc() map[string]string { + return map_ControlPlaneInsight +} + +var map_ControlPlaneInsightUnion = map[string]string{ + "": "ControlPlaneInsightUnion is the discriminated union of all insights types that can be reported for the control plane, identified by type field", + "type": "type identifies the type of the update insight, one of: ClusterVersion, ClusterOperator, MachineConfigPool, Node, Health ClusterVersion, ClusterOperator, MachineConfigPool, Node types are progress insights about a resource directly involved in the update process Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update.", + "clusterVersion": "clusterVersion is a status insight about the state of a control plane update, where the control plane is represented by a ClusterVersion resource usually managed by CVO", + "clusterOperator": "clusterOperator is a status insight about the state of a control plane cluster operator update represented by a ClusterOperator resource", + "machineConfigPool": "machineConfigPool is a status insight about the state of a worker pool update, where the worker pool is represented by a MachineConfigPool resource", + "node": "node is a status insight about the state of a worker node update, where the worker node is represented by a Node resource", + "health": "health is a generic health insight about the update. It does not represent a status of any specific resource but surfaces actionable information about the health of the cluster or an update", +} + +func (ControlPlaneInsightUnion) SwaggerDoc() map[string]string { + return map_ControlPlaneInsightUnion +} + +var map_Pool = map[string]string{ + "": "Pool contains a summary and insights related to a node pool update", + "conditions": "conditions provides details about the node pool update. This is a high-level status of an abstract \"pool of nodes\" concept, and will typically be the controller's interpretation / summarization of the insights it received (that will be placed in .informers[].insights for clients that want to perform further analysis of the data). Known condition types are: * \"Updating\": Whether the pool of nodes is currently updating or not", + "name": "name is the name of the pool, follows the same rules as a Kubernetes resource name (RFC-1123 subdomain)", + "resource": "resource is the resource that represents the pool, either a MachineConfigPool in Standalone OpenShift or a NodePool in Hosted Control Planes.", + "informers": "informers is a list of insight producers. An informer is a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer in the list is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to the process of updating this pool of nodes.", +} + +func (Pool) SwaggerDoc() map[string]string { + return map_Pool +} + +var map_PoolResourceRef = map[string]string{ + "": "PoolResourceRef is a reference to a kubernetes resource that represents a node pool", +} + +func (PoolResourceRef) SwaggerDoc() map[string]string { + return map_PoolResourceRef +} + +var map_ResourceRef = map[string]string{ + "": "ResourceRef is a reference to a kubernetes resource, typically involved in an insight", + "group": "group of the object being referenced, if any", + "resource": "resource of object being referenced", + "name": "name of the object being referenced", + "namespace": "namespace of the object being referenced, if any", +} + +func (ResourceRef) SwaggerDoc() map[string]string { + return map_ResourceRef +} + +var map_UpdateStatus = map[string]string{ + "": "UpdateStatus reports status for in-progress cluster version updates\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + "metadata": "metadata is standard Kubernetes object metadata", + "spec": "spec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold configuration to drive what information is surfaced and how", + "status": "status exposes the health and status of the ongoing cluster update", +} + +func (UpdateStatus) SwaggerDoc() map[string]string { + return map_UpdateStatus +} + +var map_UpdateStatusList = map[string]string{ + "": "UpdateStatusList is a list of UpdateStatus resources\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + "metadata": "metadata is standard Kubernetes object metadata", + "items": "items is a list of UpdateStatus resources", +} + +func (UpdateStatusList) SwaggerDoc() map[string]string { + return map_UpdateStatusList +} + +var map_UpdateStatusSpec = map[string]string{ + "": "UpdateStatusSpec is empty for now, UpdateStatus is purely status-reporting API. In the future spec may be used to hold configuration to drive what information is surfaced and how", +} + +func (UpdateStatusSpec) SwaggerDoc() map[string]string { + return map_UpdateStatusSpec +} + +var map_UpdateStatusStatus = map[string]string{ + "": "UpdateStatusStatus is the API about in-progress updates. It aggregates and summarizes UpdateInsights produced by update informers", + "conditions": "conditions provide details about the controller operational matters, exposing whether the controller managing this UpdateStatus is functioning well, receives insights from individual informers, and is able to interpret them and relay them through this UpdateStatus. These condition do not communicate anything about the state of the update itself but may indicate whether the UpdateStatus content is reliable or not.", + "controlPlane": "controlPlane contains a summary and insights related to the control plane update", + "workerPools": "workerPools contains summaries and insights related to the worker pools update. Each item in the list represents a single worker pool and carries all insights reported for it by informers. It has at most 32 items.\n so hundreds, and hypothetically more empty ones.", +} + +func (UpdateStatusStatus) SwaggerDoc() map[string]string { + return map_UpdateStatusStatus +} + +var map_WorkerPoolInformer = map[string]string{ + "": "WorkerPoolInformer represents a system, internal or external to the cluster, that produces units of information relevant to the update process, either about its progress or its health. Each informer is identified by a name, and contains a list of insights it contributed to the Update Status API, relevant to a specific worker pool.", + "name": "name is the name of the insight producer", + "insights": "insights is a list of insights produced by this producer. Insights are units of information relevant to an update progress or health information. There are two types of update insights: status insights and health insights. The first type are directly tied to the update process, regardless of whether it is proceeding smoothly or not.\n\nStatus Insights expose the state of a single resource that is directly involved in the update process, usually a resource that either has a notion of \"being updated,\" (such as a Node or ClusterOperator) or represents a higher-level abstraction (such as a ClusterVersion resource tahat represents the control plane or MachineConfigPool that represents a pool of nodes).\n\nHealth Insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update. Ideally, none would be generated in a standard healthy update. Health insights communicate a condition that warrants attention by the cluster administrator.", +} + +func (WorkerPoolInformer) SwaggerDoc() map[string]string { + return map_WorkerPoolInformer +} + +var map_WorkerPoolInsight = map[string]string{ + "": "WorkerPoolInsight is a unique piece of either status/progress or update health information produced by update informer", + "uid": "uid identifies the insight over time", + "acquiredAt": "acquiredAt is the time when the data was acquired by the producer", + "insight": "insight is a discriminated union of all insights types that can be reported for a worker pool", +} + +func (WorkerPoolInsight) SwaggerDoc() map[string]string { + return map_WorkerPoolInsight +} + +var map_WorkerPoolInsightUnion = map[string]string{ + "": "WorkerPoolInsightUnion is the discriminated union of insights types that can be reported for a worker pool, identified by type field", + "type": "type identifies the type of the update insight, one of: MachineConfigPool, Node, Health MachineConfigPool, Node types are progress insights about a resource directly involved in the update process Health insights report a state or condition in the cluster that is abnormal or negative and either affects or is affected by the update.", + "machineConfigPool": "machineConfigPool is a status insight about the state of a worker pool update, where the worker pool is represented by a MachineConfigPool resource", + "node": "node is a status insight about the state of a worker node update, where the worker node is represented by a Node resource", + "health": "health is a generic health insight about the update. It does not represent a status of any specific resource but surfaces actionable information about the health of the cluster or an update", +} + +func (WorkerPoolInsightUnion) SwaggerDoc() map[string]string { + return map_WorkerPoolInsightUnion +} + +var map_HealthInsight = map[string]string{ + "": "HealthInsight is a piece of actionable information produced by an insight producer about the health of the cluster or an update", + "startedAt": "startedAt is the time when the condition reported by the insight started", + "scope": "scope is list of objects involved in the insight", + "impact": "impact describes the impact the reported condition has on the cluster or update", + "remediation": "remediation contains information about how to resolve or prevent the reported condition", +} + +func (HealthInsight) SwaggerDoc() map[string]string { + return map_HealthInsight +} + +var map_InsightImpact = map[string]string{ + "": "InsightImpact describes the impact the reported condition has on the cluster or update", + "level": "level is the severity of the impact. Valid values are Unknown, Info, Warning, Error, Critical.", + "type": "type is the type of the impact. Valid values are None, Unknown, API Availability, Cluster Capacity, Application Availability, Application Outage, Data Loss, Update Speed, Update Stalled.", + "summary": "summary is a short summary of the impact. It must not be empty and must be shorter than 256 characters.", + "description": "description is a human-oriented, possibly longer-form description of the condition reported by the insight It must be shorter than 4096 characters.", +} + +func (InsightImpact) SwaggerDoc() map[string]string { + return map_InsightImpact +} + +var map_InsightRemediation = map[string]string{ + "": "InsightRemediation contains information about how to resolve or prevent the reported condition", + "reference": "reference is a URL where administrators can find information to resolve or prevent the reported condition", + "estimatedFinish": "estimatedFinish is the estimated time when the informer expects the condition to be resolved, if applicable.", +} + +func (InsightRemediation) SwaggerDoc() map[string]string { + return map_InsightRemediation +} + +var map_InsightScope = map[string]string{ + "": "InsightScope is a list of resources involved in the insight", + "type": "type is either ControlPlane or WorkerPool", + "resources": "resources is a list of resources involved in the insight, of any group/kind. Maximum 16 resources can be listed.", +} + +func (InsightScope) SwaggerDoc() map[string]string { + return map_InsightScope +} + +var map_ClusterOperatorStatusInsight = map[string]string{ + "": "ClusterOperatorStatusInsight reports the state of a ClusterOperator resource (which represents a control plane component update in standalone clusters), during the update", + "conditions": "conditions provide details about the operator. It contains at most 10 items. Known conditions are: - Updating: whether the operator is updating; When Updating=False, the reason field can be Pending or Updated - Healthy: whether the operator is considered healthy; When Healthy=False, the reason field can be Unavailable or Degraded, and Unavailable is \"stronger\" than Degraded", + "name": "name is the name of the operator", + "resource": "resource is the ClusterOperator resource that represents the operator", +} + +func (ClusterOperatorStatusInsight) SwaggerDoc() map[string]string { + return map_ClusterOperatorStatusInsight +} + +var map_ClusterVersionStatusInsight = map[string]string{ + "": "ClusterVersionStatusInsight reports the state of a ClusterVersion resource (which represents a control plane update in standalone clusters), during the update.", + "conditions": "conditions provides detailed observed conditions about ClusterVersion. It contains at most 10 items. Known conditions are: - Updating: whether the control plane (represented by this ClusterVersion) is updating", + "resource": "resource is the ClusterVersion resource that represents the control plane", + "assessment": "assessment is the assessment of the control plane update process. Valid values are: Unknown, Progressing, Completed, Degraded", + "versions": "versions contains the original and target versions of the upgrade", + "completion": "completion is a percentage of the update completion (0-100)", + "startedAt": "startedAt is the time when the update started", + "completedAt": "completedAt is the time when the update completed", + "estimatedCompletedAt": "estimatedCompletedAt is the estimated time when the update will complete", +} + +func (ClusterVersionStatusInsight) SwaggerDoc() map[string]string { + return map_ClusterVersionStatusInsight +} + +var map_ControlPlaneUpdateVersions = map[string]string{ + "": "ControlPlaneUpdateVersions contains the original and target versions of the upgrade", + "previous": "previous is the version of the control plane before the update. When the cluster is being installed for the first time, the version will have a placeholder value '' and carry 'Installation' metadata", + "target": "target is the version of the control plane after the update. It may never be '' or have `Installation` metadata", +} + +func (ControlPlaneUpdateVersions) SwaggerDoc() map[string]string { + return map_ControlPlaneUpdateVersions +} + +var map_MachineConfigPoolStatusInsight = map[string]string{ + "": "MachineConfigPoolStatusInsight reports the state of a MachineConfigPool resource during the update", + "conditions": "conditions provide details about the machine config pool update. It contains at most 10 items. Known conditions are: - Updating: whether the pool is updating; When Updating=False, the reason field can be Pending, Updated or Excluded", + "name": "name is the name of the machine config pool", + "resource": "resource is the MachineConfigPool resource that represents the pool\n\nNote: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to resource name (because the rest is implied by status insight type). However, because we use resource references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable than type safety for producers.", + "scopeType": "scopeType describes whether the pool is a control plane or a worker pool", + "assessment": "assessment is the assessment of the machine config pool update process. Valid values are: Pending, Completed, Degraded, Excluded, Progressing", + "completion": "completion is a percentage of the update completion (0-100)", + "summaries": "summaries is a list of counts of nodes matching certain criteria (e.g. updated, degraded, etc.). Maximum 16 items can be listed.", +} + +func (MachineConfigPoolStatusInsight) SwaggerDoc() map[string]string { + return map_MachineConfigPoolStatusInsight +} + +var map_NodeStatusInsight = map[string]string{ + "": "NodeStatusInsight reports the state of a Node during the update", + "conditions": "conditions provides details about the control plane update. Known conditions are: - Updating: whether the Node is updating; When Updating=False, the reason field can be Updated, Pending, or Paused. When Updating=True, the reason field can be Draining, Updating, or Rebooting - Available: whether the Node is available (accepting workloads) - Degraded: whether the Node is degraded (problem observed)", + "name": "name is the name of the node", + "resource": "resource is the Node resource that represents the node\n\nNote: By OpenShift API conventions, in isolation this should be a specialized reference that refers just to resource name (because the rest is implied by status insight type). However, because we use resource references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable than type safety for producers.", + "poolResource": "poolResource is the resource that represents the pool the node is a member of\n\nNote: By OpenShift API conventions, in isolation this should probably be a specialized reference type that allows only the \"correct\" resource types to be referenced (here, MachineConfigPool or NodePool). However, because we use resource references in many places and this API is intended to be consumed by clients, not produced, consistency seems to be more valuable than type safety for producers.", + "scopeType": "scopeType describes whether the node belongs to control plane or a worker pool", + "version": "version is the version of the node, when known", + "estimatedToComplete": "estimatedToComplete is the estimated time to complete the update, when known", + "message": "message is a short human-readable message about the node update status. It must be shorter than 100 characters.", +} + +func (NodeStatusInsight) SwaggerDoc() map[string]string { + return map_NodeStatusInsight +} + +var map_NodeSummary = map[string]string{ + "": "NodeSummary is a count of nodes matching certain criteria (e.g. updated, degraded, etc.)", + "type": "type is the type of the summary. Valid values are: Total, Available, Progressing, Outdated, Draining, Excluded, Degraded The summaries are not exclusive, a single node may be counted in multiple summaries.", + "count": "count is the number of nodes matching the criteria", +} + +func (NodeSummary) SwaggerDoc() map[string]string { + return map_NodeSummary +} + +var map_Version = map[string]string{ + "": "Version describes a version involved in an update, typically on one side of an update edge", + "version": "version is a semantic version string, or a placeholder '' for the special case where this is a \"previous\" version in a new installation, in which case the metadata must contain an item with key 'Installation'", + "metadata": "metadata is a list of metadata associated with the version. It is a list of key-value pairs. The value is optional and when not provided, the metadata item has boolean semantics (presence indicates true). For example, 'Partial' metadata on a previous version indicates that the previous update was never fully completed. Can contain at most 5 items.", +} + +func (Version) SwaggerDoc() map[string]string { + return map_Version +} + +var map_VersionMetadata = map[string]string{ + "": "VersionMetadata is a key:value item assigned to version involved in the update. Value can be empty, then the metadata have boolean semantics (true when present, false when absent)", + "key": "key is the name of this metadata value. Valid values are: Installation, Partial, Architecture", + "value": "value is the value for the metadata, at most 32 characters long. It is not expected to be provided for Installation and Partial metadata. For Architecture metadata, it is expected to be a string that indicates the architecture of the payload image of the version involved in the upgrade, when relevant.", +} + +func (VersionMetadata) SwaggerDoc() map[string]string { + return map_VersionMetadata +} + +// AUTO-GENERATED FUNCTIONS END HERE