Skip to content

Commit

Permalink
chore: remove deprecated docker, weave, and longhorn add-ons (#1006)
Browse files Browse the repository at this point in the history
* chore: remove deprecated docker, weave, and longhorn add-ons

remove docker, weave, and longhorn from kurl.sh.

* chore: restore app.js
  • Loading branch information
ricardomaraschini authored Nov 3, 2023
1 parent 5afe177 commit d6901ca
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 174 deletions.
2 changes: 0 additions & 2 deletions src/components/AppVersionCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
148 changes: 11 additions & 137 deletions src/components/Kurlsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand All @@ -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
Expand All @@ -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"},
};

Expand All @@ -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);
Expand All @@ -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"]);
Expand All @@ -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,
Expand All @@ -99,7 +90,6 @@ class Kurlsh extends React.Component {
fluentd: fluentdVersions,
minio: minioVersions,
openebs: openebsVersions,
longhorn: longhornVersions,
collectd: collectdVersions,
metricsServer: metricsServerVersions,
certManager: certManagerVersions,
Expand All @@ -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,
Expand All @@ -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: {},
Expand All @@ -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,
Expand All @@ -167,7 +149,6 @@ class Kurlsh extends React.Component {
fluentd: false,
minio: false,
openebs: false,
longhorn: false,
collectd: false,
metricsServer: false,
certManager: false,
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -1174,21 +1093,6 @@ class Kurlsh extends React.Component {
</div>
<div className="flex flex-column u-marginTop--40">
<span className="u-fontSize--normal u-fontWeight--medium u-color--bermudaGray"> CRI </span>
<AddOnWrapper
addOnId="docker"
addOnTitle="Docker"
isDeprecated={true}
isAddOnChecked={isAddOnChecked["docker"]}
options={versions.docker}
getOptionLabel={this.getLabel("docker")}
getOptionValue={(selected) => 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")}
/>
<AddOnWrapper
addOnId="containerd"
addOnTitle="Containerd"
Expand Down Expand Up @@ -1221,21 +1125,6 @@ class Kurlsh extends React.Component {
onToggleShowAdvancedOptions={() => this.onToggleShowAdvancedOptions("flannel")}
renderAdvancedOptions={() => this.renderAdvancedOptions("flannel")}
/> }
<AddOnWrapper
addOnId="weave"
addOnTitle="Weave"
isDeprecated={true}
isAddOnChecked={isAddOnChecked["weave"]}
options={versions.weave}
getOptionLabel={this.getLabel("weave")}
getOptionValue={(selected) => 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")}
/>
</div>

<div className="flex flex-column u-marginTop--40">
Expand Down Expand Up @@ -1357,21 +1246,6 @@ class Kurlsh extends React.Component {

<div className="flex flex-column u-marginTop--40">
<span className="u-fontSize--normal u-fontWeight--medium u-color--bermudaGray"> PVC Provisioner </span>
<AddOnWrapper
addOnId="longhorn"
addOnTitle="Longhorn"
isDeprecated={true}
isAddOnChecked={isAddOnChecked["longhorn"]}
options={versions.longhorn}
getOptionLabel={this.getLabel("longhorn")}
getOptionValue={(selected) => 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")}
/>
<AddOnWrapper
addOnId="openebs"
addOnTitle="OpenEBS"
Expand Down
9 changes: 0 additions & 9 deletions src/components/__tests__/kurlsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const defaultProps = {
"fluentd": [ "latest", "1.7.4" ],
"goldpinger": [ "latest", "3.5.1-5.2.0", "3.3.0-5.1.0", "3.2.0-5.0.0" ],
"kotsadm": [ "latest", "1.85.0", "1.84.0", "1.83.0", "1.82.0" ],
"longhorn": [ "latest", "1.3.1", "1.2.4", "1.2.2" ],
"metrics-server": [ "latest", "0.4.1", "0.3.7" ],
"cert-manager": [ "latest", "1.9.1", "1.0.3" ],
"minio": [ "latest", "2022-09-17T00-09-45Z", "2022-09-07T22-25-02Z", "2022-09-01T23-53-36Z" ],
Expand All @@ -24,8 +23,6 @@ const defaultProps = {
"rookupgrade": [ "latest", "10to14" ],
"sonobuoy": [ "latest", "0.56.10", "0.56.8", "0.56.7", "0.55.1" ],
"velero": [ "latest", "1.9.1", "1.9.0", "1.8.1", "1.7.1" ],
"weave": [ "latest", "2.6.5-20220825", "2.6.5-20220720", "2.6.5-20220616" ],
"docker": [ "latest", "20.10.17", "20.10.5", "19.03.15" ],
"certManager": [ "latest", "1.9.1", "1.0.3" ],
"metricsServer": [ "latest", "0.4.1", "0.3.7" ]
}
Expand Down Expand Up @@ -197,12 +194,6 @@ describe("Kurl", () => {
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", () => {
Expand Down
20 changes: 0 additions & 20 deletions src/components/modals/ConfirmSelectionModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Loading

2 comments on commit d6901ca

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸŽ‰ Published on https://kurlsh.netlify.app as production
πŸš€ Deployed on https://654a62fc9b86fc0073d417c7--kurlsh.netlify.app

Please sign in to comment.