This repository was archived by the owner on Jan 27, 2023. It is now read-only.
Draft
Conversation
added 3 commits
September 18, 2020 22:55
Signed-off-by: Swathi Gangisetty <swathi@anchore.com>
…niqueness Signed-off-by: Swathi Gangisetty <swathi@anchore.com>
Signed-off-by: Swathi Gangisetty <swathi@anchore.com>
Toure
reviewed
Sep 22, 2020
| ret = None | ||
| try: | ||
| proc_env = os.environ.copy() | ||
| if user and pw: |
Contributor
There was a problem hiding this comment.
I noticed that this is used through the entire module which means it should be broken out into a separate function like
def set_auth_info(user=None, password=None, verify=False):
proc_env = os.environ.copy()
if user and pw:
proc_env['SKOPUSER'] = user
proc_env['SKOPPASS'] = pw
credstr = "--creds \"${SKOPUSER}\":\"${SKOPPASS}\""
else:
credstr = ""
if verify:
tlsverifystr = "--tls-verify=true"
else:
tlsverifystr = "--tls-verify=false"
return (proc_env, credstr, tlsverifystr)
This would reduce the amount of code and give us reusable functionality for future expansion.
| raise err | ||
|
|
||
|
|
||
| def get_image_manifest_v2(url, registry, repo, intag=None, indigest=None, user=None, pw=None, verify=True, default=None): |
Contributor
There was a problem hiding this comment.
default should be set to False as it is a bool.
Signed-off-by: Swathi Gangisetty <swathi@anchore.com>
alfredodeza
reviewed
Sep 30, 2020
| raise Exception("could not retrieve manifest") | ||
|
|
||
| except Exception as err: | ||
| raise err |
Contributor
There was a problem hiding this comment.
This doesn't have any effect and it is equal to not having it at all
alfredodeza
reviewed
Sep 30, 2020
| s_digest = manifest_to_digest(raw_manifest) | ||
| return s_manifest, s_digest | ||
| except Exception as err: | ||
| logger.warn("CMD failed - exception: " + str(err)) |
Contributor
There was a problem hiding this comment.
this doesn't add anything that the Exception wouldn't already show. Does this imply there is something beyond str(err) that is useful to log? It seems this could do well without a try/except block
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Signed-off-by: Swathi Gangisetty swathi@anchore.com
What this PR does / why we need it:
Which issue this PR fixes (optional, in
fixes #<issue number>)(, fixes #<issue_number, ...)format, will close the issue when PR is merged: fixes #:Special notes: