Card origin_devexp_286 - Added ssh key-based access to private git repository#1926
Card origin_devexp_286 - Added ssh key-based access to private git repository#1926openshift-bot merged 2 commits intoopenshift:masterfrom
Conversation
There was a problem hiding this comment.
more doc about what constitutes a valid secret today?
There was a problem hiding this comment.
I don't think I should explain how to setup a secret over here, it'll only pollute build docs with unnecessary details, which should be covered in secrets. Of course there will be some more information around that topic in our docs, but I don't think it's necessary here.
There was a problem hiding this comment.
i'm not looking for major detail, but "secret must be an SSH key for git auth" or something... our API turns out to be our docs frequently.
|
@soltysh is the assumption that they'll use a git url that includes the username for source cloning (ie an ssh url)? you might double check that the web console "create from source" tolerates that format for a source uri. |
pkg/build/api/types.go
Outdated
There was a problem hiding this comment.
@bparees @smarterclayton one question that pop-ed up in my head today, why not using ObjectReference for that? I've taken here the approach @mfojtik did when doing secrets for docker push, but wouldn't it be desirable to use ObjectReference to mark this field as using external object?
There was a problem hiding this comment.
ObjectRef would make sense to me..that would enable you to use a secret from a different namespace also.
There was a problem hiding this comment.
You're not allowed to reference secrets from other namespaces by design today.
On Apr 28, 2015, at 11:31 AM, Ben Parees notifications@github.com wrote:
In pkg/build/api/types.go:
@@ -111,6 +111,10 @@ type BuildSource struct {
// This allows to have buildable sources in directory other than root of
// repository.
ContextDir stringjson:"contextDir,omitempty"
+
- // SourceSecretName is the name of a Secret that would be used for setting
- // up the authentication for cloning private repository.
- SourceSecretName string
json:"sourceSecretName,omitempty"
ObjectRef would make sense to me..that would enable you to use a secret from a different namespace also.—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Yeah, that's what I was told, and I kinda agree with that argument. Still using an ObjectReference is a good practice IMHO, to notify readers of the API we are reaching somewhere else to get that object, even though withing the scope of your namespace.
There was a problem hiding this comment.
Yes, secrets are excluded from that argument for the time being.
On Apr 28, 2015, at 3:43 PM, Maciej Szulik notifications@github.com wrote:
In pkg/build/api/types.go:
@@ -111,6 +111,10 @@ type BuildSource struct {
// This allows to have buildable sources in directory other than root of
// repository.
ContextDir stringjson:"contextDir,omitempty"
+
- // SourceSecretName is the name of a Secret that would be used for setting
- // up the authentication for cloning private repository.
- SourceSecretName string
json:"sourceSecretName,omitempty"
Yeah, that's what I was told, and I kinda agree with that argument. Still using an ObjectReference is a good practice IMHO, to notify readers of the API we are reaching somewhere else to get that object, even though withing the scope of your namespace.—
Reply to this email directly or view it on GitHub.
|
LGTM |
pkg/build/builder/cmd/builder.go
Outdated
There was a problem hiding this comment.
nit: you can just return script.Close() here.
|
Hold for review - want to look through this. |
|
@smarterclayton sure, I'm updating the UI part, as it doesn't allow you to pass git url such as |
|
@bparees @Kargakis addressed your comments. @smarterclayton ready for final review. |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/2063/) |
|
Rebased and fixed new-app CLI, which wasn't properly treating git+ssh URLs. |
pkg/build/api/types.go
Outdated
There was a problem hiding this comment.
Why does it have to be an SSH key? It could just as easy be basic auth (probably more common) or a client cert.
There was a problem hiding this comment.
I'll just then remove the 2nd sentence.
There was a problem hiding this comment.
Since @bparees insistent on having some description of the contents of the secret, I've reworked that sentence.
There was a problem hiding this comment.
I take that back, per my card we're adding just the SSH key auth method.
There was a problem hiding this comment.
But I'll prepare the mechanism for easily adding the rest of the methods, so in the end that description will be generally for all of the methods.
|
@smarterclayton addressed most of your comments, others replied. PTAL. |
9c913c5 to
ffe40a5
Compare
pkg/build/builder/cmd/builder.go
Outdated
There was a problem hiding this comment.
why not use exec.Command here as well? You can then avoid listing files using Go and just "chmod -R 0600 dir"
There was a problem hiding this comment.
It was faster than chmod magic, just to change contents permissions. And passing * is a pain to exec.
|
@mfojtik addressed your comments, especially about moving the fixing permissions part to separate method. @smarterclayton PTAL. |
|
@smarterclayton addressed your comments, except for the two explained inline. |
|
LGTM, [merge]
|
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/1858/) (Image: devenv-fedora_1474) |
|
Rebased. |
|
Evaluated for origin up to a208f1c |
@mfojtik @bparees this is the initial and main part of my git card PTAL