mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-02-14 10:19:54 +00:00
feat: [sc-103119] URI is not replacing the spec but merging instead (#1537)
fix uri spec to replace origin spec
This commit is contained in:
@@ -273,7 +273,8 @@ func loadSupportBundleSpecsFromURIs(ctx context.Context, kinds *loader.Troublesh
|
||||
return err
|
||||
}
|
||||
|
||||
kinds.Add(moreKinds)
|
||||
// uri spec replaces the original spec
|
||||
*kinds = *moreKinds
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -57,8 +57,9 @@ spec:
|
||||
err = loadSupportBundleSpecsFromURIs(ctx, kinds)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Len(t, kinds.SupportBundlesV1Beta2, 2)
|
||||
assert.NotNil(t, kinds.SupportBundlesV1Beta2[1].Spec.Collectors[0].ClusterInfo)
|
||||
// valid uri spec will replace the original spec
|
||||
require.Len(t, kinds.SupportBundlesV1Beta2, 1)
|
||||
assert.NotNil(t, kinds.SupportBundlesV1Beta2[0].Spec.Collectors[0].ClusterInfo)
|
||||
}
|
||||
|
||||
func Test_loadSupportBundleSpecsFromURIs_TimeoutError(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user