-
Notifications
You must be signed in to change notification settings - Fork 23
s3: Filter S3 profiles to only those used by the application #503
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -370,7 +370,9 @@ func (c *Command) applicationS3Info() ([]*s3.Profile, string, error) { | |
| configMapName := ramen.HubOperatorConfigMapName | ||
| configMapNamespace := c.config.Namespaces.RamenHubNamespace | ||
|
|
||
| storeProfiles, err := ramen.ClusterProfiles(reader, configMapName, configMapNamespace) | ||
| storeProfiles, err := ramen.ApplicationProfiles( | ||
| c, reader, c.outputReader, configMapName, configMapNamespace, | ||
| c.opts.DRPCName, c.opts.DRPCNamespace) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good start - change the function we call to get the application profiles instead of all profiles! But we pass 2 many arguments like configMapName and configMapNamespace - this values comes from ramen package, so ramen already know them, so no need to pass them. Need rethink passing these arguments:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ctx is good - matching how we pass commands everywhere - keep it. The hub reader is already used in other functions, but current coded needed single cluster, and here we need to read form 2 clusters. Reading clusters requires the command dataDir(), so we added outputDir() since it was used only in the command command. Passing it to the ramen code works but not great. If we add OutputReader(string) to the context interface, ramen code can create readers from the context so we don't need to pass the hub and the outputReader function. This seems useful since ramen package need to read stuff from the output directory. The ramen package knows the ramen hub config map name so we don't need to pass it. The context has the config, so the ramen package can find the config namespace. With these changes the call will become: storeProfiles, err := ramen.ApplicationProfiles(c, c.opts.DRPCName, c.opts.DRPCNamespace)Lets try do this:
If adding OutputReader() is too big we can pass the function and let ramen.ApplicationS3Profiles create the readers. We can change ramen.ApplicationS3Prefix() to accept a context later for creating the reader instead of passing the reader. This can be a followup PR in main. release 0.23 will have less consistent code. |
||
| if err != nil { | ||
| return nil, "", err | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.