forked from ray-project/kuberay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[kuberay] Fix inconsistent RBAC truncation for autoscaling clusters. (r…
…ay-project#689) Due to inconsistent truncation of RBAC names, it's not possible to deploy an autoscaling RayService with a long name. This PR fixes that issue. Closes ray-project#643. Signed-off-by: Dmitri Gekhtman <[email protected]>
- Loading branch information
1 parent
ff7b8bb
commit 353df33
Showing
6 changed files
with
76 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package common | ||
|
||
import ( | ||
"bytes" | ||
"testing" | ||
|
||
"github.com/ray-project/kuberay/ray-operator/controllers/ray/utils" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
// Generate a string of length 200. | ||
func longString(t *testing.T) string { | ||
var b bytes.Buffer | ||
for i := 0; i < 200; i++ { | ||
b.WriteString("a") | ||
} | ||
result := b.String() | ||
// Confirm length. | ||
assert.Equal(t, len(result), 200) | ||
return result | ||
} | ||
|
||
// Clip the above string using utils.CheckName | ||
// to a string of length 50. | ||
func shortString(t *testing.T) string { | ||
result := utils.CheckName(longString(t)) | ||
// Confirm length. | ||
assert.Equal(t, len(result), 50) | ||
return result | ||
} |