-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add openshift/managed-upgrade-operator
Signed-off-by: Sebastian Hoß <[email protected]>
- Loading branch information
Showing
9 changed files
with
311 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...nshift/managed-upgrade-operator/upgrade.managed.openshift.io/v1alpha1/upgradeconfigs.args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--derive=PartialEq |
168 changes: 168 additions & 0 deletions
168
...nshift/managed-upgrade-operator/upgrade.managed.openshift.io/v1alpha1/upgradeconfigs.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.13.0 | ||
name: upgradeconfigs.upgrade.managed.openshift.io | ||
spec: | ||
group: upgrade.managed.openshift.io | ||
names: | ||
kind: UpgradeConfig | ||
listKind: UpgradeConfigList | ||
plural: upgradeconfigs | ||
shortNames: | ||
- upgrade | ||
singular: upgradeconfig | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- jsonPath: .spec.desired.version | ||
name: desired_version | ||
type: string | ||
- jsonPath: .status.history[0].phase | ||
name: phase | ||
type: string | ||
- jsonPath: .status.history[0].conditions[0].type | ||
name: stage | ||
type: string | ||
- jsonPath: .status.history[0].conditions[0].status | ||
name: status | ||
type: string | ||
- jsonPath: .status.history[0].conditions[0].reason | ||
name: reason | ||
type: string | ||
- jsonPath: .status.history[0].conditions[0].message | ||
name: message | ||
type: string | ||
name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: UpgradeConfig is the Schema for the upgradeconfigs API | ||
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: UpgradeConfigSpec defines the desired state of UpgradeConfig and upgrade window and freeze window | ||
properties: | ||
PDBForceDrainTimeout: | ||
description: The maximum grace period granted to a node whose drain is blocked by a Pod Disruption Budget, before that drain is forced. Measured in minutes. The minimum accepted value is 0 and in this case it will trigger force drain after the expectedNodeDrainTime lapsed. | ||
format: int32 | ||
minimum: 0.0 | ||
type: integer | ||
capacityReservation: | ||
description: Specify if scaling up an extra node for capacity reservation before upgrade starts is needed | ||
type: boolean | ||
desired: | ||
description: Specify the desired OpenShift release | ||
properties: | ||
channel: | ||
description: Channel used for upgrades | ||
type: string | ||
image: | ||
description: Image reference used for upgrades | ||
type: string | ||
version: | ||
description: Version of openshift release | ||
type: string | ||
type: object | ||
type: | ||
description: Type indicates the ClusterUpgrader implementation to use to perform an upgrade of the cluster | ||
enum: | ||
- OSD | ||
- ARO | ||
type: string | ||
upgradeAt: | ||
description: Specify the upgrade start time | ||
type: string | ||
required: | ||
- PDBForceDrainTimeout | ||
- desired | ||
- type | ||
- upgradeAt | ||
type: object | ||
status: | ||
description: UpgradeConfigStatus defines the observed state of UpgradeConfig | ||
properties: | ||
history: | ||
description: This record history of every upgrade | ||
items: | ||
description: UpgradeHistory record history of upgrade | ||
properties: | ||
completeTime: | ||
format: date-time | ||
type: string | ||
conditions: | ||
description: Conditions is a set of Condition instances. | ||
items: | ||
description: UpgradeCondition houses fields that describe the state of an Upgrade including metadata. | ||
properties: | ||
completeTime: | ||
description: Complete time of this condition. | ||
format: date-time | ||
type: string | ||
lastProbeTime: | ||
description: Last time the condition was checked. | ||
format: date-time | ||
type: string | ||
lastTransitionTime: | ||
description: Last time the condition transit from one status to another. | ||
format: date-time | ||
type: string | ||
message: | ||
description: Human readable message indicating details about last transition. | ||
type: string | ||
reason: | ||
description: (brief) reason for the condition's last transition. | ||
type: string | ||
startTime: | ||
description: Start time of this condition. | ||
format: date-time | ||
type: string | ||
status: | ||
description: Status of condition, one of True, False, Unknown | ||
type: string | ||
type: | ||
description: Type of upgrade condition | ||
type: string | ||
required: | ||
- status | ||
- type | ||
type: object | ||
type: array | ||
phase: | ||
description: This describe the status of the upgrade process | ||
enum: | ||
- New | ||
- Pending | ||
- Upgrading | ||
- Upgraded | ||
- Failed | ||
type: string | ||
startTime: | ||
format: date-time | ||
type: string | ||
version: | ||
description: Desired version of this upgrade | ||
type: string | ||
workerCompleteTime: | ||
format: date-time | ||
type: string | ||
workerStartTime: | ||
format: date-time | ||
type: string | ||
required: | ||
- phase | ||
type: object | ||
type: array | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
kube-custom-resources-rs/src/upgrade_managed_openshift_io/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod v1alpha1; |
1 change: 1 addition & 0 deletions
1
kube-custom-resources-rs/src/upgrade_managed_openshift_io/v1alpha1/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod upgradeconfigs; |
120 changes: 120 additions & 0 deletions
120
kube-custom-resources-rs/src/upgrade_managed_openshift_io/v1alpha1/upgradeconfigs.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
// WARNING: generated by kopium - manual changes will be overwritten | ||
// kopium command: kopium --docs --filename=./crd-catalog/openshift/managed-upgrade-operator/upgrade.managed.openshift.io/v1alpha1/upgradeconfigs.yaml --derive=PartialEq | ||
// kopium version: 0.16.2 | ||
|
||
use kube::CustomResource; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
/// UpgradeConfigSpec defines the desired state of UpgradeConfig and upgrade window and freeze window | ||
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
#[kube(group = "upgrade.managed.openshift.io", version = "v1alpha1", kind = "UpgradeConfig", plural = "upgradeconfigs")] | ||
#[kube(namespaced)] | ||
#[kube(status = "UpgradeConfigStatus")] | ||
#[kube(schema = "disabled")] | ||
pub struct UpgradeConfigSpec { | ||
/// The maximum grace period granted to a node whose drain is blocked by a Pod Disruption Budget, before that drain is forced. Measured in minutes. The minimum accepted value is 0 and in this case it will trigger force drain after the expectedNodeDrainTime lapsed. | ||
#[serde(rename = "PDBForceDrainTimeout")] | ||
pub pdb_force_drain_timeout: i32, | ||
/// Specify if scaling up an extra node for capacity reservation before upgrade starts is needed | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "capacityReservation")] | ||
pub capacity_reservation: Option<bool>, | ||
/// Specify the desired OpenShift release | ||
pub desired: UpgradeConfigDesired, | ||
/// Type indicates the ClusterUpgrader implementation to use to perform an upgrade of the cluster | ||
#[serde(rename = "type")] | ||
pub r#type: UpgradeConfigType, | ||
/// Specify the upgrade start time | ||
#[serde(rename = "upgradeAt")] | ||
pub upgrade_at: String, | ||
} | ||
|
||
/// Specify the desired OpenShift release | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub struct UpgradeConfigDesired { | ||
/// Channel used for upgrades | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub channel: Option<String>, | ||
/// Image reference used for upgrades | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub image: Option<String>, | ||
/// Version of openshift release | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub version: Option<String>, | ||
} | ||
|
||
/// UpgradeConfigSpec defines the desired state of UpgradeConfig and upgrade window and freeze window | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub enum UpgradeConfigType { | ||
#[serde(rename = "OSD")] | ||
Osd, | ||
#[serde(rename = "ARO")] | ||
Aro, | ||
} | ||
|
||
/// UpgradeConfigStatus defines the observed state of UpgradeConfig | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub struct UpgradeConfigStatus { | ||
/// This record history of every upgrade | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub history: Option<Vec<UpgradeConfigStatusHistory>>, | ||
} | ||
|
||
/// UpgradeHistory record history of upgrade | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub struct UpgradeConfigStatusHistory { | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "completeTime")] | ||
pub complete_time: Option<String>, | ||
/// Conditions is a set of Condition instances. | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub conditions: Option<Vec<UpgradeConfigStatusHistoryConditions>>, | ||
/// This describe the status of the upgrade process | ||
pub phase: UpgradeConfigStatusHistoryPhase, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "startTime")] | ||
pub start_time: Option<String>, | ||
/// Desired version of this upgrade | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub version: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "workerCompleteTime")] | ||
pub worker_complete_time: Option<String>, | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "workerStartTime")] | ||
pub worker_start_time: Option<String>, | ||
} | ||
|
||
/// UpgradeCondition houses fields that describe the state of an Upgrade including metadata. | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub struct UpgradeConfigStatusHistoryConditions { | ||
/// Complete time of this condition. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "completeTime")] | ||
pub complete_time: Option<String>, | ||
/// Last time the condition was checked. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "lastProbeTime")] | ||
pub last_probe_time: Option<String>, | ||
/// Last time the condition transit from one status to another. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "lastTransitionTime")] | ||
pub last_transition_time: Option<String>, | ||
/// Human readable message indicating details about last transition. | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub message: Option<String>, | ||
/// (brief) reason for the condition's last transition. | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub reason: Option<String>, | ||
/// Start time of this condition. | ||
#[serde(default, skip_serializing_if = "Option::is_none", rename = "startTime")] | ||
pub start_time: Option<String>, | ||
/// Status of condition, one of True, False, Unknown | ||
pub status: String, | ||
/// Type of upgrade condition | ||
#[serde(rename = "type")] | ||
pub r#type: String, | ||
} | ||
|
||
/// UpgradeHistory record history of upgrade | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] | ||
pub enum UpgradeConfigStatusHistoryPhase { | ||
New, | ||
Pending, | ||
Upgrading, | ||
Upgraded, | ||
Failed, | ||
} | ||
|