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

[BUG] Complex provider specific config causes gRPC init call to fail #501

Closed
1 task done
mansam opened this issue Feb 9, 2024 · 1 comment · Fixed by #541
Closed
1 task done

[BUG] Complex provider specific config causes gRPC init call to fail #501

mansam opened this issue Feb 9, 2024 · 1 comment · Fixed by #541
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@mansam
Copy link

mansam commented Feb 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Konveyor version

latest

Priority

Undefined (Default)

Current Behavior

Attempting to initialize a provider with complex nested provider specific config results in a protobuf serialization failure:

{
  "name": "k8s",
  "address": "127.0.0.1:8991",
  "proxyConfig": {},
  "initConfig": [{
    "providerSpecificConfig": {
      "groupVersionKinds": [{"group": "apps", "version": "v1", "kind": "Deployment"}, {"group": "", "version": "v1", "kind": "Pod"}, {"group": "", "version": "route.openshift.io/v1", "kind":"Route"}],
      "namespaces": ["konveyor-tackle"]
    },
    "proxyConfig": {
    }
  }]
}
ERRO[0000] unable to init the providers  error="proto: invalid type: map[interface {}]interface {}" provider=k8s

In this example, it's choking on the groupVersionKinds field. I think the proximate cause is something to do with the exact representation the decoder is choosing for the contents of providerSpecificConfig; since it's specified as a map[string]interface{} the decoder has plenty of options. I experimented by changing the yaml.Unmarshal call in provider/provider.go to unmarshal with json.Unmarshal from encoding/json, and that worked, so one representation seems to be acceptable to protobuf and one isn't.

Expected Behavior

The provider specific config is serialized to proto and transmitted across the gRPC interface successfully.

How Reproducible

Always

Steps To Reproduce

Attempt to initialize a provider with deeply nested providerSpecificConfig.

@mansam mansam added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 9, 2024
@mansam mansam added this to Planning Feb 9, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Planning Feb 9, 2024
@konveyor-ci-bot
Copy link

This issue is currently awaiting triage.
If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.
The triage/accepted label can be added by org members.

@konveyor-ci-bot konveyor-ci-bot bot added the needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. label Feb 9, 2024
@pranavgaikwad pranavgaikwad added priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. labels Feb 14, 2024
@pranavgaikwad pranavgaikwad moved this from 🆕 New to 📋 Backlog in Planning Feb 14, 2024
@pranavgaikwad pranavgaikwad added this to the v0.4.0 milestone Feb 14, 2024
pranavgaikwad pushed a commit that referenced this issue Mar 20, 2024
Adding validation of the keys in provider-specific config to only be
strings

Adding test cases to validate both JSON and yaml provider settings files
will work.

fixes #501

Signed-off-by: Shawn Hurley <[email protected]>
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Planning Mar 20, 2024
aufi pushed a commit to aufi/analyzer-lsp that referenced this issue Mar 25, 2024
Adding validation of the keys in provider-specific config to only be
strings

Adding test cases to validate both JSON and yaml provider settings files
will work.

fixes konveyor#501

Signed-off-by: Shawn Hurley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants