lburgazzoli commented on a change in pull request #700: Fix #698: provide a way
to override the default image name
URL: https://github.com/apache/camel-k/pull/700#discussion_r288399565
##########
File path: pkg/install/operator.go
##########
@@ -31,22 +33,33 @@ import (
)
// Operator installs the operator resources in the given namespace
-func Operator(ctx context.Context, c client.Client, namespace string) error {
- return OperatorOrCollect(ctx, c, namespace, nil)
+func Operator(ctx context.Context, c client.Client, customImage string,
namespace string) error {
+ return OperatorOrCollect(ctx, c, namespace, customImage, nil)
}
// OperatorOrCollect installs the operator resources or adds them to the
collector if present
-func OperatorOrCollect(ctx context.Context, c client.Client, namespace string,
collection *kubernetes.Collection) error {
+func OperatorOrCollect(ctx context.Context, c client.Client, namespace string,
customImage string, collection *kubernetes.Collection) error {
+ customizer := IdentityResourceCustomizer
+ if customImage != "" {
+ customizer = func(o runtime.Object) runtime.Object {
+ if d, ok := o.(*v1.Deployment); ok {
+ if v, pres :=
d.Labels["camel.apache.org/component"]; pres && v == "operator" {
Review comment:
can this be as simple as `d.Labels["camel.apache.org/component"] ==
"operator"` ?
----------------------------------------------------------------
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]
With regards,
Apache Git Services