-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Completing aws registration on spoke #788
✨ Completing aws registration on spoke #788
Conversation
b1cffe9
to
5e288e7
Compare
Signed-off-by: suvaanshkumar <[email protected]>
c755023
to
1b1d1da
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #788 +/- ##
==========================================
+ Coverage 63.78% 63.80% +0.02%
==========================================
Files 192 192
Lines 18606 18642 +36
==========================================
+ Hits 11868 11895 +27
- Misses 5759 5770 +11
+ Partials 979 977 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
1b1d1da
to
387a974
Compare
need to run |
|
||
func GetAwsRegion(clusterArn string) string { | ||
clusterStringParts := strings.Split(clusterArn, ":") | ||
return clusterStringParts[3] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we ensure that the slice size is 4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hub cluster arn shoudl be of the format arn:aws:eks:::cluster/ so the length should be fine.
approved := false | ||
|
||
for _, condition := range v1Managedcluster.Status.Conditions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could use meta.FindStatusCondition here.
return secret, nil | ||
} | ||
|
||
func GetFilledAWSHubKubeConfigSecret(kubeClient kubernetes.Interface, secretNamespace, secretName string) (*corev1.Secret, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it is only to check the hubkubeconfig key, you might want to call it GetHubKubeConfigFromSecret
// } | ||
// return nil | ||
//}, eventuallyTimeout, eventuallyInterval).ShouldNot(gomega.HaveOccurred()) | ||
// ensure that generated hub-kubeconfig-secret is correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's also comment that the kubeconfig secret here in integration test for AWS won't be able to connect to hub server, since it is not in the eks environment. So we only validate the format of the hub-kubeconfig.
3912c02
to
875ec73
Compare
Signed-off-by: suvaanshkumar <[email protected]>
875ec73
to
22a64b5
Compare
@@ -117,3 +168,12 @@ var _ = ginkgo.Describe("Joining Process for aws flow", func() { | |||
}) | |||
|
|||
}) | |||
|
|||
func contains(slice []string, value string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: alternatively, you could use
stringSet := sets.New[string](slice...)
return stringSet.Has(value)
....
/approve only 1 minor comment, feel free to tag when it is resolved. |
@mikeshng We have addressed qiujian's final comment. Could you please help merge it. |
Signed-off-by: Gaurav Jaswal <[email protected]>
49ebc19
to
cb0df69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Confirmed the sets
lib comment from reviewer has been addressed.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jaswalkiranavtar, mikeshng, qiujian16 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
0acf030
into
open-cluster-management-io:main
Summary
This PR has enhancement to complete the registration on spoke and save hub kubeconfig in a secret on spoke
Related issue(s)
Fixes #514