diff --git a/README.md b/README.md index 6cb44b6..8d887d3 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si ```sh # To simulate an OpenShift cluster -kubectl apply -f https://raw.githubusercontent.com/openshift/api/master/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml -kubectl apply -f https://raw.githubusercontent.com/openshift/machine-config-operator/master/install/0000_80_machine-config-operator_01_machineconfigpool.crd.yaml +kubectl apply -f https://raw.githubusercontent.com/openshift/api/refs/heads/release-4.16/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml +kubectl apply -f https://raw.githubusercontent.com/openshift/api/refs/heads/release-4.16/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-Default.crd.yaml # interactive cluster version operator simulation go run ./sim diff --git a/config/samples/managedupgrade_v1beta1_clusterversion.yaml b/config/samples/managedupgrade_v1beta1_clusterversion.yaml index 4e91c3d..d2f2d37 100644 --- a/config/samples/managedupgrade_v1beta1_clusterversion.yaml +++ b/config/samples/managedupgrade_v1beta1_clusterversion.yaml @@ -1,12 +1,16 @@ apiVersion: managedupgrade.appuio.io/v1beta1 kind: ClusterVersion metadata: - labels: - app.kubernetes.io/name: clusterversion - app.kubernetes.io/instance: clusterversion-sample - app.kubernetes.io/part-of: openshift-upgrade-controller - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: openshift-upgrade-controller - name: clusterversion-sample + name: version spec: - # TODO(user): Add fields here + overlays: + - from: '2024-08-08T03:00:00Z' + overlay: + spec: + channel: stable-4.15 + template: + spec: + channel: stable-4.14 + clusterID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + upstream: 'https://api.openshift.com/api/upgrades_info/v1/graph' +status: {} diff --git a/config/samples/managedupgrade_v1beta1_upgradeconfig.yaml b/config/samples/managedupgrade_v1beta1_upgradeconfig.yaml index a98246d..dfe1825 100644 --- a/config/samples/managedupgrade_v1beta1_upgradeconfig.yaml +++ b/config/samples/managedupgrade_v1beta1_upgradeconfig.yaml @@ -1,14 +1,7 @@ apiVersion: managedupgrade.appuio.io/v1beta1 kind: UpgradeConfig metadata: - labels: - app.kubernetes.io/name: upgradeconfig - app.kubernetes.io/instance: upgradeconfig-sample - app.kubernetes.io/part-of: openshift-upgrade-controller - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: openshift-upgrade-controller name: upgradeconfig-sample - namespace: appuio-openshift-upgrade-controller spec: maxSchedulingDelay: 1h maxUpgradeStartDelay: 1h diff --git a/config/samples/managedupgrade_v1beta1_upgradejob.yaml b/config/samples/managedupgrade_v1beta1_upgradejob.yaml index 67e9f81..a1947d2 100644 --- a/config/samples/managedupgrade_v1beta1_upgradejob.yaml +++ b/config/samples/managedupgrade_v1beta1_upgradejob.yaml @@ -1,12 +1,6 @@ apiVersion: managedupgrade.appuio.io/v1beta1 kind: UpgradeJob metadata: - labels: - app.kubernetes.io/name: upgradejob - app.kubernetes.io/instance: upgradejob-sample - app.kubernetes.io/part-of: openshift-upgrade-controller - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: openshift-upgrade-controller name: upgradejob-sample spec: # TODO(user): Add fields here diff --git a/config/samples/managedupgrade_v1beta1_upgradejobhook.yaml b/config/samples/managedupgrade_v1beta1_upgradejobhook.yaml index e98baf3..b726eff 100644 --- a/config/samples/managedupgrade_v1beta1_upgradejobhook.yaml +++ b/config/samples/managedupgrade_v1beta1_upgradejobhook.yaml @@ -1,12 +1,6 @@ apiVersion: managedupgrade.appuio.io/v1beta1 kind: UpgradeJobHook metadata: - labels: - app.kubernetes.io/name: upgradejobhook - app.kubernetes.io/instance: upgradejobhook-sample - app.kubernetes.io/part-of: openshift-upgrade-controller - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: openshift-upgrade-controller name: upgradejobhook-sample spec: events: diff --git a/config/samples/managedupgrade_v1beta1_upgradesuspensionwindow.yaml b/config/samples/managedupgrade_v1beta1_upgradesuspensionwindow.yaml new file mode 100644 index 0000000..79a895d --- /dev/null +++ b/config/samples/managedupgrade_v1beta1_upgradesuspensionwindow.yaml @@ -0,0 +1,10 @@ +apiVersion: managedupgrade.appuio.io/v1beta1 +kind: UpgradeSuspensionWindow +metadata: + name: upgradesuspensionwindow-sample +spec: + start: "2024-10-08T08:00:00Z" + end: "2034-10-08T08:00:00Z" + reason: "I'm tired of upgrades" + configSelector: {} + jobSelector: {} diff --git a/controllers/upgradesuspensionwindow_controller.go b/controllers/upgradesuspensionwindow_controller.go index 472ef83..8981e3d 100644 --- a/controllers/upgradesuspensionwindow_controller.go +++ b/controllers/upgradesuspensionwindow_controller.go @@ -15,7 +15,7 @@ import ( managedupgradev1beta1 "github.com/appuio/openshift-upgrade-controller/api/v1beta1" ) -// UpgradeSuspensionWindowReconciler reconciles a UpgradeConfig object +// UpgradeSuspensionWindowReconciler reconciles a UpgradeSuspensionWindow object type UpgradeSuspensionWindowReconciler struct { client.Client Scheme *runtime.Scheme