cs-codex-dist-tests/KubernetesWorkflow/K8sNameUtils.cs

20 lines
482 B
C#

namespace KubernetesWorkflow
{
public static class K8sNameUtils
{
public static string Format(string s)
{
var result = s.ToLowerInvariant()
.Replace(" ", "-")
.Replace(":", "-")
.Replace("/", "-")
.Replace("\\", "-")
.Replace("[", "-")
.Replace("]", "-")
.Replace(",", "-");
return result.Trim('-');
}
}
}