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

Incorrect Shovel configuration types #614

Closed
ChunyiLyu opened this issue May 18, 2023 · 1 comment · Fixed by #620
Closed

Incorrect Shovel configuration types #614

ChunyiLyu opened this issue May 18, 2023 · 1 comment · Fixed by #620
Assignees
Labels
bug Something isn't working

Comments

@ChunyiLyu
Copy link
Contributor

Context

Latest rabbit-hole release 2.14 contains a breaking change in Shovel definition where ShovelDefinition.DestinationPublishProperties is changed from string to map[string]interface{}. Destination publish properties is a property list.

More shovel definition fields should be changed to a map from string. After this PR is merged and released. We need to come up with a way to adopt them in shovels.rabbitmq.com. All updated fields are exposed in Shovel CRD: https://github.com/rabbitmq/messaging-topology-operator/blob/main/api/v1beta1/shovel_types.go#L30-L50

Related Github issues
michaelklishin/rabbit-hole#268
michaelklishin/rabbit-hole#262
https://github.com/michaelklishin/rabbit-hole/releases/tag/v2.14.0
#611

@ChunyiLyu ChunyiLyu self-assigned this May 18, 2023
@ChunyiLyu ChunyiLyu added the bug Something isn't working label May 18, 2023
@ChunyiLyu
Copy link
Contributor Author

ChunyiLyu commented May 18, 2023

Rabbit-hole PR is merged and released in v2.15.

For topology operator, we need to change types for three Shovel configurations: destApplicationProperties destPublishProperties and destPublishProperties. I don't think a conversion web hook is necessary in our case because if you were to use any of these three properties currently, reconciliation fails.

shovels.rabbitmq.com manifest:

apiVersion: rabbitmq.com/v1beta1
kind: Shovel
metadata:
  name: example
spec:
  name: example
  uriSecret:
    name: shovel-secret
  srcQueue: "source-queue"
  destQueue: "destination-queue"
  destApplicationProperties: "{test: test}"
  #destPublishProperties: "yo: yo"
  #destProperties: "{work: work}"
  rabbitmqClusterReference:
    name: test

Reconciliation fails with rabbit-hole validation error status code 400, e.g.

{"level":"error","ts":"2023-05-18T10:19:30Z","msg":"Reconciler error","controller":"shovel","controllerGroup":"rabbitmq.com","controllerKind":"Shovel","Shovel":{"name":"example","namespace":"rabbitmq-system"},"namespace":"rabbitmq-system","name":"example","reconcileID":"48f10d23-9c45-4dfa-aa47-f605a555e3b9","error":"Error 400 (bad_request): Validation failed\n\nUnrecognised terms [{<<\"dest-application-properties\">>,<<\"{test: test}\">>}] in example\n","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/internal/controller/controller.go:329\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/internal/controller/controller.go:274\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/internal/controller/controller.go:235"}


{"level":"error","ts":"2023-05-18T10:23:46Z","msg":"Reconciler error","controller":"shovel","controllerGroup":"rabbitmq.com","controllerKind":"Shovel","Shovel":{"name":"example","namespace":"rabbitmq-system"},"namespace":"rabbitmq-system","name":"example","reconcileID":"a645dbb9-0fbe-4197-bc7d-6d48dd908e74","error":"Error 400 (bad_request): Validation failed\n\ndest-publish-properties not a list <<\"{yo: yo}\">>\n","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/internal/controller/controller.go:329\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/internal/controller/controller.go:274\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/internal/controller/controller.go:235"}

{"level":"error","ts":"2023-05-18T10:24:25Z","msg":"Reconciler error","controller":"shovel","controllerGroup":"rabbitmq.com","controllerKind":"Shovel","Shovel":{"name":"example","namespace":"rabbitmq-system"},"namespace":"rabbitmq-system","name":"example","reconcileID":"5145e11a-1e8f-4052-ba78-5fae5b5f1beb","error":"Error 400 (bad_request): Validation failed\n\nUnrecognised terms [{<<\"dest-properties\">>,<<\"key\">>}] in example\n","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/internal/controller/controller.go:329\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/internal/controller/controller.go:274\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/internal/controller/controller.go:235"}

Given this I don't think we have any users currently using these properties and a conversion webhook is not necessary. What do you think @MirahImage ?

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
1 participant