From d653bdf629cd4b4f466dceadb00f15f1901c8415 Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Thu, 13 Jun 2024 13:19:37 +0100 Subject: [PATCH] Fix bug causing e2e tests to fail --- .../provisioning.cattle.io.cluster/rke2.vue | 17 ++++++++++++++++- shell/utils/model-extensions.ts | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/shell/edit/provisioning.cattle.io.cluster/rke2.vue b/shell/edit/provisioning.cattle.io.cluster/rke2.vue index a20cc8ccdd0..ad666469d7e 100644 --- a/shell/edit/provisioning.cattle.io.cluster/rke2.vue +++ b/shell/edit/provisioning.cattle.io.cluster/rke2.vue @@ -419,7 +419,22 @@ export default { * Extension provider where being provisioned by an extension */ extensionProvider() { - return this.value?.customProvisionerHelper; + // Note we don't use the model customProvisionerHelper here, as for create it won't be set + // Instead we create from the provider value + const extClass = this.$plugin.getDynamic('provisioner', this.provider); + + if (extClass) { + return new extClass({ + dispatch: this.$store.dispatch, + getters: this.$store.getters, + axios: this.$store.$axios, + $plugin: this.$store.app.$plugin, + $t: this.t, + isCreate: this.isCreate + }); + } + + return undefined; }, /** diff --git a/shell/utils/model-extensions.ts b/shell/utils/model-extensions.ts index 9c1695886ed..25465aa5d91 100644 --- a/shell/utils/model-extensions.ts +++ b/shell/utils/model-extensions.ts @@ -30,7 +30,7 @@ interface IModel { // Function that for a model will return the name of the model extension to use for it type UseForFunction = (model: any) => string; -// Cache of instantiated model helpers for a given model and helpername +// Cache of instantiated model helpers for a given model and helper name const modelExtensionCache: {[modelName: string]: {[name: string]: any[]}} = {}; // Cache of instantiated functions to determine if a helper should be used for a given model