-
Notifications
You must be signed in to change notification settings - Fork 23
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
Wget access method #630
Wget access method #630
Conversation
@@ -0,0 +1,24 @@ | |||
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors. |
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.
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors. | |
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Open Component Model contributors. |
Where is this text coming from? Can we change it centrally?
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.
It can be generated by the IDE (if configured). In Goland you should use the variable $today.year
instead of a fixed year.
pkg/blobaccess/wget/access.go
Outdated
|
||
var blob cpi.BlobAccess | ||
if resp.ContentLength < 0 || resp.ContentLength > CACHE_CONTENT_THRESHOLD { | ||
log.Debug("download to file because content length is", "unknown or greater than", CACHE_CONTENT_THRESHOLD) |
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.
Why is the log message splitted like this? Would it be too long?
log.Debug("download to file because content length is", "unknown or greater than", CACHE_CONTENT_THRESHOLD) | |
log.Debug("download to file because content length is unknown or greater than", CACHE_CONTENT_THRESHOLD) |
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 signature of the log function is Debug(msg string, keypairs ...interface{})
. This quite weird and I just thought I'd provide a key value pair.
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 message should be download to file because content length is unknown or greater than {{threshold}}
The key/value pair then is "threshold", CACHE_CONTENT_THRESHOLD
.
You could omit the curly brackets. They are used by the human
log message formatter to provide human-readable log output by substituting known values (and omitting them from the shown value list).
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.
Adjusted.
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.
only a few questions and comments...
at one place there is a copy & paste issue: search for 'Helm Chart' ;-)
4378db3
to
f8bd2ab
Compare
@@ -0,0 +1,24 @@ | |||
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors. |
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.
It can be generated by the IDE (if configured). In Goland you should use the variable $today.year
instead of a fixed year.
pkg/contexts/ocm/elements/artifactaccess/wgetaccess/resource.go
Outdated
Show resolved
Hide resolved
f8bd2ab
to
c7e7105
Compare
aff20c0
to
4b9c6c4
Compare
cmds/ocm/commands/ocmcmds/common/inputs/types/wget/suite_test.go
Outdated
Show resolved
Hide resolved
9e78279
to
d57efbb
Compare
There are still lint errors |
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.
There are still lint errors.
The ocm tooling introduced the wget access method [here](open-component-model/ocm#630). This adds documentation to the corresponding spec section.
Description
This PR implements a new access method type called
wget
. This access types allows to reference and access resources located on a http server.