Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

linter-settings:
linters-settings:
misspell:
locale: US

Expand Down
8 changes: 4 additions & 4 deletions internal/commands/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,15 @@ func setMatchLabelsMatcher(constraint *unstructured.Unstructured, matcher rego.M
}

func setMatchExpressionsMatcher(constraint *unstructured.Unstructured, matcher []rego.MatchExpressionMatcher) error {
marshalled, err := json.Marshal(matcher)
marshaled, err := json.Marshal(matcher)
if err != nil {
return err
}
var unmarshalled []interface{}
if err := json.Unmarshal(marshalled, &unmarshalled); err != nil {
var unmarshaled []interface{}
if err := json.Unmarshal(marshaled, &unmarshaled); err != nil {
return err
}
return unstructured.SetNestedSlice(constraint.Object, unmarshalled, "spec", "match", "labelSelector", "matchExpressions")
return unstructured.SetNestedSlice(constraint.Object, unmarshaled, "spec", "match", "labelSelector", "matchExpressions")
}

func setNestedStringSlice(constraint *unstructured.Unstructured, slice []string, path ...string) error {
Expand Down