Skip to content

Commit 375462f

Browse files
dtclxy64suvaanshkumar
authored andcommitted
Add a comment on what the IsEksArnWellFormed function does and an example EKS ARN.
Signed-off-by: Suvaansh <[email protected]>
1 parent eca7d04 commit 375462f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/registration/helpers/helpers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ func IsCSRSupported(nativeClient kubernetes.Interface) (bool, bool, error) {
160160
return v1CSRSupported, v1beta1CSRSupported, nil
161161
}
162162

163+
// IsEksArnWellFormed checks if the EKS cluster ARN is well-formed
164+
// Example of a well-formed ARN: arn:aws:eks:us-west-2:123456789012:cluster/my-cluster
163165
func IsEksArnWellFormed(eksArn string) bool {
164166
pattern := "^arn:aws:eks:([a-zA-Z0-9-]+):(\\d{12}):cluster/([a-zA-Z0-9-]+)$"
165167
matched, err := regexp.MatchString(pattern, eksArn)

0 commit comments

Comments
 (0)