Resolve KONAN-2230 "Implement publish command"#8
Merged
NourhanKhaled merged 12 commits intomainfrom Nov 3, 2022
Merged
Conversation
# Conflicts: # konan_cli/main.py # konan_cli/utils.py
konan_cli/main.py
Outdated
| global_config.save() | ||
| else: | ||
| click.echo( | ||
| "Error fetching token_name and token_password for konan container registry, please try to re-login") |
Collaborator
There was a problem hiding this comment.
Could we change this to
Looks like you're not logged in. Run `konan login` first then try again.
The user doesn't need to know any details of token or password or container registry.
konan_cli/main.py
Outdated
| try: | ||
| image = client.images.get(image_tag) | ||
| except ImageNotFound: | ||
| click.echo("Incorrect image provided") |
Collaborator
There was a problem hiding this comment.
Wording might be more helpful
Incorrect image provided. Make sure you provide the same image name you used with `konan build` command.
konan_cli/main.py
Outdated
| try: | ||
| image = client.images.get(click.prompt("Image tag")) | ||
| except ImageNotFound: | ||
| click.echo("Incorrect image provided") |
Collaborator
There was a problem hiding this comment.
Use same message suggested above.
konan_cli/main.py
Outdated
| return | ||
| else: | ||
| click.echo( | ||
| "Error reading local configs, please navigate to project file and make sure you initialized your project using init command") |
Collaborator
There was a problem hiding this comment.
Maybe we can make this similar to the django error if manage.py is not found? The user doesn't know what's a local config
model.config.json does not exist in the current directory. Make sure you're running this command from the same directory you ran 'konan init'.
konan_cli/main.py
Outdated
| for chunk in result: | ||
| if 'progress' in chunk: | ||
| click.echo(chunk['progress']) | ||
| click.echo('Image uploaded successfully') |
Collaborator
There was a problem hiding this comment.
Suggested change
| click.echo('Image uploaded successfully') | |
| click.echo('Image pushed successfully') |
konan_cli/main.py
Outdated
| image = client.images.get(local_config.latest_built_image) | ||
| else: | ||
| try: | ||
| image = client.images.get(click.prompt("Image tag")) |
Collaborator
There was a problem hiding this comment.
Suggested change
| image = client.images.get(click.prompt("Image tag")) | |
| image = client.images.get(click.prompt("Image name")) |
for consistency with the arg of the build command
konan_cli/main.py
Outdated
| if LocalConfig.exists(DEFAULT_LOCAL_CFG_PATH): | ||
| local_config = LocalConfig(**LocalConfig.load(DEFAULT_LOCAL_CFG_PATH), new=False) | ||
| if local_config.latest_built_image: | ||
| if click.confirm("Do you want to use the latest built image?"): |
Collaborator
There was a problem hiding this comment.
Can we somehow also echo its name?
# Conflicts: # konan_cli/main.py
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.