mksh opened a new pull request #2246:
URL: https://github.com/apache/camel-k/pull/2246
Hi, Camel-K team.
First of all, thank you for a great product. With it, me and my team enjoy
programming for JVM as never before!
There are some caveats, though.
One of them is excessive Docker repository usage by integration kit builder.
As it seen from the patch, it is impossible to use single repository for all
the subsequent builds by single operator with current Camel-K. Current logic
makes all the builds to use repository name of format
`{IntegrationPlatform.IntegrationPlatformBuildSpec.Registry.Address}/{IntegrationPlatform.IntegrationPlatformBuildSpec.Registry.Organization}/camel-k-{IntegrationKit.Name}:{IntegrationKit.ResourceVersion}`
This is breaking our integration with ECR, as ECR assumes every repository
being created before `kaniko push` can be performed. With Quay, such behavior
causes troubles with number of repositories, and in the end can affect Quay
service cost.
This patch:
<!-- Description -->
- Adds `IntegrationPlatform.IntegrationPlatformBuildSpec.TargetRepository`
optional parameter
- Preserves old Integration Kit behavior in case if parameter is empty
- Makes builders that require registry to use single repository in that
registry when parameter is passed. The repository name is set to parameter
value, so the resulting docker image name adheres to a following format:
`{IntegrationPlatform.IntegrationPlatformBuildSpec.Registry.Address}/{IntegrationPlatform.IntegrationPlatformBuildSpec.Registry.Organization}/{IntegrationPlatform.IntegrationPlatformBuildSpec.TargetRepository}:{IntegrationKit.Name}-{IntegrationKit.ResourceVersion}`
- Adds tests for the new image naming scheme, and backwards compatibility
with older one
I haven't added `TargetRepository` into `IntegrationPlatformRegistrySpec`,
but bound it into `IntegrationPlatformBuildSpec` instead to allow configuring
single repository per integration later. It is not needed for my team use-case
now, so this patch does not implement it. Still appears easy to do, if someone
would need it later.
<!--
Enter your extended release note in the below block. If the PR requires
additional action from users switching to the new release, include the string
"action required". If no release note is required, write "NONE".
You can (optionally) mark this PR with labels "kind/bug" or "kind/feature"
to make sure
the text is added to the right section of the release notes.
-->
**Release Note**
```release-note
- Add ability to configure single build target docker repository for
operator via IntegrationPlatform spec
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]