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 @@ -
+
+ 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. +
+
-
- 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. +
+
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