Skip to content

Commit 4c4f0b3

Browse files
denikIsaac
andcommitted
Use NewStringKeysSlice for single key paths
Co-authored-by: Isaac <no-reply@databricks.com>
1 parent 2bbfd5c commit 4c4f0b3

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎bundle/apps/validate.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func warnForAppResourcePermissions(b *bundle.Bundle, appKey string, app *resourc
167167
ref.permission,
168168
appKey,
169169
),
170-
Paths: []*structpath.PathNode{structpath.NewStringKeys(nil, "resources", "apps", appKey)},
170+
Paths: structpath.NewStringKeysSlice("resources", "apps", appKey),
171171
Locations: b.Config.GetLocations(appPath),
172172
})
173173
}

‎bundle/config/validate/single_node_cluster_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func TestValidateSingleNodeClusterFailForInteractiveClusters(t *testing.T) {
121121
Summary: singleNodeWarningSummary,
122122
Detail: singleNodeWarningDetail,
123123
Locations: []diag.Location{{File: "a.yml", Line: 1, Column: 1}},
124-
Paths: []*structpath.PathNode{structpath.NewStringKeys(nil, "resources", "clusters", "foo")},
124+
Paths: structpath.NewStringKeysSlice("resources", "clusters", "foo"),
125125
},
126126
}, diags)
127127
})

‎bundle/config/validate/validate_dashboard_etags.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (v *validateDashboardEtags) Apply(ctx context.Context, b *bundle.Bundle) di
2727
{
2828
Severity: diag.Error,
2929
Summary: fmt.Sprintf("dashboard %q has an etag set. Etags must not be set in bundle configuration", dashboard.DisplayName),
30-
Paths: []*structpath.PathNode{structpath.NewStringKeys(nil, "resources", "dashboards", k)},
30+
Paths: structpath.NewStringKeysSlice("resources", "dashboards", k),
3131
Locations: b.Config.GetLocations("resources.dashboards." + k),
3232
},
3333
}

‎bundle/config/validate/validate_genie_space_etags.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (v *validateGenieSpaceEtags) Apply(ctx context.Context, b *bundle.Bundle) d
2929
{
3030
Severity: diag.Error,
3131
Summary: fmt.Sprintf("genie space %q has an etag set. Etags must not be set in bundle configuration", genieSpace.Title),
32-
Paths: []*structpath.PathNode{structpath.NewStringKeys(nil, "resources", "genie_spaces", k)},
32+
Paths: structpath.NewStringKeysSlice("resources", "genie_spaces", k),
3333
Locations: b.Config.GetLocations("resources.genie_spaces." + k),
3434
},
3535
}

0 commit comments

Comments
 (0)