Skip to content

Commit

Permalink
Log cluster rename message at error level, not warn (#42208)
Browse files Browse the repository at this point in the history
Closes #42153

Co-authored-by: Edoardo Spadolini <[email protected]>
  • Loading branch information
zmb3 and espadolini authored May 31, 2024
1 parent a98e609 commit a64f5b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/auth/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,15 @@ func initCluster(ctx context.Context, cfg InitConfig, asrv *Server) error {
return trace.Wrap(err)
}
if cn.GetClusterName() != cfg.ClusterName.GetClusterName() {
warnMessage := "Cannot rename cluster to %q: continuing with %q. Teleport " +
msg := "Cannot rename cluster: continuing with current cluster name. Teleport " +
"clusters can not be renamed once they are created. You are seeing this " +
"warning for one of two reasons. Either you have not set \"cluster_name\" in " +
"message for one of two reasons. Either you have not set \"cluster_name\" in " +
"Teleport configuration and changed the hostname of the auth server or you " +
"are trying to change the value of \"cluster_name\"."
log.Warnf(warnMessage, cfg.ClusterName.GetClusterName(), cn.GetClusterName())
log.WithFields(logrus.Fields{
"current_cluster_name": cn.GetClusterName(),
"configured_cluster_name": cfg.ClusterName.GetClusterName(),
}).Error(msg)
}

log.Debugf("Cluster configuration: %v.", cn.GetClusterName())
Expand Down

0 comments on commit a64f5b8

Please sign in to comment.