Skip to content

Commit

Permalink
change idSeparator
Browse files Browse the repository at this point in the history
Signed-off-by: Nandor Kracser <bonifaido@gmail.com>
  • Loading branch information
bonifaido committed Feb 4, 2020
1 parent 4051799 commit 7d91b1a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions k8s/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

const idSeparator = "::"

func idParts(id string) (string, string, string, string, error) {
parts := strings.Split(id, "//")
parts := strings.Split(id, idSeparator)
if len(parts) != 4 {
err := fmt.Errorf("Unexpected ID format (%q), expected %q.", id, "namespace//groupVersion//kind//name")
err := fmt.Errorf("unexpected ID format (%q), expected %q.", id, "namespace::groupVersion::kind::name")
return "", "", "", "", err
}

Expand All @@ -25,7 +27,7 @@ func buildId(object *unstructured.Unstructured) string {
object.GroupVersionKind().Kind,
object.GetName(),
},
"//",
idSeparator,
)
}

Expand Down

0 comments on commit 7d91b1a

Please sign in to comment.