Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

truly remove aws and antrea addons from addon selection page #999

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ cat install.sh | sudo bash -s airgap
<AppVersionCard selectedSpec={selectedSpec} name={"flannel"} installerData={installerData.spec.flannel} whatYouGet={this.whatYouGet} />}
{installerData.spec.weave &&
<AppVersionCard selectedSpec={selectedSpec} name={"weave"} installerData={installerData.spec.weave} whatYouGet={this.whatYouGet} />}
{installerData.spec.antrea &&
<AppVersionCard selectedSpec={selectedSpec} name={"antrea"} installerData={installerData.spec.antrea} whatYouGet={this.whatYouGet} />}
{installerData.spec.contour &&
<AppVersionCard selectedSpec={selectedSpec} name={"contour"} installerData={installerData.spec.contour} whatYouGet={this.whatYouGet} />}
{installerData.spec.rook &&
Expand Down Expand Up @@ -304,7 +306,9 @@ cat install.sh | sudo bash -s airgap
{installerData.spec.sonobuoy &&
<AppVersionCard selectedSpec={selectedSpec} name={"sonobuoy"} installerData={installerData.spec.sonobuoy} whatYouGet={this.whatYouGet} />}
{installerData.spec.localPathProvisioner &&
<AppVersionCard selectedSpec={selectedSpec} name={"sonobuoy"} installerData={installerData.spec.localPathProvisioner} whatYouGet={this.whatYouGet} />}
<AppVersionCard selectedSpec={selectedSpec} name={"localPathProvisioner"} installerData={installerData.spec.localPathProvisioner} whatYouGet={this.whatYouGet} />}
{installerData.spec.aws &&
<AppVersionCard selectedSpec={selectedSpec} name={"aws"} installerData={installerData.spec.aws} whatYouGet={this.whatYouGet} />}
</div>
}
{installerData &&
Expand Down
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;
2 changes: 1 addition & 1 deletion src/scss/utilities/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,4 @@
background-position: -270px -9px;
margin-left: 10px;
cursor: pointer;
}
}