Skip to content

Commit

Permalink
fix underscore bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfregly committed Apr 6, 2024
1 parent c93c18b commit b67999e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/controller/sanitize.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ func sanitizeSnapshot(snapshot *qgn.Snapshot) {
}

func sanitizeKey(key string) string {
return strings.ReplaceAll(strings.ReplaceAll(strings.ToLower(key), " ", "_"), "-", "_")
return strings.ReplaceAll(strings.ReplaceAll(strings.ToLower(key), " ", "-"), ".", "-")
}

func sanitizeID(id string) string {
max := 16
if len(id) > max {
id = id[:max]
}
return strings.ReplaceAll(strings.ReplaceAll(strings.ToLower(id), " ", "_"), "-", "_")
return strings.ReplaceAll(strings.ReplaceAll(strings.ToLower(id), " ", "-"), ".", "-")
}
4 changes: 2 additions & 2 deletions pkg/k8s/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const ChartName = "quibbble-controller"
const Namespace = "quibbble"

func Name(key, id string) string {
return fmt.Sprintf("%s-%s", key, id)
return fmt.Sprintf("%s.%s", key, id)
}

func KeyID(name string) (string, string) {
s := strings.Split(name, "-")
s := strings.Split(name, ".")
return s[0], s[1]
}

0 comments on commit b67999e

Please sign in to comment.