Skip to content

Commit

Permalink
chore: Fix "marshalled" typo
Browse files Browse the repository at this point in the history
Signed-off-by: James Alseth <james@jalseth.me>
  • Loading branch information
jalseth committed Feb 9, 2025
1 parent 4867c5e commit 9a10d6e
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 9a10d6e

Please sign in to comment.