File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/hyperpod_cli/commands Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1144,4 +1144,7 @@ def get_user_name():
11441144 # label value does not allow slash
11451145 user_name = user_name .replace ('/' , '-' )
11461146 # 63 is the max length for a Kubernetes label
1147- return user_name [:63 ]
1147+ if len (user_name ) > 63 :
1148+ # Add dots in the end to indicate the username is trimmed
1149+ return user_name [:59 ] + '...'
1150+ return user_name
Original file line number Diff line number Diff line change @@ -2139,4 +2139,4 @@ def test_get_user_name_long_arn(self, mock_boto3_client):
21392139 long_user_name = "ReadOnly/AmazonSageMaker-a-long-long-long-long-long-long-long-arn-for-testing-get-user-name"
21402140 long_arn = "arn:aws:iam::0123456789012:assumed-role/" + long_user_name
21412141 mock_identity .get .return_value = long_arn
2142- self .assertEqual (get_user_name (), "AssumedRole-" + long_user_name .replace ("/" , "-" )[:51 ] )
2142+ self .assertEqual (get_user_name (), "AssumedRole-" + long_user_name .replace ("/" , "-" )[:48 ] + "..." )
You can’t perform that action at this time.
0 commit comments