Skip to content

Commit

Permalink
feat(helm/bake): Add additional input fields where we can fill in det…
Browse files Browse the repository at this point in the history
…ails of the APIs versions (spinnaker#10036) (spinnaker#10047)

- 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 d968183)

Co-authored-by: Krystian <24556350+ciurescuraul@users.noreply.github.com>
  • Loading branch information
2 people authored and sahititarigoppula committed May 29, 2024
1 parent da1da29 commit 5115b1d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/app/src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -131,6 +133,7 @@ window.spinnakerSettings = {
slack: false,
snapshots: false,
functions: functionsEnabled,
helmApiVersions: helmApiVersionsEnabled,
kubernetesRawResources: k8sRawResourcesEnabled,
},
gateUrl: apiHost,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,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';
Expand Down Expand Up @@ -152,9 +153,30 @@ export class BakeHelmConfigForm extends React.Component<IFormikStageConfigInject

public render() {
const stage = this.props.formik.values;
const enableApiVersions = SETTINGS.feature.helmApiVersions;
return (
<>
<h4>Helm Options</h4>
{enableApiVersions && ( // Only render if enableApiVersions is true
<>
<StageConfigField fieldColumns={3} label={'ApiVersions'}>
<TextInput
onChange={(e: React.ChangeEvent<any>) => {
this.props.formik.setFieldValue('apiVersions', e.target.value);
}}
value={stage.apiVersions}
/>
</StageConfigField>
<StageConfigField fieldColumns={3} label={'KubeVersion'}>
<TextInput
onChange={(e: React.ChangeEvent<any>) => {
this.props.formik.setFieldValue('kubeVersion', e.target.value);
}}
value={stage.kubeVersion}
/>
</StageConfigField>
</>
)}
<StageConfigField fieldColumns={3} label={'Name'}>
<TextInput
onChange={(e: React.ChangeEvent<any>) => {
Expand Down

0 comments on commit 5115b1d

Please sign in to comment.