-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add simple completion of GCS configuration #11
Conversation
@legionus please split your vendoring commit out to make this reviewable. @coreydaley fyi, you should compare notes w/ what you're doing for s3 to make sure we have the same general pattern/flow. |
Signed-off-by: Gladkov Alexey <agladkov@redhat.com>
@bparees Done |
pkg/operator/bootstrap.go
Outdated
} | ||
cr.Spec.HTTPSecret = fmt.Sprintf("%x", string(secretBytes[:])) | ||
|
||
logrus.Warn("No HTTP secret provided - generated random secret") |
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.
How should it be provided?
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.
@dmage Thanks! Removed.
Signed-off-by: Gladkov Alexey <agladkov@redhat.com>
@bparees will do |
if _, err := rand.Read(secretBytes[:]); err != nil { | ||
return fmt.Errorf("could not generate random bytes for HTTP secret: %s", err) | ||
} | ||
cr.Spec.HTTPSecret = fmt.Sprintf("%x", string(secretBytes[:])) |
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.
what is this used for?
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.
https://docs.docker.com/registry/configuration/#http
A random piece of data used to sign state that may be stored with the client to protect against tampering. For production environments you should generate a random piece of data using a cryptographically secure random generator. If you omit the secret, the registry will automatically generate a secret when it starts. If you are building a cluster of registries behind a load balancer, you MUST ensure the secret is the same for all registries.
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.
ok thanks
return err | ||
} | ||
|
||
err = client.Bucket(d.Config.Bucket).Create(ctx, projectID, nil) |
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.
do you not need to check if the bucket already exists?
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.
That is why it's a simple gcs completion. I do not know how to do it better ))
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.
ok. So you're still investigating how to check if a bucket exists?
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.
@bparees Yes, I wanted to leave it as follow up. This PR is just a preview to understand how to update the configuration, when to do it, and how the function might looks like.
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.
that's reasonable
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees, legionus The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Generated with: $ dep ensure using: $ dep version dep: version : v0.5.1 build date : 2019-03-20 git hash : faa61893 go version : go1.10.3 go compiler : gc platform : linux/amd64 features : ImportDuringSolve=false I'm not sure why there are so many changes. For example, the go.opencensus.io stuff is originally from a531f87 (Update vendor, 2018-09-19, 2018-09-19, openshift#11), where it was used by vendor/cloud.google.com and vendor/google.golang.org/api/transport. Those consumers are still there, but are apparently unused by the operator, because I can build the operator without issues after removing them. I expect this project wants a: [prune] non-go = true go-tests = true unused-packages = true or similar in Gopkg.toml, but am punting on that for now.
No description provided.