davsclaus opened a new pull request, #30436: URL: https://github.com/apache/camel/pull/30436
## Description [CAMEL-27190](https://issues.apache.org/jira/browse/CAMEL-27190): `storageClass` was only used for a bucket that `autoCreateBucket` creates. The upload in `GoogleCloudStorageProducer.processFile` never set a storage class, so every object got the default class of its bucket. There was no way to write, for example, an archive file as `COLDLINE` into a `STANDARD` bucket. - New producer option `objectStorageClass` (no default, same enums as `storageClass`): the storage class of uploaded objects. - The `CamelGoogleCloudStorageStorageClass` header is now also an input header: when set (a `StorageClass` or a name such as `nearline`), it takes precedence over the option. - With neither, nothing changes: the object gets the default of its bucket. - `storageClass` keeps its meaning (the class of a created bucket). - New "Storage class" section in the component doc. The catalog, its doc copy and the component and endpoint DSLs are regenerated. **Stacked on #30435 (CAMEL-27189, `String` to `StorageClass` converter)**, which the URI form `objectStorageClass=COLDLINE` needs. This PR targets `main` so that CI runs, and it contains that commit. Only the last commit (`CAMEL-27190: ...`) belongs to this PR. Once #30435 is merged I will rebase this one. ### For the reviewer: the header as input As the JIRA suggests, the header is used as input. The consumer and `getObject` set this same header from the object they read. So a route that reads from bucket A and uploads to bucket B now keeps the storage class of each object, where before the objects got the default of B. That is in the upgrade guide, with `removeHeader` to keep the old behaviour. If we would rather not change that, the option alone is enough for the Kamelet: dropping the header part is a small change. Needed for a `storageClass` option on the `google-storage-sink` Kamelet (apache/camel-kamelets#3280). ## Tests `ProducerObjectStorageClassTest`, on the local fake storage: - no option and no header: the object has no class of its own - `objectStorageClass=COLDLINE`: the object is `COLDLINE`, both in the returned `Blob` and in the store - the header (`ARCHIVE`) wins over the option - the header as a lower-case name works Without the producer change, 3 of the 4 tests fail. All 85 unit tests of the module pass. _Claude Code on behalf of Claus Ibsen_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
