Skip to content

Commit

Permalink
truly remove aws and antrea addons
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Sep 7, 2023
1 parent d91c4c1 commit 8f95d08
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 161 deletions.
89 changes: 5 additions & 84 deletions src/components/Kurlsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand All @@ -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
Expand All @@ -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);
Expand All @@ -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,
Expand All @@ -110,15 +105,13 @@ class Kurlsh extends React.Component {
certManager: certManagerVersions,
sonobuoy: sonobuoyVersions,
goldpinger: goldpingerVersions,
aws: awsVersions,
},
selectedVersions: NIL_VERSIONS,
installerSha: "",
showAdvancedOptions: {
"kubernetes": false,
"flannel": false,
"weave": false,
"antrea": false,
"contour": false,
"rook": false,
"prometheus": false,
Expand All @@ -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: {},
Expand All @@ -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,
Expand All @@ -184,7 +173,6 @@ class Kurlsh extends React.Component {
certManager: false,
sonobuoy: false,
goldpinger: false,
aws: false,
},
optionDefaults: {},
installerErrMsg: "",
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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") {
Expand Down Expand Up @@ -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 } }, () => {
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -1280,21 +1236,6 @@ class Kurlsh extends React.Component {
onToggleShowAdvancedOptions={() => this.onToggleShowAdvancedOptions("weave")}
renderAdvancedOptions={() => this.renderAdvancedOptions("weave")}
/>
<AddOnWrapper
addOnId="antrea"
addOnTitle="Antrea"
isDeprecated={true}
isAddOnChecked={isAddOnChecked["antrea"]}
options={versions.antrea}
getOptionLabel={this.getLabel("antrea")}
getOptionValue={(selected) => 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")}
/>
</div>

<div className="flex flex-column u-marginTop--40">
Expand Down Expand Up @@ -1554,26 +1495,6 @@ class Kurlsh extends React.Component {
renderAdvancedOptions={() => this.renderAdvancedOptions("velero")}
/>
</div>

<div className="flex flex-column u-marginTop--40">
<span className="u-fontSize--normal u-fontWeight--medium u-color--bermudaGray"> Cloud Provider </span>
<AddOnWrapper
addOnId="aws"
addOnTitle="AWS"
isDeprecated={true}
isAddOnChecked={isAddOnChecked["aws"]}
options={versions.aws}
getOptionLabel={this.getLabel("aws")}
getOptionValue={(selected) => 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")}
/>
</div>

</div>
</div>

Expand Down
5 changes: 0 additions & 5 deletions src/components/SupportedAddOns.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -171,9 +169,6 @@ class SupportedAddOns extends React.Component {
<div className="flex-column">
<span className="u-fontSize--largest u-fontWeight--medium u-color--tuna u-marginLeft--10">
{this.generateVersionName(addOn.name)}
{addOn.name === "aws" && (
<span className="prerelease-tag sidebar beta">beta</span>
)}
</span>
<div className="flex flex1 u-marginTop--small">
{addOn.fulfills.map((category, i) => {
Expand Down
2 changes: 0 additions & 2 deletions src/components/__tests__/kurlsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" ],
Expand Down
22 changes: 4 additions & 18 deletions src/components/modals/ConfirmSelectionModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } });
}
}

Expand Down Expand Up @@ -105,4 +91,4 @@ class ConfirmSelectionModal extends React.Component {
}
}

export default ConfirmSelectionModal;
export default ConfirmSelectionModal;
18 changes: 1 addition & 17 deletions src/scss/utilities/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -318,4 +302,4 @@
background-position: -270px -9px;
margin-left: 10px;
cursor: pointer;
}
}
35 changes: 0 additions & 35 deletions static/versionDetails.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 <a href=\"https://kurl.sh/docs/add-ons/longhorn\">Longhorn</a>, must be used.",
"type": "boolean",
"defaultValue": false
}
]
}

0 comments on commit 8f95d08

Please sign in to comment.