-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add support for OCI repository pattern for add component version #628
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
base: main
Are you sure you want to change the base?
feat: add support for OCI repository pattern for add component version #628
Conversation
c1fbd25
to
817f238
Compare
e29110b
to
c28c8f5
Compare
c28c8f5
to
106aaed
Compare
4b1523f
to
e5b249f
Compare
addCMD.SetArgs([]string{ | ||
"add", | ||
"component-version", | ||
"--repository", fmt.Sprintf("http://%s", registryAddress), |
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.
@jakobmoellerdev The "fix" to my above credential issue was adding http://
here before the repository address. 🤔 Is that correct or should it have worked without the scheme?
Ugh, the tests together are not working of course. I need a way to isolate them. |
Yay, the tests are passing. I'm going to overhaul the suite_test a bit. |
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
…rsing On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
3db798e
to
476c932
Compare
@@ -106,7 +107,7 @@ add component-version --%[1]s ./path/to/%[2]s --%[3]s ./path/to/%[4]s.yaml | |||
} | |||
|
|||
cmd.Flags().Int(FlagConcurrencyLimit, 4, "maximum number of component versions that can be constructed concurrently.") | |||
file.VarP(cmd.Flags(), FlagRepositoryRef, string(FlagRepositoryRef[0]), LegacyDefaultArchiveName, "path to the repository") | |||
cmd.Flags().StringP(FlagRepositoryRef, string(FlagRepositoryRef[0]), LegacyDefaultArchiveName, "repository specification") |
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 is not actually a repository specification
, is it?
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's a repository url I guess?
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.
Also can be sort a specification because it's no longer "just a path". What could we call this?
func TestParseRepository(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
repoSpec string |
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 might be kind of a nit, but I think it's generally a bit misleading that you call this repoSpec
, as a repo spec is a established term in ocm and that's not it.
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.
Fair point.
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.
Hm, we actually call this repoSpec in the Parser that gets it. 🤔 From the Ref
we do:
for _, prefix := range ValidPrefixes {
token := "/" + prefix + "/"
if idx := strings.LastIndex(input, token); idx != -1 {
repoSpec := input[:idx]
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
What this PR does / why we need it
Fixes open-component-model/ocm-project#578
Which issue(s) this PR fixes