From 37edb34e786ec3d1bd17cf399830f67d13695d2b Mon Sep 17 00:00:00 2001 From: Evgeniya Vashkevich Date: Wed, 1 Nov 2023 13:02:37 -0700 Subject: [PATCH] Fixed RKE cluster being shown as Imported (#9868) --- .../components/formatter/ClusterProvider.vue | 19 +--- .../__tests__/ClusterProvider.test.ts | 28 ------ .../management.cattle.io.cluster.test.ts | 19 ++++ .../provisioning.cattle.io.cluster.test.ts | 90 +++++++++++++++++++ shell/models/management.cattle.io.cluster.js | 4 + .../models/provisioning.cattle.io.cluster.js | 20 ++++- 6 files changed, 130 insertions(+), 50 deletions(-) delete mode 100644 shell/components/formatter/__tests__/ClusterProvider.test.ts create mode 100644 shell/models/__tests__/management.cattle.io.cluster.test.ts create mode 100644 shell/models/__tests__/provisioning.cattle.io.cluster.test.ts diff --git a/shell/components/formatter/ClusterProvider.vue b/shell/components/formatter/ClusterProvider.vue index c5688b22ad2..eb74d13ddfd 100644 --- a/shell/components/formatter/ClusterProvider.vue +++ b/shell/components/formatter/ClusterProvider.vue @@ -6,23 +6,6 @@ export default { required: true }, }, - data(props) { - const mgmt = props.row?.mgmt; - - return { - // The isImported getter on the provisioning cluster - // model doesn't work for imported K3s clusters, in - // which case it returns 'k3s' instead of 'imported.' - // This is the workaround. - isImported: mgmt?.providerForEmberParam === 'import' || - // when imported cluster is GKE - !!mgmt?.spec?.gkeConfig?.imported || - // or AKS - !!mgmt?.spec?.aksConfig?.imported || - // or EKS - !!mgmt?.spec?.eksConfig?.imported - }; - }, }; @@ -45,7 +28,7 @@ export default { -