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

LOG-2169: Fix Kafka sasl-plaintext/sasl-ssl #1498

Merged
merged 1 commit into from Jun 17, 2022

Conversation

vimalk78
Copy link
Contributor

@vimalk78 vimalk78 commented Jun 9, 2022

Description

Fixes Kafka Sasl for vector.

Tested scenarios

  • sasl
  • sasl + ssl
  • ssl
  • mutual ssl
  • without tls

/cc @alanconway @jcantrill
/assign @alanconway

/cherry-pick

Links

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 9, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vimalk78

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 9, 2022
@vimalk78
Copy link
Contributor Author

vimalk78 commented Jun 9, 2022

/retest

1 similar comment
@vimalk78
Copy link
Contributor Author

vimalk78 commented Jun 9, 2022

/retest

Copy link
Contributor

@alanconway alanconway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One concern - username, password and mechanism are all optional, it looks like this may generate bad config when they are missing - e.g. in vector configuration I don't think username="" is equivalent to having no username. Otherwise looks good.

TLSConf(o, secret),
SASLConf(o, secret),
TlsConf(o, secret),
SaslConf(o, secret),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be TLSConf and SASLConf. Convention is that common "initialisms" like TLS should be all caps or all lowercase (at the start of unexported name) but never mixed. I can't find the relevant style guide right now but you see it in standard package names like net.DNSError or net.IPAddr.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

if security.HasPassphrase(secret) {
pp := Passphrase{
PassphrasePath: security.SecretPath(o.Secret.Name, constants.Passphrase),
}
conf = append(conf, pp)
hasTls = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hasTls = true
hasTLS = true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

# {{.Desc}}
[sinks.{{.ComponentID}}.sasl]
{{- end}}`
enabled = true
username = "{{.Username}}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if username/password are missing/empty? Is username = "" the same as no username?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this configuration is mainly for SASL/PLAIN , which needs username/password
We could add a verification step to check username/password is always configured in secret, if SASL/PLAIN is configured

@vimalk78
Copy link
Contributor Author

/retest

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 14, 2022
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 16, 2022
@cahartma
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 17, 2022

@vimalk78: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-ci openshift-ci bot merged commit 238677b into openshift:master Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants