From f2f2633e3ba66dfaa2b0f552a48d1296bf71c508 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Fri, 14 Jun 2024 16:51:33 +0200 Subject: [PATCH] fix: Apply CheCluster patch 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]` }, }