Skip to content

Commit

Permalink
fix(kubernetes): whitelist helm artifact types for bake manifest stage (
Browse files Browse the repository at this point in the history
#8053)

* fix(kubernetes): whitelist helm artifact types for bake manifest stage

* fix(kubernetes): permit base64 artifacts in helm bake

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
maggieneterval and mergify[bot] committed Mar 18, 2020
1 parent 63c9a1c commit 93e0d85
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,26 @@ import { StageConfigField } from '../../common/stageConfigField/StageConfigField
import { CheckboxInput, TextInput } from 'core/presentation';
import { MapEditor } from 'core/forms';
import { IArtifact, IExpectedArtifact, IPipeline } from 'core/domain';
import { StageArtifactSelectorDelegate } from 'core/artifact';
import { excludeAllTypesExcept, ArtifactTypePatterns, StageArtifactSelectorDelegate } from 'core/artifact';
import { IFormikStageConfigInjectedProps } from '../../FormikStageConfig';

interface IBakeHelmConfigFormProps {
updatePipeline: (pipeline: IPipeline) => void;
}

export class BakeHelmConfigForm extends React.Component<IBakeHelmConfigFormProps & IFormikStageConfigInjectedProps> {
private static readonly excludedArtifactTypes = excludeAllTypesExcept(
ArtifactTypePatterns.BITBUCKET_FILE,
ArtifactTypePatterns.CUSTOM_OBJECT,
ArtifactTypePatterns.EMBEDDED_BASE64,
ArtifactTypePatterns.GCS_OBJECT,
ArtifactTypePatterns.GITHUB_FILE,
ArtifactTypePatterns.GITLAB_FILE,
ArtifactTypePatterns.S3_OBJECT,
ArtifactTypePatterns.HELM_CHART,
ArtifactTypePatterns.HTTP_FILE,
);

public componentDidMount() {
const stage = this.props.formik.values;
if (stage.inputArtifacts && stage.inputArtifacts.length === 0) {
Expand Down Expand Up @@ -121,7 +133,7 @@ export class BakeHelmConfigForm extends React.Component<IBakeHelmConfigFormProps
<h4>Template Artifact</h4>
<StageArtifactSelectorDelegate
artifact={this.getInputArtifact(stage, 0).artifact}
excludedArtifactTypePatterns={[]}
excludedArtifactTypePatterns={BakeHelmConfigForm.excludedArtifactTypes}
expectedArtifactId={this.getInputArtifact(stage, 0).id}
helpKey="pipeline.config.bake.manifest.expectedArtifact"
label="Expected Artifact"
Expand Down

0 comments on commit 93e0d85

Please sign in to comment.