From 2388cfadb8ef8bea27383c50c4711e9f5382ebd1 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Mon, 17 Jun 2024 09:25:38 +0200 Subject: [PATCH] fix: Apply CheCluster patch (#2874) Signed-off-by: Anatolii Bazko --- src/tasks/che-cluster-tasks.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/tasks/che-cluster-tasks.ts b/src/tasks/che-cluster-tasks.ts index d64cc9393..8bfeded60 100644 --- a/src/tasks/che-cluster-tasks.ts +++ b/src/tasks/che-cluster-tasks.ts @@ -100,12 +100,19 @@ export namespace CheClusterTasks { merge(cheCluster, { spec: { devEnvironments: { startTimeoutSeconds: 3000 } } }) } - // override default values with patch file + await kubeHelper.createNamespacedCustomObject(flags[CHE_NAMESPACE_FLAG], EclipseChe.CHE_CLUSTER_API_GROUP, EclipseChe.CHE_CLUSTER_API_VERSION_V2, EclipseChe.CHE_CLUSTER_KIND_PLURAL, cheCluster, true) + if (ctx[EclipseCheContext.CR_PATCH]) { - merge(cheCluster, ctx[EclipseCheContext.CR_PATCH]) + // merge(cheCluster, ctx[EclipseCheContext.CR_PATCH]) + await kubeHelper.patchNamespacedCustomObject( + cheCluster.metadata.name!, + flags[CHE_NAMESPACE_FLAG], + ctx[EclipseCheContext.CR_PATCH], + EclipseChe.CHE_CLUSTER_API_GROUP, + EclipseChe.CHE_CLUSTER_API_VERSION_V2, + EclipseChe.CHE_CLUSTER_KIND_PLURAL) } - await kubeHelper.createNamespacedCustomObject(flags[CHE_NAMESPACE_FLAG], EclipseChe.CHE_CLUSTER_API_GROUP, EclipseChe.CHE_CLUSTER_API_VERSION_V2, EclipseChe.CHE_CLUSTER_KIND_PLURAL, cheCluster, true) task.title = `${task.title}...[Created]` }, }