Skip to content
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

Public accessible bucket requires a credentials secret #219

Open
TomerFi opened this issue Jul 12, 2022 · 0 comments
Open

Public accessible bucket requires a credentials secret #219

TomerFi opened this issue Jul 12, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@TomerFi
Copy link
Member

TomerFi commented Jul 12, 2022

Describe the bug
Using the ObjectBucket subscriber with public accessible buckets requires a credentials secret in place.

To Reproduce

  • Create a public accessible bucket with a publicly accessible resource YAML file.s in it.
  • Create a Channel referencing the above bucket - Without configuring the spec.secretRef key.
  • Create a Subscription referencing the above Channel.
  • Deploy the application to the Hub cluster.

Expected behavior
The secret reference should not be mandatory for public accessible buckets,
this is not the case for neither the Git nor the HelmRepo subscriber types.

Environment ie: Kubernetes version:

OpenShift 4.7.36
Kubernetes 1.20

Additional context
As far as my short investigation,
this gets cut on the Hub at the dry-run stage before propagating the Subscription.

First failure occurs here:

if err := awshandler.InitObjectStoreConnection(endpoint, accessKeyID, secretAccessKey, region); err != nil {

if no secret is configured, the region variable remains an empty string and fails InitObjectStoreConnection.

At this point, I tried to configure a partial secret, one containing only the Region key and not the AccessKeyID nor the SecretAccessKey keys.
That got me passed the above failure but then it failed again, I think it failed the next statement:

if err := awshandler.Exists(bucket); err != nil {

But I'm not sure and I accedentily deleted my notes, anyway, adding the AccessKeyID and the SecretAccessKey keys, although not required for accessing the bucket, solves the issue.

@TomerFi TomerFi added the bug Something isn't working label Jul 12, 2022
@mikeshng mikeshng self-assigned this Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants