Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ui-cra/src/components/Clusters/Create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const AddCluster: FC = () => {
pullRequestTitle: 'Creates cluster',
commitMessage: 'Creates capi cluster',
pullRequestDescription: 'This PR creates a new cluster',
clusterAutomations: [{ name: '', namespace: '', path: '' }],
clusterAutomations: [],
};

let initialProfiles = [] as UpdatedProfile[];
Expand Down Expand Up @@ -213,7 +213,11 @@ const AddCluster: FC = () => {

const handleAddCluster = useCallback(() => {
const { clusterAutomations, ...rest } = formData;
const kustomizations = clusterAutomations.map(
// filter out empty kustomization
const filteredKustomizations = clusterAutomations.filter(
(kustomization: any) => Object.values(kustomization).join('') !== '',
);
const kustomizations = filteredKustomizations.map(
(kustomization: any): Kustomization => {
return {
metadata: {
Expand Down