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
Add user id to context config #1962
Conversation
Signed-off-by: Javier López Barba <javier@okteto.com>
cmd/context/use.go
Outdated
@@ -152,6 +152,14 @@ func getUserContext(ctx context.Context) (*okteto.UserContext, error) { | |||
retries := 0 | |||
for retries <= 3 { | |||
userContext, err := client.GetUserContext(ctx) | |||
|
|||
if okteto.Context().UserID == "" { |
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.
could we add a comment explaining why we need this code?
Codecov Report
@@ Coverage Diff @@
## master #1962 +/- ##
==========================================
- Coverage 33.31% 33.29% -0.02%
==========================================
Files 125 125
Lines 13941 13947 +6
==========================================
Hits 4644 4644
- Misses 8795 8801 +6
Partials 502 502
Continue to review full report at Codecov.
|
Signed-off-by: Javier López Barba <javier@okteto.com>
cmd/context/use.go
Outdated
|
||
// If userID is not on context config file we add it and save it. | ||
// this prevents from relogin to actual users | ||
if okteto.Context().UserID == "" { |
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.
Should we only run this if it's an okteto context?
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba javier@okteto.com
Proposed changes