From 5640cce4d6b2f2f6a36ebc28fa9d71c164524efa Mon Sep 17 00:00:00 2001 From: Ali <83188384+testA113@users.noreply.github.com> Date: Thu, 26 Jan 2023 16:03:44 +1300 Subject: [PATCH] chore(kompose): remove from settings [EE-4741] (#8375) --- ...ack-deployment-type-selector.controller.js | 23 -------- .../edge-stack-deployment-type-selector.html | 2 - .../index.js | 15 ----- .../editEdgeStackForm.html | 39 +++++++----- .../editEdgeStackFormController.js | 19 ++++-- app/edge/react/components/index.ts | 10 ++++ .../create-edge-stack-view.controller.js | 24 +++++--- .../create-edge-stack-view.html | 17 ++---- .../editEdgeStackViewController.js | 6 +- app/kubernetes/models/deploy.js | 1 - .../create/createApplication.html | 59 +++++++++++-------- .../views/applications/edit/application.html | 2 +- .../edit/applicationController.js | 3 + app/kubernetes/views/deploy/deploy.html | 15 +---- .../views/deploy/deployController.js | 13 +--- app/portainer/models/settings.js | 2 - app/portainer/views/settings/settings.html | 10 ---- .../views/settings/settingsController.js | 45 +------------- .../components/BoxSelector/BoxOption.tsx | 18 +++--- .../EdgeStackDeploymentTypeSelector.tsx | 55 +++++++++++++++++ app/react/edge/edge-stacks/utils.test.ts | 40 +++++++++++++ app/react/edge/edge-stacks/utils.ts | 16 +++++ app/react/portainer/settings/types.ts | 2 - build/download_kompose_binary.sh | 24 -------- gruntfile.js | 15 ----- 25 files changed, 237 insertions(+), 238 deletions(-) delete mode 100644 app/edge/components/edge-stack-deployment-type-selector/edge-stack-deployment-type-selector.controller.js delete mode 100644 app/edge/components/edge-stack-deployment-type-selector/edge-stack-deployment-type-selector.html delete mode 100644 app/edge/components/edge-stack-deployment-type-selector/index.js create mode 100644 app/react/edge/edge-stacks/components/EdgeStackDeploymentTypeSelector.tsx create mode 100644 app/react/edge/edge-stacks/utils.test.ts create mode 100644 app/react/edge/edge-stacks/utils.ts delete mode 100755 build/download_kompose_binary.sh diff --git a/app/edge/components/edge-stack-deployment-type-selector/edge-stack-deployment-type-selector.controller.js b/app/edge/components/edge-stack-deployment-type-selector/edge-stack-deployment-type-selector.controller.js deleted file mode 100644 index d28847ae9..000000000 --- a/app/edge/components/edge-stack-deployment-type-selector/edge-stack-deployment-type-selector.controller.js +++ /dev/null @@ -1,23 +0,0 @@ -import { compose, kubernetes } from '@@/BoxSelector/common-options/deployment-methods'; - -export default class EdgeStackDeploymentTypeSelectorController { - /* @ngInject */ - constructor() { - this.deploymentOptions = [ - { - ...compose, - value: 0, - }, - { - ...kubernetes, - value: 1, - disabled: () => { - return this.hasDockerEndpoint(); - }, - tooltip: () => { - return this.hasDockerEndpoint() ? 'Cannot use this option with Edge Docker endpoints' : ''; - }, - }, - ]; - } -} diff --git a/app/edge/components/edge-stack-deployment-type-selector/edge-stack-deployment-type-selector.html b/app/edge/components/edge-stack-deployment-type-selector/edge-stack-deployment-type-selector.html deleted file mode 100644 index 94947dd3d..000000000 --- a/app/edge/components/edge-stack-deployment-type-selector/edge-stack-deployment-type-selector.html +++ /dev/null @@ -1,2 +0,0 @@ -
Deployment type
- diff --git a/app/edge/components/edge-stack-deployment-type-selector/index.js b/app/edge/components/edge-stack-deployment-type-selector/index.js deleted file mode 100644 index c175249fd..000000000 --- a/app/edge/components/edge-stack-deployment-type-selector/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import angular from 'angular'; -import controller from './edge-stack-deployment-type-selector.controller.js'; - -export const edgeStackDeploymentTypeSelector = { - templateUrl: './edge-stack-deployment-type-selector.html', - controller, - - bindings: { - value: '<', - onChange: '<', - hasDockerEndpoint: '<', - }, -}; - -angular.module('portainer.edge').component('edgeStackDeploymentTypeSelector', edgeStackDeploymentTypeSelector); diff --git a/app/edge/components/edit-edge-stack-form/editEdgeStackForm.html b/app/edge/components/edit-edge-stack-form/editEdgeStackForm.html index ab6d53ec6..8a47776f7 100644 --- a/app/edge/components/edit-edge-stack-form/editEdgeStackForm.html +++ b/app/edge/components/edit-edge-stack-form/editEdgeStackForm.html @@ -4,30 +4,36 @@
- -
-
-
- - One or more of the selected Edge group contains Edge Docker endpoints that cannot be used with a Kubernetes Edge stack. -
-
+

+ There are no available deployment types when there is more than one type of environment in your edge group + selection (e.g. Kubernetes and Docker environments). Please select edge groups that have environments of the same type. +

-
-
-
- - Portainer uses Kompose to convert your Compose manifest to a Kubernetes compliant manifest. Be wary that not all the - Compose format options are supported by Kompose at the moment. -
+
+ +
+

+ Portainer no longer supports docker-compose format manifests for Kubernetes deployments, and we + have removed the Kompose conversion tool which enables this. The reason for this is because Kompose now poses a security + risk, since it has a number of Common Vulnerabilities and Exposures (CVEs). +

+

Unfortunately, while the Kompose project has a maintainer and is part of the CNCF, it is not being actively maintained. Releases are very infrequent and new pull requests + to the project (including ones we've submitted) are taking months to be merged, with new CVEs arising in the meantime.

+

+ We advise installing your own instance of Kompose in a sandbox environment, performing conversions of your Docker Compose files to Kubernetes manifests and using those + manifests to set up applications. +

@@ -38,6 +44,7 @@ identifier="compose-editor" placeholder="# Define or paste the content of your docker compose file here" on-change="($ctrl.onChangeComposeConfig)" + read-only="$ctrl.hasKubeEndpoint()" >
diff --git a/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js b/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js index 3947e5d98..e5fdd469f 100644 --- a/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js +++ b/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js @@ -1,6 +1,6 @@ import { PortainerEndpointTypes } from '@/portainer/models/endpoint/models'; import { EditorType } from '@/react/edge/edge-stacks/types'; - +import { getValidEditorTypes } from '@/react/edge/edge-stacks/utils'; export class EditEdgeStackFormController { /* @ngInject */ constructor($scope) { @@ -57,6 +57,15 @@ export class EditEdgeStackFormController { checkEndpointTypes(groups) { const edgeGroups = groups.map((id) => this.edgeGroups.find((e) => e.Id === id)); this.state.endpointTypes = edgeGroups.flatMap((group) => group.EndpointTypes); + this.selectValidDeploymentType(); + } + + selectValidDeploymentType() { + const validTypes = getValidEditorTypes(this.state.endpointTypes); + + if (!validTypes.includes(this.model.DeploymentType)) { + this.onChangeDeploymentType(validTypes[0]); + } } removeLineBreaks(value) { @@ -81,9 +90,10 @@ export class EditEdgeStackFormController { } onChangeDeploymentType(deploymentType) { - this.model.DeploymentType = deploymentType; - - this.model.StackFileContent = this.fileContents[deploymentType]; + return this.$scope.$evalAsync(() => { + this.model.DeploymentType = deploymentType; + this.model.StackFileContent = this.fileContents[deploymentType]; + }); } validateEndpointsForDeployment() { @@ -92,5 +102,6 @@ export class EditEdgeStackFormController { $onInit() { this.checkEndpointTypes(this.model.EdgeGroups); + this.fileContents[this.model.DeploymentType] = this.model.StackFileContent; } } diff --git a/app/edge/react/components/index.ts b/app/edge/react/components/index.ts index 4e8ad5d49..4d2e09586 100644 --- a/app/edge/react/components/index.ts +++ b/app/edge/react/components/index.ts @@ -6,6 +6,7 @@ import { withReactQuery } from '@/react-tools/withReactQuery'; import { EdgeCheckinIntervalField } from '@/react/edge/components/EdgeCheckInIntervalField'; import { EdgeScriptForm } from '@/react/edge/components/EdgeScriptForm'; import { EdgeAsyncIntervalsForm } from '@/react/edge/components/EdgeAsyncIntervalsForm'; +import { EdgeStackDeploymentTypeSelector } from '@/react/edge/edge-stacks/components/EdgeStackDeploymentTypeSelector'; export const componentsModule = angular .module('portainer.edge.react.components', []) @@ -43,4 +44,13 @@ export const componentsModule = angular 'readonly', 'fieldSettings', ]) + ) + .component( + 'edgeStackDeploymentTypeSelector', + r2a(withReactQuery(EdgeStackDeploymentTypeSelector), [ + 'value', + 'onChange', + 'hasDockerEndpoint', + 'hasKubeEndpoint', + ]) ).name; diff --git a/app/edge/views/edge-stacks/createEdgeStackView/create-edge-stack-view.controller.js b/app/edge/views/edge-stacks/createEdgeStackView/create-edge-stack-view.controller.js index 9e0c81df2..e47d0d290 100644 --- a/app/edge/views/edge-stacks/createEdgeStackView/create-edge-stack-view.controller.js +++ b/app/edge/views/edge-stacks/createEdgeStackView/create-edge-stack-view.controller.js @@ -1,4 +1,6 @@ import { EditorType } from '@/react/edge/edge-stacks/types'; +import { PortainerEndpointTypes } from '@/portainer/models/endpoint/models'; +import { getValidEditorTypes } from '@/react/edge/edge-stacks/utils'; export default class CreateEdgeStackViewController { /* @ngInject */ @@ -43,6 +45,7 @@ export default class CreateEdgeStackViewController { this.createStackFromGitRepository = this.createStackFromGitRepository.bind(this); this.onChangeGroups = this.onChangeGroups.bind(this); this.hasDockerEndpoint = this.hasDockerEndpoint.bind(this); + this.hasKubeEndpoint = this.hasKubeEndpoint.bind(this); this.onChangeDeploymentType = this.onChangeDeploymentType.bind(this); } @@ -134,18 +137,23 @@ export default class CreateEdgeStackViewController { checkIfEndpointTypes(groups) { const edgeGroups = groups.map((id) => this.edgeGroups.find((e) => e.Id === id)); this.state.endpointTypes = edgeGroups.flatMap((group) => group.EndpointTypes); + this.selectValidDeploymentType(); + } - if (this.hasDockerEndpoint() && this.formValues.DeploymentType == 1) { - this.onChangeDeploymentType(0); + selectValidDeploymentType() { + const validTypes = getValidEditorTypes(this.state.endpointTypes); + + if (!validTypes.includes(this.formValues.DeploymentType)) { + this.onChangeDeploymentType(validTypes[0]); } } hasKubeEndpoint() { - return this.state.endpointTypes.includes(7); + return this.state.endpointTypes.includes(PortainerEndpointTypes.EdgeAgentOnKubernetesEnvironment); } hasDockerEndpoint() { - return this.state.endpointTypes.includes(4); + return this.state.endpointTypes.includes(PortainerEndpointTypes.EdgeAgentOnDockerEnvironment); } validateForm(method) { @@ -217,9 +225,11 @@ export default class CreateEdgeStackViewController { } onChangeDeploymentType(deploymentType) { - this.formValues.DeploymentType = deploymentType; - this.state.Method = 'editor'; - this.formValues.StackFileContent = ''; + return this.$scope.$evalAsync(() => { + this.formValues.DeploymentType = deploymentType; + this.state.Method = 'editor'; + this.formValues.StackFileContent = ''; + }); } formIsInvalid() { diff --git a/app/edge/views/edge-stacks/createEdgeStackView/create-edge-stack-view.html b/app/edge/views/edge-stacks/createEdgeStackView/create-edge-stack-view.html index bed1a1306..96c86d0d9 100644 --- a/app/edge/views/edge-stacks/createEdgeStackView/create-edge-stack-view.html +++ b/app/edge/views/edge-stacks/createEdgeStackView/create-edge-stack-view.html @@ -39,24 +39,19 @@
No Edge groups are available. Head over to the Edge groups view to create one.
+

+ There are no available deployment types when there is more than one type of environment in your edge + group selection (e.g. Kubernetes and Docker environments). Please select edge groups that have environments of the same type. +

-
-
-
- - Portainer uses Kompose to convert your Compose manifest to a Kubernetes compliant manifest. Be wary that not all - the Compose format options are supported by Kompose at the moment. -
-
-
- + +
@@ -88,6 +99,7 @@ - -

- - - Portainer uses Kompose to convert your Compose manifest to a Kubernetes compliant manifest. Be wary that - not all the Compose format options are supported by Kompose at the moment. - -

-

- You can get more information about Compose file format in the - official documentation. -

-

In a forthcoming Portainer release, we plan to remove support for docker-compose format manifests for Kubernetes deployments, and the Kompose conversion tool - which enables this. The reason for this is because Kompose now poses a security risk, since it has a number of Common Vulnerabilities and Exposures (CVEs).

-

Unfortunately, while the Kompose project has a maintainer and is part of the CNCF, it is not being actively maintained. Releases are very infrequent and new - pull requests to the project (including ones we've submitted) are taking months to be merged, with new CVEs arising in the meantime.

-
+
+ +
+

+ Portainer no longer supports docker-compose format manifests for Kubernetes + deployments, and we have removed the Kompose conversion tool which enables this. The reason for this is + because Kompose now poses a security risk, since it has a number of Common Vulnerabilities and Exposures (CVEs). +

+

Unfortunately, while the Kompose project has a maintainer and is part of the CNCF, it is not being actively maintained. Releases are very infrequent and + new pull requests to the project (including ones we've submitted) are taking months to be merged, with new CVEs arising in the meantime.

+

+ We advise installing your own instance of Kompose in a sandbox environment, performing conversions of your Docker Compose files to Kubernetes manifests and + using those manifests to set up applications. +

+
+

@@ -1345,9 +1354,9 @@ -

Actions
+
Actions
-
+
-
- -
diff --git a/app/portainer/views/settings/settingsController.js b/app/portainer/views/settings/settingsController.js index 3db3eca34..91cb02d02 100644 --- a/app/portainer/views/settings/settingsController.js +++ b/app/portainer/views/settings/settingsController.js @@ -1,14 +1,10 @@ import angular from 'angular'; import { FeatureId } from '@/react/portainer/feature-flags/enums'; -// import trackEvent directly because the event only fires once with $analytics.trackEvent -import { trackEvent } from '@/angulartics.matomo/analytics-services'; import { options } from './options'; angular.module('portainer.app').controller('SettingsController', [ '$scope', - '$analytics', - '$state', 'Notifications', 'SettingsService', 'ModalService', @@ -16,7 +12,7 @@ angular.module('portainer.app').controller('SettingsController', [ 'BackupService', 'FileSaver', 'Blob', - function ($scope, $analytics, $state, Notifications, SettingsService, ModalService, StateManager, BackupService, FileSaver) { + function ($scope, Notifications, SettingsService, ModalService, StateManager, BackupService, FileSaver) { $scope.customBannerFeatureId = FeatureId.CUSTOM_LOGIN_BANNER; $scope.s3BackupFeatureId = FeatureId.S3_BACKUP_SETTING; $scope.enforceDeploymentOptions = FeatureId.ENFORCE_DEPLOYMENT_OPTIONS; @@ -57,7 +53,6 @@ angular.module('portainer.app').controller('SettingsController', [ $scope.formValues = { customLogo: false, - ShowKomposeBuildOption: false, KubeconfigExpiry: undefined, HelmRepositoryURL: undefined, BlackListedLabels: [], @@ -83,33 +78,6 @@ angular.module('portainer.app').controller('SettingsController', [ }); }; - $scope.onToggleShowKompose = async function onToggleShowKompose(checked) { - if (checked) { - ModalService.confirmWarn({ - title: 'Are you sure?', - message: `

In a forthcoming Portainer release, we plan to remove support for docker-compose format manifests for Kubernetes deployments, and the Kompose conversion tool which enables this. The reason for this is because Kompose now poses a security risk, since it has a number of Common Vulnerabilities and Exposures (CVEs).

-

Unfortunately, while the Kompose project has a maintainer and is part of the CNCF, it is not being actively maintained. Releases are very infrequent and new pull requests to the project (including ones we've submitted) are taking months to be merged, with new CVEs arising in the meantime.

`, - buttons: { - confirm: { - label: 'Ok', - className: 'btn-warning', - }, - }, - callback: function (confirmed) { - $scope.setShowCompose(confirmed); - }, - }); - return; - } - $scope.setShowCompose(checked); - }; - - $scope.setShowCompose = function setShowCompose(checked) { - return $scope.$evalAsync(() => { - $scope.formValues.ShowKomposeBuildOption = checked; - }); - }; - $scope.onToggleAutoBackups = function onToggleAutoBackups(checked) { $scope.$evalAsync(() => { $scope.formValues.scheduleAutomaticBackups = checked; @@ -187,13 +155,8 @@ angular.module('portainer.app').controller('SettingsController', [ KubeconfigExpiry: $scope.formValues.KubeconfigExpiry, HelmRepositoryURL: $scope.formValues.HelmRepositoryURL, GlobalDeploymentOptions: $scope.formValues.GlobalDeploymentOptions, - ShowKomposeBuildOption: $scope.formValues.ShowKomposeBuildOption, }; - if (kubeSettingsPayload.ShowKomposeBuildOption !== $scope.initialFormValues.ShowKomposeBuildOption && $scope.initialFormValues.enableTelemetry) { - trackEvent('kubernetes-allow-compose', { category: 'kubernetes', metadata: { 'kubernetes-allow-compose': kubeSettingsPayload.ShowKomposeBuildOption } }); - } - $scope.state.kubeSettingsActionInProgress = true; updateSettings(kubeSettingsPayload, 'Kubernetes settings updated'); }; @@ -205,7 +168,6 @@ angular.module('portainer.app').controller('SettingsController', [ StateManager.updateLogo(settings.LogoURL); StateManager.updateSnapshotInterval(settings.SnapshotInterval); StateManager.updateEnableTelemetry(settings.EnableTelemetry); - $scope.initialFormValues.ShowKomposeBuildOption = response.ShowKomposeBuildOption; $scope.initialFormValues.enableTelemetry = response.EnableTelemetry; $scope.formValues.BlackListedLabels = response.BlackListedLabels; }) @@ -235,11 +197,6 @@ angular.module('portainer.app').controller('SettingsController', [ $scope.formValues.KubeconfigExpiry = settings.KubeconfigExpiry; $scope.formValues.HelmRepositoryURL = settings.HelmRepositoryURL; $scope.formValues.BlackListedLabels = settings.BlackListedLabels; - if (settings.ShowKomposeBuildOption) { - $scope.formValues.ShowKomposeBuildOption = settings.ShowKomposeBuildOption; - } - - $scope.initialFormValues.ShowKomposeBuildOption = settings.ShowKomposeBuildOption; $scope.initialFormValues.enableTelemetry = settings.EnableTelemetry; }) .catch(function error(err) { diff --git a/app/react/components/BoxSelector/BoxOption.tsx b/app/react/components/BoxSelector/BoxOption.tsx index 0d7d7efc4..2abc23286 100644 --- a/app/react/components/BoxSelector/BoxOption.tsx +++ b/app/react/components/BoxSelector/BoxOption.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; import { PropsWithChildren } from 'react'; -import { Tooltip } from '@@/Tip/Tooltip'; +import { TooltipWithChildren } from '@@/Tip/TooltipWithChildren'; import './BoxSelectorItem.css'; @@ -29,7 +29,7 @@ export function BoxOption({ type = 'radio', children, }: PropsWithChildren>) { - return ( + const BoxOption = (
({ - {tooltip && ( - - )}
); + + if (tooltip) { + return ( + {BoxOption} + ); + } + return BoxOption; } diff --git a/app/react/edge/edge-stacks/components/EdgeStackDeploymentTypeSelector.tsx b/app/react/edge/edge-stacks/components/EdgeStackDeploymentTypeSelector.tsx new file mode 100644 index 000000000..da739f177 --- /dev/null +++ b/app/react/edge/edge-stacks/components/EdgeStackDeploymentTypeSelector.tsx @@ -0,0 +1,55 @@ +import { EditorType } from '@/react/edge/edge-stacks/types'; + +import { BoxSelector } from '@@/BoxSelector'; +import { BoxSelectorOption } from '@@/BoxSelector/types'; +import { + compose, + kubernetes, +} from '@@/BoxSelector/common-options/deployment-methods'; + +interface Props { + value: number; + onChange(value: number): void; + hasDockerEndpoint: boolean; + hasKubeEndpoint: boolean; +} + +export function EdgeStackDeploymentTypeSelector({ + value, + onChange, + hasDockerEndpoint, + hasKubeEndpoint, +}: Props) { + const deploymentOptions: BoxSelectorOption[] = [ + { + ...compose, + value: EditorType.Compose, + disabled: () => hasKubeEndpoint, + tooltip: () => + hasKubeEndpoint + ? 'Cannot use this option with Edge Kubernetes environments' + : '', + }, + { + ...kubernetes, + value: EditorType.Kubernetes, + disabled: () => hasDockerEndpoint, + tooltip: () => + hasDockerEndpoint + ? 'Cannot use this option with Edge Docker environments' + : '', + }, + ]; + + return ( + <> +
Deployment type
+ + + ); +} diff --git a/app/react/edge/edge-stacks/utils.test.ts b/app/react/edge/edge-stacks/utils.test.ts new file mode 100644 index 000000000..c2bfe657d --- /dev/null +++ b/app/react/edge/edge-stacks/utils.test.ts @@ -0,0 +1,40 @@ +import { EnvironmentType } from '@/react/portainer/environments/types'; + +import { EditorType } from './types'; +import { getValidEditorTypes } from './utils'; + +interface GetValidEditorTypesTest { + endpointTypes: EnvironmentType[]; + expected: EditorType[]; + title: string; +} + +describe('getValidEditorTypes', () => { + const tests: GetValidEditorTypesTest[] = [ + { + endpointTypes: [EnvironmentType.EdgeAgentOnDocker], + expected: [EditorType.Compose], + title: 'should return compose for docker envs', + }, + { + endpointTypes: [EnvironmentType.EdgeAgentOnKubernetes], + expected: [EditorType.Kubernetes], + title: 'should return kubernetes for kubernetes envs', + }, + { + endpointTypes: [ + EnvironmentType.EdgeAgentOnDocker, + EnvironmentType.EdgeAgentOnKubernetes, + ], + expected: [], + title: 'should return empty for docker and kubernetes envs', + }, + ]; + + tests.forEach((test) => { + // eslint-disable-next-line jest/valid-title + it(test.title, () => { + expect(getValidEditorTypes(test.endpointTypes)).toEqual(test.expected); + }); + }); +}); diff --git a/app/react/edge/edge-stacks/utils.ts b/app/react/edge/edge-stacks/utils.ts new file mode 100644 index 000000000..4dbb48345 --- /dev/null +++ b/app/react/edge/edge-stacks/utils.ts @@ -0,0 +1,16 @@ +import _ from 'lodash'; + +import { EnvironmentType } from '@/react/portainer/environments/types'; + +import { EditorType } from './types'; + +export function getValidEditorTypes(endpointTypes: EnvironmentType[]) { + const right: Partial> = { + [EnvironmentType.EdgeAgentOnDocker]: [EditorType.Compose], + [EnvironmentType.EdgeAgentOnKubernetes]: [EditorType.Kubernetes], + }; + + return endpointTypes.length + ? _.intersection(...endpointTypes.map((type) => right[type])) + : [EditorType.Compose, EditorType.Kubernetes]; +} diff --git a/app/react/portainer/settings/types.ts b/app/react/portainer/settings/types.ts index 2fcffa6dc..5e77f990f 100644 --- a/app/react/portainer/settings/types.ts +++ b/app/react/portainer/settings/types.ts @@ -160,8 +160,6 @@ export interface PublicSettingsResponse { RequiredPasswordLength: number; /** Deployment options for encouraging deployment as code (only on BE) */ GlobalDeploymentOptions: GlobalDeploymentOptions; - /** Show the Kompose build option (discontinued in 2.18) */ - ShowKomposeBuildOption: boolean; /** Whether edge compute features are enabled */ EnableEdgeComputeFeatures: boolean; /** Supported feature flags */ diff --git a/build/download_kompose_binary.sh b/build/download_kompose_binary.sh deleted file mode 100755 index 6369bfec1..000000000 --- a/build/download_kompose_binary.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -if [[ $# -ne 3 ]]; then - echo "Illegal number of parameters" >&2 - exit 1 -fi - -PLATFORM=$1 -ARCH=$2 -KOMPOSE_VERSION=$3 - - -if [[ ${PLATFORM} == "windows" ]]; then - wget -O "dist/kompose.exe" "https://github.com/kubernetes/kompose/releases/download/${KOMPOSE_VERSION}/kompose-windows-amd64.exe" - chmod +x "dist/kompose.exe" -elif [[ ${PLATFORM} == "darwin" ]]; then - # kompose 1.22 doesn't have arm support yet, we could merge darwin and linux scripts after upgrading kompose to >= 1.26.0 - wget -O "dist/kompose" "https://github.com/kubernetes/kompose/releases/download/${KOMPOSE_VERSION}/kompose-${PLATFORM}-amd64" - chmod +x "dist/kompose" -else - wget -O "dist/kompose" "https://github.com/kubernetes/kompose/releases/download/${KOMPOSE_VERSION}/kompose-${PLATFORM}-${ARCH}" - chmod +x "dist/kompose" -fi diff --git a/gruntfile.js b/gruntfile.js index 5d3fa58d7..892d0c509 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -29,7 +29,6 @@ module.exports = function (grunt) { dockerVersion: 'v20.10.21', dockerComposePluginVersion: 'v2.13.0', helmVersion: 'v3.9.3', - komposeVersion: 'v1.22.0', kubectlVersion: 'v1.24.1', }, env: gruntConfig.env, @@ -78,7 +77,6 @@ module.exports = function (grunt) { `shell:download_docker_binary:${platform}:${a}`, `shell:download_docker_compose_binary:${platform}:${a}`, `shell:download_helm_binary:${platform}:${a}`, - `shell:download_kompose_binary:${platform}:${a}`, `shell:download_kubectl_binary:${platform}:${a}`, ]); }); @@ -117,7 +115,6 @@ gruntConfig.shell = { build_binary_azuredevops: { command: shell_build_binary_azuredevops }, download_docker_binary: { command: shell_download_docker_binary }, download_helm_binary: { command: shell_download_helm_binary }, - download_kompose_binary: { command: shell_download_kompose_binary }, download_kubectl_binary: { command: shell_download_kubectl_binary }, download_docker_compose_binary: { command: shell_download_docker_compose_binary }, run_container: { command: shell_run_container }, @@ -228,18 +225,6 @@ function shell_download_helm_binary(platform, arch) { `; } -function shell_download_kompose_binary(platform, arch) { - const binaryVersion = '<%= binaries.komposeVersion %>'; - - return ` - if [ -f dist/kompose ] || [ -f dist/kompose.exe ]; then - echo "kompose binary exists"; - else - build/download_kompose_binary.sh ${platform} ${arch} ${binaryVersion}; - fi - `; -} - function shell_download_kubectl_binary(platform, arch) { var binaryVersion = '<%= binaries.kubectlVersion %>';