-
Notifications
You must be signed in to change notification settings - Fork 304
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
flyte-cli setup-config throws JSONDecodeError #653
Conversation
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #653 +/- ##
==========================================
+ Coverage 85.45% 85.57% +0.11%
==========================================
Files 355 355
Lines 29246 29292 +46
Branches 2368 2374 +6
==========================================
+ Hits 24993 25067 +74
+ Misses 3624 3589 -35
- Partials 629 636 +7
Continue to review full report at Codecov.
|
# This is where we handle the value read from the flyte-cli config file, if any, for the insecure flag. | ||
# Previously we tried putting it into the default into the declaration of the option itself, but in click, it | ||
# appears that flags operate like toggles. If both the default is true and the flag is passed in the command, | ||
# they negate each other and it's as if it's not passed. Here we rectify that. | ||
if _INSECURE_FLAG and _INSECURE_FLAGS[0] not in prefix_args: | ||
prefix_args.append(_INSECURE_FLAGS[0]) | ||
|
||
# Use host url in config file if users don't specify the host url | ||
if _HOST_FLAGS[0] not in prefix_args: | ||
prefix_args.extend([_HOST_FLAGS[0], _six.text_type(_HOST_URL)]) |
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.
prefix_args.extend([_HOST_FLAGS[0], _six.text_type(_HOST_URL)]) | |
prefix_args.extend([_HOST_FLAGS[0], str(_HOST_URL)]) |
I installed the sha from this PR into a new virtualenv and then ran the following. host location
Is this intended? Are you supposed to have to specify the host after client_id missing
Looking at the response, it looks like Admin is returning: The file is still being written correctly:
but the stack trace is ugly and made me think the entire command failed. Can we hide it somehow? |
|
||
f.write("[credentials]") | ||
f.write("\n") | ||
f.write("client_id={}".format(data["client_id"])) |
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.
cc @wild-endeavor.
File "/Users/ytong/envs/tstsetup/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/ytong/envs/tstsetup/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/ytong/envs/tstsetup/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/ytong/envs/tstsetup/lib/python3.8/site-packages/flytekit/clis/flyte_cli/main.py", line 2372, in setup_config
f.write("client_id={}".format(data["client_id"]))
KeyError: 'client_id'
It seems like you used the old version of flytekit.
I already removed f.write
No, I didn't test it before. I just ran the command
|
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su [email protected]
TL;DR
flyte-cli setup-config throws JSONDecodeError because we tried to get admin credential in insecure mode.
Type
Are all requirements met?
Complete description
Get credentials only in a secure mode.
Tracking Issue
flyteorg/flyte#163
Follow-up issue
NA