From e51a58bc13147d4582a6170c7c8417c3409b98af Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 06:00:38 +0000 Subject: [PATCH] feat(helm/bake): Add additional input fields where we can fill in details of the APIs versions (#10036) (#10045) - These input fields will not be pre-populated with versions of the target cluster available in the environment. - They will become part of the bake result. - Added API_VERSIONS_ENABLED env variable flag (cherry picked from commit d9681830244ecd1c70cc02459f148d0822b7187e) Co-authored-by: Krystian <24556350+ciurescuraul@users.noreply.github.com> --- packages/app/src/settings.js | 3 +++ .../bakeManifest/helm/BakeHelmConfigForm.tsx | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/packages/app/src/settings.js b/packages/app/src/settings.js index 8eef00571af..62ce150c229 100644 --- a/packages/app/src/settings.js +++ b/packages/app/src/settings.js @@ -57,6 +57,8 @@ const reduxLoggerEnabled = import.meta.env.VITE_REDUX_LOGGER === 'true' || proce const templatesEnabled = import.meta.env.VITE_TEMPLATES_ENABLED === 'true' || process.env.TEMPLATES_ENABLED === 'true'; const useClassicFirewallLabels = import.meta.env.VITE_USE_CLASSIC_FIREWALL_LABELS === 'true' || process.env.USE_CLASSIC_FIREWALL_LABELS === 'true'; +const helmApiVersionsEnabled = + import.meta.env.VITE_API_VERSIONS_ENABLED === 'true' || process.env.API_VERSIONS_ENABLED === 'true' || false; const functionsEnabled = import.meta.env.VITE_FUNCTIONS_ENABLED === 'true' || process.env.FUNCTIONS_ENABLED === 'true' || false; const k8sRawResourcesEnabled = @@ -130,6 +132,7 @@ window.spinnakerSettings = { slack: false, snapshots: false, functions: functionsEnabled, + helmApiVersions: helmApiVersionsEnabled, kubernetesRawResources: k8sRawResourcesEnabled, }, gateUrl: apiHost, diff --git a/packages/core/src/pipeline/config/stages/bakeManifest/helm/BakeHelmConfigForm.tsx b/packages/core/src/pipeline/config/stages/bakeManifest/helm/BakeHelmConfigForm.tsx index 6f903937619..e0ab5d8af84 100644 --- a/packages/core/src/pipeline/config/stages/bakeManifest/helm/BakeHelmConfigForm.tsx +++ b/packages/core/src/pipeline/config/stages/bakeManifest/helm/BakeHelmConfigForm.tsx @@ -9,6 +9,7 @@ import { StageArtifactSelectorDelegate, } from '../../../../../artifact'; import { StageConfigField } from '../../common/stageConfigField/StageConfigField'; +import { SETTINGS } from '../../../../../config'; import type { IArtifact, IExpectedArtifact } from '../../../../../domain'; import { MapEditor } from '../../../../../forms'; import { CheckboxInput, TextInput } from '../../../../../presentation'; @@ -150,9 +151,30 @@ export class BakeHelmConfigForm extends React.Component

Helm Options

+ {enableApiVersions && ( // Only render if enableApiVersions is true + <> + + ) => { + this.props.formik.setFieldValue('apiVersions', e.target.value); + }} + value={stage.apiVersions} + /> + + + ) => { + this.props.formik.setFieldValue('kubeVersion', e.target.value); + }} + value={stage.kubeVersion} + /> + + + )} ) => {