From 8f95d08613b9d3e7c55e18f27434e2293b6f4d1e Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Thu, 7 Sep 2023 11:24:56 -0400 Subject: [PATCH 1/3] truly remove aws and antrea addons --- src/components/Kurlsh.js | 89 ++----------------- src/components/SupportedAddOns.js | 5 -- src/components/__tests__/kurlsh.js | 2 - .../modals/ConfirmSelectionModal.js | 22 +---- src/scss/utilities/icons.scss | 18 +--- static/versionDetails.json | 35 -------- 6 files changed, 10 insertions(+), 161 deletions(-) diff --git a/src/components/Kurlsh.js b/src/components/Kurlsh.js index 810c7c0a..94a04616 100644 --- a/src/components/Kurlsh.js +++ b/src/components/Kurlsh.js @@ -22,7 +22,6 @@ const NIL_VERSIONS = { kubernetes: { version: "None" }, flannel: { version: "None" }, weave: { version: "None" }, - antrea: { version: "None" }, contour: { version: "None" }, rook: { version: "None" }, docker: { version: "None" }, @@ -41,9 +40,8 @@ const NIL_VERSIONS = { certManager: { version: "None" }, sonobuoy: { version: "None" }, goldpinger: { version: "None" }, - aws: { version: "None" }, } -const hasAdvancedOptions = ["kubernetes", "flannel", "weave", "antrea", "contour", "rook", "registry", "docker", "velero", "kotsadm", "ekco", "fluentd", "minio", "openebs", "longhorn", "prometheus", "aws"]; +const hasAdvancedOptions = ["kubernetes", "flannel", "weave", "contour", "rook", "registry", "docker", "velero", "kotsadm", "ekco", "fluentd", "minio", "openebs", "longhorn", "prometheus"]; function versionToState(version) { return { version @@ -66,7 +64,6 @@ class Kurlsh extends React.Component { const contourVersions = this.prepareVersions("contour", supportedVersions.contour); const flannelVersions = this.prepareVersions("flannel", supportedVersions.flannel); const weaveVersions = this.prepareVersions("weave", supportedVersions.weave); - const antreaVersions = this.prepareVersions("antrea", supportedVersions.antrea); const rookVersions = this.prepareVersions("rook", supportedVersions.rook); const dockerVersions = this.prepareVersions("docker", supportedVersions.docker); const prometheusVersions = this.prepareVersions("prometheus", supportedVersions.prometheus); @@ -84,14 +81,12 @@ class Kurlsh extends React.Component { const certManagerVersions = this.prepareVersions("cert-manager", supportedVersions["cert-manager"]); const sonobuoyVersions = this.prepareVersions("sonobuoy", supportedVersions.sonobuoy); const goldpingerVersions = this.prepareVersions("goldpinger", supportedVersions.goldpinger); - const awsVersions = this.prepareVersions("aws", supportedVersions.aws); this.state = { versions: { kubernetes: kubernetesVersions, flannel: flannelVersions, weave: weaveVersions, - antrea: antreaVersions, contour: contourVersions, rook: rookVersions, docker: dockerVersions, @@ -110,7 +105,6 @@ class Kurlsh extends React.Component { certManager: certManagerVersions, sonobuoy: sonobuoyVersions, goldpinger: goldpingerVersions, - aws: awsVersions, }, selectedVersions: NIL_VERSIONS, installerSha: "", @@ -118,7 +112,6 @@ class Kurlsh extends React.Component { "kubernetes": false, "flannel": false, "weave": false, - "antrea": false, "contour": false, "rook": false, "prometheus": false, @@ -135,13 +128,11 @@ class Kurlsh extends React.Component { "certManager": false, "sonobuoy": false, "goldpinger": false, - "aws": false, }, advancedOptions: { kubernetes: {}, flannel: {}, weave: {}, - antrea: {}, contour: {}, rook: {}, registry: {}, @@ -159,13 +150,11 @@ class Kurlsh extends React.Component { sonobuoy: {}, goldpinger: {}, prometheus: {}, - aws: {}, }, isAddOnChecked: { kubernetes: false, flannel: false, weave: false, - antrea: false, contour: false, rook: false, docker: false, @@ -184,7 +173,6 @@ class Kurlsh extends React.Component { certManager: false, sonobuoy: false, goldpinger: false, - aws: false, }, optionDefaults: {}, installerErrMsg: "", @@ -426,20 +414,6 @@ class Kurlsh extends React.Component { } } - if (isAddOnChecked.antrea) { - const diff = getDiff(optionDefaults["antrea"], options.antrea); - generatedInstaller.spec.antrea = { - version: selectedVersions.antrea.version - }; - - if (Object.keys(diff).length) { - generatedInstaller.spec.antrea = { - ...generatedInstaller.spec.antrea, - ...diff - }; - } - } - if (isAddOnChecked.rook) { const diff = getDiff(optionDefaults["rook"], options.rook); generatedInstaller.spec.rook = { @@ -684,20 +658,6 @@ class Kurlsh extends React.Component { } } - if (isAddOnChecked.aws) { - const diff = getDiff(optionDefaults["aws"], options.aws); - generatedInstaller.spec.aws = { - version: selectedVersions.aws.version - }; - - if (Object.keys(diff).length) { - generatedInstaller.spec.aws = { - ...generatedInstaller.spec.aws, - ...diff - }; - } - } - let renderedYaml = json2yaml.stringify(generatedInstaller).replace("---\n", "").replace(/^ {2}/gm, ""); if (sha === "latest") { @@ -728,11 +688,9 @@ class Kurlsh extends React.Component { this.checkIncompatibleSelection({ containerd: value }); } else if (name === "docker" && value.version !== "None" && this.state.isAddOnChecked.containerd) { this.checkIncompatibleSelection({ docker: value }); - } else if (name === "flannel" && value.version !== "None" && (this.state.isAddOnChecked.weave || this.state.isAddOnChecked.antrea)) { + } else if (name === "flannel" && value.version !== "None" && this.state.isAddOnChecked.weave) { this.checkIncompatibleSelection({ flannel: value }); - } else if (name === "antrea" && value.version !== "None" && (this.state.isAddOnChecked.weave || this.state.isAddOnChecked.flannel)) { - this.checkIncompatibleSelection({ antrea: value }); - } else if (name === "weave" && value.version !== "None" && (this.state.isAddOnChecked.antrea || this.state.isAddOnChecked.flannel)) { + } else if (name === "weave" && value.version !== "None" && this.state.isAddOnChecked.flannel) { this.checkIncompatibleSelection({ weave: value }); } else { this.setState({ selectedVersions: { ...this.state.selectedVersions, [name]: value } }, () => { @@ -789,12 +747,10 @@ class Kurlsh extends React.Component { this.checkIncompatibleSelection({ containerd: { version: selectedVersion } }); } else if (name === "docker" && this.state.isAddOnChecked.containerd) { this.checkIncompatibleSelection({ docker: { version: selectedVersion } }); - } else if (name === "flannel" && (this.state.isAddOnChecked.weave || this.state.isAddOnChecked.antrea)) { + } else if (name === "flannel" && this.state.isAddOnChecked.weave) { this.checkIncompatibleSelection({ flannel: { version: selectedVersion } }); - } else if (name === "weave" && (this.state.isAddOnChecked.antrea || this.state.isAddOnChecked.flannel)) { + } else if (name === "weave" && this.state.isAddOnChecked.flannel) { this.checkIncompatibleSelection({ weave: { version: selectedVersion } }); - } else if (name === "antrea" && (this.state.isAddOnChecked.weave || this.state.isAddOnChecked.flannel)) { - this.checkIncompatibleSelection({ antrea: { version: selectedVersion } }); } else { this.setState({ selectedVersions: { ...nextSelectedVersions, [name]: { version: selectedVersion } } }, () => { this.postToKurlInstaller(this.getYaml(this.state.installerSha)); @@ -1280,21 +1236,6 @@ class Kurlsh extends React.Component { onToggleShowAdvancedOptions={() => this.onToggleShowAdvancedOptions("weave")} renderAdvancedOptions={() => this.renderAdvancedOptions("weave")} /> - selected} - value={selectedVersions.antrea} - onVersionChange={this.onVersionChange("antrea")} - handleIsAddOnSelected={(e) => this.handleIsAddOnSelected("antrea", e)} - showAdvancedOptions={showAdvancedOptions["antrea"]} - onToggleShowAdvancedOptions={() => this.onToggleShowAdvancedOptions("antrea")} - renderAdvancedOptions={() => this.renderAdvancedOptions("antrea")} - />
@@ -1554,26 +1495,6 @@ class Kurlsh extends React.Component { renderAdvancedOptions={() => this.renderAdvancedOptions("velero")} />
- -
- Cloud Provider - selected} - value={selectedVersions.aws} - onVersionChange={this.onVersionChange("aws")} - handleIsAddOnSelected={(e) => this.handleIsAddOnSelected("aws", e)} - showAdvancedOptions={showAdvancedOptions["aws"]} - onToggleShowAdvancedOptions={() => this.onToggleShowAdvancedOptions("aws")} - renderAdvancedOptions={() => this.renderAdvancedOptions("aws")} - /> -
- diff --git a/src/components/SupportedAddOns.js b/src/components/SupportedAddOns.js index 49eae9ef..60c6e2f2 100644 --- a/src/components/SupportedAddOns.js +++ b/src/components/SupportedAddOns.js @@ -150,8 +150,6 @@ class SupportedAddOns extends React.Component { return "OpenEBS"; case "iptables": return "iptables" - case "aws": - return "AWS"; default: return name.charAt(0).toUpperCase() + name.slice(1); } @@ -171,9 +169,6 @@ class SupportedAddOns extends React.Component {
{this.generateVersionName(addOn.name)} - {addOn.name === "aws" && ( - beta - )}
{addOn.fulfills.map((category, i) => { diff --git a/src/components/__tests__/kurlsh.js b/src/components/__tests__/kurlsh.js index c684971b..f842a7d5 100644 --- a/src/components/__tests__/kurlsh.js +++ b/src/components/__tests__/kurlsh.js @@ -3,8 +3,6 @@ import Kurl from "../Kurlsh"; const defaultProps = { supportedVersions: { "kubernetes": [ "latest", "1.19.16", "1.19.15", "1.19.13" ], - "antrea": [ "latest", "1.4.0", "1.2.1", "1.2.0" ], - "aws": [ "latest", "0.1.0" ], "calico": [ "latest", "3.9.1" ], "collectd": [ "latest", "v5", "0.0.1" ], "containerd": [ "latest", "1.6.8", "1.6.7", "1.6.6" ], diff --git a/src/components/modals/ConfirmSelectionModal.js b/src/components/modals/ConfirmSelectionModal.js index 8f2e28ce..52f7f427 100644 --- a/src/components/modals/ConfirmSelectionModal.js +++ b/src/components/modals/ConfirmSelectionModal.js @@ -22,23 +22,9 @@ class ConfirmSelectionModal extends React.Component { } else if (current === "docker") { this.setState({ addOnToRemove: { containerd: selectedVersions.containerd } }); } else if (current === "flannel") { - if (selectedVersions.weave.version !== "None") { - this.setState({ addOnToRemove: { weave: selectedVersions.weave } }); - } else { - this.setState({ addOnToRemove: { antrea: selectedVersions.antrea } }); - } - } else if (current === "antrea") { - if (selectedVersions.weave.version !== "None") { - this.setState({ addOnToRemove: { weave: selectedVersions.weave } }); - } else { - this.setState({ addOnToRemove: { flannel: selectedVersions.flannel } }); - } - } else { - if (selectedVersions.antrea.version !== "None") { - this.setState({ addOnToRemove: { antrea: selectedVersions.antrea } }); - } else { - this.setState({ addOnToRemove: { flannel: selectedVersions.flannel } }); - } + this.setState({ addOnToRemove: { weave: selectedVersions.weave } }); + } else if (current === "weave") { + this.setState({ addOnToRemove: { flannel: selectedVersions.flannel } }); } } @@ -105,4 +91,4 @@ class ConfirmSelectionModal extends React.Component { } } -export default ConfirmSelectionModal; \ No newline at end of file +export default ConfirmSelectionModal; diff --git a/src/scss/utilities/icons.scss b/src/scss/utilities/icons.scss index b4cd5d58..9b72a48b 100644 --- a/src/scss/utilities/icons.scss +++ b/src/scss/utilities/icons.scss @@ -84,11 +84,6 @@ width: 40px; height: 40px; } -.icon.u-aws { - background-position: -138px -299px; - width: 40px; - height: 38px; -} .icon.u-selinux { background-position: -56px -124px; width: 44px; @@ -139,11 +134,6 @@ width: 42px; height: 40px; } -.icon.u-antrea { - background-position: -49px -259px; - width: 40px; - height: 40px; -} .icon.u-longhorn { background-position: -93px -259px; width: 40px; @@ -256,12 +246,6 @@ height: 24px; margin-right: 12px; } -.icon.u-antrea-small-icon { - background-position: -197px -229px; - width: 24px; - height: 24px; - margin-right: 12px; -} .icon.u-calico-small-icon { background-position: -102px -230px; width: 24px; @@ -318,4 +302,4 @@ background-position: -270px -9px; margin-left: 10px; cursor: pointer; -} \ No newline at end of file +} diff --git a/static/versionDetails.json b/static/versionDetails.json index f24825e6..b1159a3c 100644 --- a/static/versionDetails.json +++ b/static/versionDetails.json @@ -141,28 +141,6 @@ "defaultValue": true } ], - "antrea": [ - { - "flag": "version", - "description": "The version of antrea to be installed.", - "type": "string" - }, - { - "flag": "isEncryptionDisabled", - "description": "Encrypt network communication between nodes in the cluster.", - "type": "boolean" - }, - { - "flag": "podCIDR", - "description": "The subnet used by Pods.", - "type": "string" - }, - { - "flag": "podCidrRange", - "description": "The size of the subnet used by Pods.", - "type": "string" - } - ], "contour": [ { "flag": "version", @@ -756,18 +734,5 @@ "description": "The version of Goldpinger to be installed.", "type": "string" } - ], - "aws": [ - { - "flag": "version", - "description": "The version of aws to be installed.", - "type": "string" - }, - { - "flag": "excludeStorageClass", - "description": "Exclude AWS-EBS provisioner storage class provided by the AWS add-on. When `true`, another storage provisioner, such as Longhorn, must be used.", - "type": "boolean", - "defaultValue": false - } ] } From 2d3d9f2282d52ad87a59c80b757107fdeeb2c5b7 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Thu, 7 Sep 2023 11:37:20 -0400 Subject: [PATCH 2/3] show on spec view page --- src/components/App.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/App.js b/src/components/App.js index 57abf2e1..498d8206 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -269,6 +269,8 @@ cat install.sh | sudo bash -s airgap } {installerData.spec.weave && } + {installerData.spec.antrea && + } {installerData.spec.contour && } {installerData.spec.rook && @@ -304,7 +306,9 @@ cat install.sh | sudo bash -s airgap {installerData.spec.sonobuoy && } {installerData.spec.localPathProvisioner && - } + } + {installerData.spec.aws && + }
} {installerData && From 12ce647f2694f6be04979196884f25c4b84cd1da Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Thu, 7 Sep 2023 11:42:52 -0400 Subject: [PATCH 3/3] restore version details and icons --- src/scss/utilities/icons.scss | 16 ++++++++++++++++ static/versionDetails.json | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/src/scss/utilities/icons.scss b/src/scss/utilities/icons.scss index 9b72a48b..e47f38a1 100644 --- a/src/scss/utilities/icons.scss +++ b/src/scss/utilities/icons.scss @@ -84,6 +84,11 @@ width: 40px; height: 40px; } +.icon.u-aws { + background-position: -138px -299px; + width: 40px; + height: 38px; +} .icon.u-selinux { background-position: -56px -124px; width: 44px; @@ -134,6 +139,11 @@ width: 42px; height: 40px; } +.icon.u-antrea { + background-position: -49px -259px; + width: 40px; + height: 40px; +} .icon.u-longhorn { background-position: -93px -259px; width: 40px; @@ -246,6 +256,12 @@ height: 24px; margin-right: 12px; } +.icon.u-antrea-small-icon { + background-position: -197px -229px; + width: 24px; + height: 24px; + margin-right: 12px; +} .icon.u-calico-small-icon { background-position: -102px -230px; width: 24px; diff --git a/static/versionDetails.json b/static/versionDetails.json index b1159a3c..f24825e6 100644 --- a/static/versionDetails.json +++ b/static/versionDetails.json @@ -141,6 +141,28 @@ "defaultValue": true } ], + "antrea": [ + { + "flag": "version", + "description": "The version of antrea to be installed.", + "type": "string" + }, + { + "flag": "isEncryptionDisabled", + "description": "Encrypt network communication between nodes in the cluster.", + "type": "boolean" + }, + { + "flag": "podCIDR", + "description": "The subnet used by Pods.", + "type": "string" + }, + { + "flag": "podCidrRange", + "description": "The size of the subnet used by Pods.", + "type": "string" + } + ], "contour": [ { "flag": "version", @@ -734,5 +756,18 @@ "description": "The version of Goldpinger to be installed.", "type": "string" } + ], + "aws": [ + { + "flag": "version", + "description": "The version of aws to be installed.", + "type": "string" + }, + { + "flag": "excludeStorageClass", + "description": "Exclude AWS-EBS provisioner storage class provided by the AWS add-on. When `true`, another storage provisioner, such as Longhorn, must be used.", + "type": "boolean", + "defaultValue": false + } ] }