scripting improvements

This commit is contained in:
Alon Girmonsky
2024-10-21 12:58:01 -07:00
parent f026c3604a
commit 7b94c9beff
2 changed files with 12 additions and 2 deletions

View File

@@ -84,7 +84,16 @@ func SetConfig(provider *Provider, key string, value string) (updated bool, err
_, err = provider.clientSet.CoreV1().ConfigMaps(config.Config.Tap.Release.Namespace).Update(context.TODO(), configMap, metav1.UpdateOptions{})
if err == nil {
if updated {
log.Info().Str("config", key).Str("value", value).Msg("Updated:")
log.Info().
Str("config", key).
Str("value", func() string {
if len(value) > 10 {
return value[:10]
}
return value
}()).
Int("length", len(value)).
Msg("Updated. Printing only 10 first characters of value:")
}
} else {
log.Error().Str("config", key).Err(err).Send()