Code cleaning
Using gofumpt. Add documentation. Some fixes on type checking and const icon type declaration.
This commit is contained in:
@@ -8,17 +8,17 @@ type Icon string
|
||||
// Icons used in katenary.
|
||||
const (
|
||||
IconSuccess Icon = "✅"
|
||||
IconFailure = "❌"
|
||||
IconWarning = "⚠️'"
|
||||
IconNote = "📝"
|
||||
IconWorld = "🌐"
|
||||
IconPlug = "🔌"
|
||||
IconPackage = "📦"
|
||||
IconCabinet = "🗄️"
|
||||
IconInfo = "❕"
|
||||
IconSecret = "🔒"
|
||||
IconConfig = "🔧"
|
||||
IconDependency = "🔗"
|
||||
IconFailure Icon = "❌"
|
||||
IconWarning Icon = "⚠️'"
|
||||
IconNote Icon = "📝"
|
||||
IconWorld Icon = "🌐"
|
||||
IconPlug Icon = "🔌"
|
||||
IconPackage Icon = "📦"
|
||||
IconCabinet Icon = "🗄️"
|
||||
IconInfo Icon = "❕"
|
||||
IconSecret Icon = "🔒"
|
||||
IconConfig Icon = "🔧"
|
||||
IconDependency Icon = "🔗"
|
||||
)
|
||||
|
||||
// Warn prints a warning message
|
||||
|
@@ -90,7 +90,6 @@ func GetContainerByName(name string, containers []corev1.Container) (*corev1.Con
|
||||
|
||||
// GetContainerByName returns a container by name and its index in the array.
|
||||
func TplValue(serviceName, variable string, pipes ...string) string {
|
||||
|
||||
if len(pipes) == 0 {
|
||||
return `{{ tpl .Values.` + serviceName + `.` + variable + ` $ }}`
|
||||
} else {
|
||||
@@ -108,8 +107,8 @@ func PathToName(path string) string {
|
||||
if path[0] == '/' || path[0] == '.' {
|
||||
path = path[1:]
|
||||
}
|
||||
path = strings.Replace(path, "/", "_", -1)
|
||||
path = strings.Replace(path, ".", "_", -1)
|
||||
path = strings.ReplaceAll(path, "/", "_")
|
||||
path = strings.ReplaceAll(path, ".", "_")
|
||||
return path
|
||||
}
|
||||
|
||||
@@ -130,9 +129,9 @@ func GetValuesFromLabel(service types.ServiceConfig, LabelValues string) map[str
|
||||
log.Fatal(err)
|
||||
}
|
||||
for _, value := range labelContent {
|
||||
switch value.(type) {
|
||||
switch val := value.(type) {
|
||||
case string:
|
||||
descriptions[value.(string)] = nil
|
||||
descriptions[val] = nil
|
||||
case map[string]interface{}:
|
||||
for k, v := range value.(map[string]interface{}) {
|
||||
descriptions[k] = &EnvConfig{Service: service, Description: v.(string)}
|
||||
|
Reference in New Issue
Block a user