-
Notifications
You must be signed in to change notification settings - Fork 200
fix(deploy): track success/failed chart install status #4172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3d9165c
1a9cc36
1491c16
e4a854d
a1c07bb
cb2b540
7160c0c
522625a
7ec78cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,3 +283,85 @@ func TestMergeStateAgent(t *testing.T) { | |
require.NoError(t, err) | ||
require.NotEqual(t, oldState.AgentTLS, newState.AgentTLS) | ||
} | ||
|
||
func TestMergeInstalledChartsForComponent(t *testing.T) { | ||
t.Parallel() | ||
|
||
tests := []struct { | ||
name string | ||
existingCharts []InstalledChart | ||
installedCharts []InstalledChart | ||
expectedCharts []InstalledChart | ||
}{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit but I think partial should be a field on this table test as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fair - lookup starts with the existing state and then adds each chart that was installed by the component. For prune - partial represents that we won't want to mark a release as untracked because deploy may have failed before it was deployed. Open to removing it - but low overhead. |
||
{ | ||
name: "existing charts are merged", | ||
existingCharts: []InstalledChart{ | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart1", | ||
}, | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart2", | ||
}, | ||
}, | ||
installedCharts: []InstalledChart{ | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart3", | ||
}, | ||
}, | ||
expectedCharts: []InstalledChart{ | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart1", | ||
}, | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart2", | ||
}, | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart3", | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "overlapping charts are merged", | ||
existingCharts: []InstalledChart{ | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart1", | ||
}, | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart2", | ||
}, | ||
}, | ||
installedCharts: []InstalledChart{ | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart1", | ||
}, | ||
}, | ||
expectedCharts: []InstalledChart{ | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart1", | ||
}, | ||
{ | ||
Namespace: "default", | ||
ChartName: "chart2", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
t.Parallel() | ||
actual := MergeInstalledChartsForComponent(tt.existingCharts, tt.installedCharts, false) | ||
require.ElementsMatch(t, tt.expectedCharts, actual) | ||
}) | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.