From b16e7a95651a22e68e7a89548e35947fb8ac4142 Mon Sep 17 00:00:00 2001 From: Westly Wright Date: Thu, 26 Mar 2020 12:19:31 -0700 Subject: [PATCH] set subnets to empty array if it's null until backend fix rancher/rancher#26231 rancher/rancher#24652 --- .../cluster-driver/driver-amazoneks/component.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/shared/addon/components/cluster-driver/driver-amazoneks/component.js b/lib/shared/addon/components/cluster-driver/driver-amazoneks/component.js index a8823d4cb..6caf35925 100644 --- a/lib/shared/addon/components/cluster-driver/driver-amazoneks/component.js +++ b/lib/shared/addon/components/cluster-driver/driver-amazoneks/component.js @@ -10,6 +10,7 @@ import { equal } from '@ember/object/computed'; import { inject as service } from '@ember/service'; import $ from 'jquery'; import { rcompare, coerce } from 'semver'; +import { isEmpty } from '@ember/utils'; const REGIONS = ['us-east-2', 'us-east-1', 'us-west-2', 'ap-east-1', 'ap-south-1', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-north-1', 'me-south-1', 'sa-east-1']; const RANCHER_GROUP = 'rancher-nodes'; @@ -504,4 +505,16 @@ export default Component.extend(ClusterDriver, { }); }); }, + + willSave() { + // temporary measure put in place for rancher/rancher#24652 + const { config: { subnets } } = this; + + if (isEmpty(subnets)) { + set(this, 'config.subnets', []); + } + + return this._super(...arguments); + }, + });