diff --git a/src/components/AppVersionCard.js b/src/components/AppVersionCard.js index ff1bb7dd..78e895a8 100644 --- a/src/components/AppVersionCard.js +++ b/src/components/AppVersionCard.js @@ -9,8 +9,6 @@ export default class AppVersionCard extends React.Component { return "KOTS"; } else if (name === "openebs") { return "OpenEBS"; - } else if (name === "longhorn") { - return "Longhorn"; } else if (name === "certManager") { return "Cert manager" } else if (name === "metricsServer") { diff --git a/src/components/Kurlsh.js b/src/components/Kurlsh.js index 94a04616..bdd0fe8b 100644 --- a/src/components/Kurlsh.js +++ b/src/components/Kurlsh.js @@ -21,10 +21,8 @@ import _ from "lodash"; const NIL_VERSIONS = { kubernetes: { version: "None" }, flannel: { version: "None" }, - weave: { version: "None" }, contour: { version: "None" }, rook: { version: "None" }, - docker: { version: "None" }, prometheus: { version: "None" }, registry: { version: "None" }, containerd: { version: "None" }, @@ -34,14 +32,13 @@ const NIL_VERSIONS = { fluentd: { version: "None" }, minio: { version: "None" }, openebs: { version: "None" }, - longhorn: { version: "None" }, collectd: { version: "None" }, metricsServer: { version: "None" }, certManager: { version: "None" }, sonobuoy: { version: "None" }, goldpinger: { version: "None" }, } -const hasAdvancedOptions = ["kubernetes", "flannel", "weave", "contour", "rook", "registry", "docker", "velero", "kotsadm", "ekco", "fluentd", "minio", "openebs", "longhorn", "prometheus"]; +const hasAdvancedOptions = ["kubernetes", "flannel", "contour", "rook", "registry", "velero", "kotsadm", "ekco", "fluentd", "minio", "openebs", "prometheus"]; function versionToState(version) { return { version @@ -51,7 +48,6 @@ function versionToState(version) { // replace problematic versions that do not sort because of semver pre-release const replaceVersions = { "rook": {"1.0.4": "1.0.4-0.0.0"}, - "weave": {"2.6.5": "2.6.5-0.0.0", "2.8.1": "2.8.1-0.0.0"}, "prometheus": {"0.46.0": "0.46.0-0.0.0"}, }; @@ -63,9 +59,7 @@ class Kurlsh extends React.Component { const kubernetesVersions = this.prepareVersions("kubernetes", supportedVersions.kubernetes); const contourVersions = this.prepareVersions("contour", supportedVersions.contour); const flannelVersions = this.prepareVersions("flannel", supportedVersions.flannel); - const weaveVersions = this.prepareVersions("weave", supportedVersions.weave); const rookVersions = this.prepareVersions("rook", supportedVersions.rook); - const dockerVersions = this.prepareVersions("docker", supportedVersions.docker); const prometheusVersions = this.prepareVersions("prometheus", supportedVersions.prometheus); const registryVersions = this.prepareVersions("registry", supportedVersions.registry); const containerdVersions = this.prepareVersions("containerd", supportedVersions.containerd); @@ -75,7 +69,6 @@ class Kurlsh extends React.Component { const fluentdVersions = this.prepareVersions("fluentd", supportedVersions.fluentd); const minioVersions = this.prepareVersions("minio", supportedVersions.minio); const openebsVersions = this.prepareVersions("openebs", supportedVersions.openebs); - const longhornVersions = this.prepareVersions("longhorn", supportedVersions.longhorn); const collectdVersions = this.prepareVersions("collectd", supportedVersions.collectd); const metricsServerVersions = this.prepareVersions("metrics-server", supportedVersions["metrics-server"]); const certManagerVersions = this.prepareVersions("cert-manager", supportedVersions["cert-manager"]); @@ -86,10 +79,8 @@ class Kurlsh extends React.Component { versions: { kubernetes: kubernetesVersions, flannel: flannelVersions, - weave: weaveVersions, contour: contourVersions, rook: rookVersions, - docker: dockerVersions, prometheus: prometheusVersions, registry: registryVersions, containerd: containerdVersions, @@ -99,7 +90,6 @@ class Kurlsh extends React.Component { fluentd: fluentdVersions, minio: minioVersions, openebs: openebsVersions, - longhorn: longhornVersions, collectd: collectdVersions, metricsServer: metricsServerVersions, certManager: certManagerVersions, @@ -111,19 +101,16 @@ class Kurlsh extends React.Component { showAdvancedOptions: { "kubernetes": false, "flannel": false, - "weave": false, "contour": false, "rook": false, "prometheus": false, "registry": false, - "docker": false, "velero": false, "kotsadm": false, "ekco": false, "fluentd": false, "minio": false, "openebs": false, - "longhorn": false, "metricsServer": false, "certManager": false, "sonobuoy": false, @@ -132,18 +119,15 @@ class Kurlsh extends React.Component { advancedOptions: { kubernetes: {}, flannel: {}, - weave: {}, contour: {}, rook: {}, registry: {}, - docker: {}, velero: {}, kotsadm: {}, ekco: {}, fluentd: {}, minio: {}, openebs: {}, - longhorn: {}, collectd: {}, metricsServer: {}, certManager: {}, @@ -154,10 +138,8 @@ class Kurlsh extends React.Component { isAddOnChecked: { kubernetes: false, flannel: false, - weave: false, contour: false, rook: false, - docker: false, prometheus: false, registry: false, containerd: false, @@ -167,7 +149,6 @@ class Kurlsh extends React.Component { fluentd: false, minio: false, openebs: false, - longhorn: false, collectd: false, metricsServer: false, certManager: false, @@ -399,21 +380,6 @@ class Kurlsh extends React.Component { } } - if (isAddOnChecked.weave) { - const diff = getDiff(optionDefaults["weave"], options.weave); - - generatedInstaller.spec.weave = { - version: selectedVersions.weave.version - }; - - if (Object.keys(diff).length) { - generatedInstaller.spec.weave = { - ...generatedInstaller.spec.weave, - ...diff - }; - } - } - if (isAddOnChecked.rook) { const diff = getDiff(optionDefaults["rook"], options.rook); generatedInstaller.spec.rook = { @@ -442,20 +408,6 @@ class Kurlsh extends React.Component { } } - if (isAddOnChecked.docker) { - const diff = getDiff(optionDefaults["docker"], options.docker); - generatedInstaller.spec.docker = { - version: selectedVersions.docker.version - }; - - if (Object.keys(diff).length) { - generatedInstaller.spec.docker = { - ...generatedInstaller.spec.docker, - ...diff - }; - } - } - if (isAddOnChecked.prometheus) { const diff = getDiff(optionDefaults["prometheus"], options.prometheus); generatedInstaller.spec.prometheus = { @@ -574,20 +526,6 @@ class Kurlsh extends React.Component { } } - if (isAddOnChecked.longhorn) { - const diff = getDiff(optionDefaults["longhorn"], options.longhorn); - generatedInstaller.spec.longhorn = { - version: selectedVersions.longhorn.version - }; - - if (Object.keys(diff).length) { - generatedInstaller.spec.longhorn = { - ...generatedInstaller.spec.longhorn, - ...diff - }; - } - } - if (isAddOnChecked.collectd) { const diff = getDiff(optionDefaults["collectd"], options.collectd); generatedInstaller.spec.collectd = { @@ -684,22 +622,12 @@ class Kurlsh extends React.Component { return; } } - if (name === "containerd" && value.version !== "None" && this.state.isAddOnChecked.docker) { - 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.checkIncompatibleSelection({ flannel: value }); - } else if (name === "weave" && value.version !== "None" && this.state.isAddOnChecked.flannel) { - this.checkIncompatibleSelection({ weave: value }); - } else { - this.setState({ selectedVersions: { ...this.state.selectedVersions, [name]: value } }, () => { - if (value.version === "None") { - this.setState({ isAddOnChecked: { ...this.state.isAddOnChecked, [name]: !this.state.isAddOnChecked[name] } }) - } - this.postToKurlInstaller(this.getYaml(this.state.installerSha)); - }) - } + this.setState({ selectedVersions: { ...this.state.selectedVersions, [name]: value } }, () => { + if (value.version === "None") { + this.setState({ isAddOnChecked: { ...this.state.isAddOnChecked, [name]: !this.state.isAddOnChecked[name] } }) + } + this.postToKurlInstaller(this.getYaml(this.state.installerSha)); + }) } handleIsAddOnSelected = (name, e) => { @@ -743,19 +671,10 @@ class Kurlsh extends React.Component { selectedVersion = this.state.versions[name][1].version; } - if (name === "containerd" && this.state.isAddOnChecked.docker) { - 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.checkIncompatibleSelection({ flannel: { version: selectedVersion } }); - } else if (name === "weave" && this.state.isAddOnChecked.flannel) { - this.checkIncompatibleSelection({ weave: { version: selectedVersion } }); - } else { - this.setState({ selectedVersions: { ...nextSelectedVersions, [name]: { version: selectedVersion } } }, () => { - this.postToKurlInstaller(this.getYaml(this.state.installerSha)); - }); - } + this.setState({ selectedVersions: { ...nextSelectedVersions, [name]: { version: selectedVersion } } }, () => { + this.postToKurlInstaller(this.getYaml(this.state.installerSha)); + }); + } else { this.setState({ selectedVersions: { ...this.state.selectedVersions, [name]: { version: "None" } } }, () => { this.postToKurlInstaller(this.getYaml(this.state.installerSha)); @@ -1174,21 +1093,6 @@ class Kurlsh extends React.Component {
CRI - selected} - value={selectedVersions.docker} - onVersionChange={this.onVersionChange("docker")} - handleIsAddOnSelected={(e) => this.handleIsAddOnSelected("docker", e)} - showAdvancedOptions={showAdvancedOptions["docker"]} - onToggleShowAdvancedOptions={() => this.onToggleShowAdvancedOptions("docker")} - renderAdvancedOptions={() => this.renderAdvancedOptions("docker")} - /> this.onToggleShowAdvancedOptions("flannel")} renderAdvancedOptions={() => this.renderAdvancedOptions("flannel")} /> } - selected} - value={selectedVersions.weave} - onVersionChange={this.onVersionChange("weave")} - handleIsAddOnSelected={(e) => this.handleIsAddOnSelected("weave", e)} - showAdvancedOptions={showAdvancedOptions["weave"]} - onToggleShowAdvancedOptions={() => this.onToggleShowAdvancedOptions("weave")} - renderAdvancedOptions={() => this.renderAdvancedOptions("weave")} - />
@@ -1357,21 +1246,6 @@ class Kurlsh extends React.Component {
PVC Provisioner - selected} - value={selectedVersions.longhorn} - onVersionChange={this.onVersionChange("longhorn")} - handleIsAddOnSelected={(e) => this.handleIsAddOnSelected("longhorn", e)} - showAdvancedOptions={showAdvancedOptions["longhorn"]} - onToggleShowAdvancedOptions={() => this.onToggleShowAdvancedOptions("longhorn")} - renderAdvancedOptions={() => this.renderAdvancedOptions("longhorn")} - /> { const finalVersions = new Kurl(defaultProps).prepareVersions("rook", versions); expect(finalVersions).toEqual([{version: "1.9.x"}, {version: "1.9.12"}, {version: "1.8.x"}, {version: "1.8.10"}, {version: "1.4.x"}, {version: "1.4.9"}, {version: "1.4.3"}, {version: "1.0.x"}, {version: "1.0.4-14.2.21"}, {version: "latest"}, {version: "1.0.4"}, {version: "None"}]); }); - - it("weave: sorts and adds dot x versions", () => { - const versions = ["latest", "2.6.5-20221025", "2.6.5-20221006", "2.6.5-20220825", "2.6.5-20220720", "2.6.5-20220616", "2.6.5", "2.6.4", "2.5.2", "2.8.1-20221025", "2.8.1-20221006", "2.8.1-20220825", "2.8.1-20220720", "2.8.1-20220616", "2.8.1", "2.7.0"]; - const finalVersions = new Kurl(defaultProps).prepareVersions("weave", versions); - expect(finalVersions).toEqual([{version: "2.8.x"}, {version: "2.8.1-20221025"}, {version: "2.8.1-20221006"}, {version: "2.8.1-20220825"}, {version: "2.8.1-20220720"}, {version: "2.8.1-20220616"}, {version: "2.8.1"}, {version: "2.7.x"}, {version: "2.7.0"}, {version: "2.6.x"}, {version: "latest"}, {version: "2.6.5-20221025"}, {version: "2.6.5-20221006"}, {version: "2.6.5-20220825"}, {version: "2.6.5-20220720"}, {version: "2.6.5-20220616"}, {version: "2.6.5"}, {version: "2.6.4"}, {version: "2.5.x"}, {version: "2.5.2"}, {version: "None"}]); - }); }); describe("addOnDataFromInput", () => { diff --git a/src/components/modals/ConfirmSelectionModal.js b/src/components/modals/ConfirmSelectionModal.js index 52f7f427..1399063c 100644 --- a/src/components/modals/ConfirmSelectionModal.js +++ b/src/components/modals/ConfirmSelectionModal.js @@ -12,26 +12,6 @@ class ConfirmSelectionModal extends React.Component { addOnToRemove: {} } - incompatibleAddOnsSelection = () => { - const { currentSelection, selectedVersions } = this.props; - const current = Object.keys(currentSelection)[0]; - - if (current === "containerd") { - this.setState({ addOnToRemove: { docker: selectedVersions.docker } }); - return; - } else if (current === "docker") { - this.setState({ addOnToRemove: { containerd: selectedVersions.containerd } }); - } else if (current === "flannel") { - this.setState({ addOnToRemove: { weave: selectedVersions.weave } }); - } else if (current === "weave") { - this.setState({ addOnToRemove: { flannel: selectedVersions.flannel } }); - } - } - - componentDidMount() { - this.incompatibleAddOnsSelection(); - } - handleConfirmSelection = (currentSelection, addOnToRemove) => { this.props.onConfirmSelection(currentSelection, addOnToRemove) } diff --git a/src/utils/__tests__/kurl-yaml.js b/src/utils/__tests__/kurl-yaml.js index 5d1cf4c1..19fc6113 100644 --- a/src/utils/__tests__/kurl-yaml.js +++ b/src/utils/__tests__/kurl-yaml.js @@ -10,8 +10,8 @@ metadata: spec: kubernetes: version: 1.24.x - weave: - version: 2.6.x + flannel: + version: 0.23.x contour: version: 1.22.x registry: @@ -36,8 +36,8 @@ metadata: spec: kubernetes: version: 1.24.x - weave: - version: 2.6.x + flannel: + version: 0.23.x contour: version: 1.22.x registry: @@ -76,8 +76,8 @@ metadata: spec: kubernetes: version: 1.24.x - weave: - version: 2.6.x + flannel: + version: 0.23.x contour: version: 1.22.x registry: