Skip to content

Commit 868facd

Browse files
Merge pull request #8367 from AshwinHIBM/warn-long-clustername
OCPBUGS-33840: Warn before trimming cluster name
2 parents 469d617 + 2c76cba commit 868facd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/asset/installconfig/clusterid.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"strings"
77

88
"github.com/pborman/uuid"
9+
"github.com/sirupsen/logrus"
910
utilrand "k8s.io/apimachinery/pkg/util/rand"
1011

1112
"github.com/openshift/installer/pkg/asset"
@@ -70,6 +71,7 @@ func generateInfraID(base string, maxLen int) string {
7071

7172
// truncate to maxBaseLen
7273
if len(base) > maxBaseLen {
74+
logrus.Warnf("Length of cluster name %q is %d which is greater than the max %d allowed. The name will be truncated to %q", base, len(base), maxBaseLen, strings.TrimRight(base[:maxBaseLen], "-"))
7375
base = base[:maxBaseLen]
7476
}
7577
base = strings.TrimRight(base, "-")

0 commit comments

Comments
 (0)