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

k8s: broker_tls is enabled only if internal listener has tls #8057

Merged
merged 2 commits into from
Jan 6, 2023

Conversation

alenkacz
Copy link
Contributor

@alenkacz alenkacz commented Jan 5, 2023

currently we set broker_tls to enabled even if internal listener does not have tls.

broker_tls:
        enabled: true

Backports Required

  • none - not a bug fix
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v22.3.x
  • v22.2.x
  • v22.1.x

UX Changes

None

Release Notes

Bug Fixes

@alenkacz alenkacz requested a review from a team as a code owner January 5, 2023 19:14
RafalKorepta
RafalKorepta previously approved these changes Jan 5, 2023
@@ -251,6 +252,9 @@ func (cc *ClusterCertificates) prepareAPI(
return tlsDisabledAPICertificates(), nil
}
result := tlsEnabledAPICertificates(cc.pandaCluster.Namespace)
if internalTLSListener != nil {
result.internalTlsEnabled = true
Copy link
Member

@BenPope BenPope Jan 5, 2023

Choose a reason for hiding this comment

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

I don't know the code very well, but perhaps:

Suggested change
result.internalTlsEnabled = true
tls = internalTLSListener.GetTLS()
if tls != nil {
result.internalTlsEnabled = tls.Enabled
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

func getInternalTLSListener(listeners []APIListener) APIListener {
	tlsListeners := getTLSListeners(listeners)
	for _, l := range tlsListeners {
		if ext := l.GetExternal(); ext == nil || !ext.Enabled {
			return l
		}
	}
	return nil
}

func getTLSListeners(listeners []APIListener) []APIListener {
	res := []APIListener{}
	for i, el := range listeners {
		tlsConfig := el.GetTLS()
		if tlsConfig != nil && tlsConfig.Enabled {
			res = append(res, listeners[i])
		}
	}
	return res
}

it's already handled here

@piyushredpanda piyushredpanda added this to the ST.drop milestone Jan 6, 2023
alenkacz added a commit to alenkacz/redpanda that referenced this pull request Jan 6, 2023
@RafalKorepta RafalKorepta merged commit 54bccf3 into redpanda-data:dev Jan 6, 2023
alenkacz added a commit to alenkacz/redpanda that referenced this pull request Jan 6, 2023
@alenkacz
Copy link
Contributor Author

alenkacz commented Jan 6, 2023

/backport v22.3.x

alenkacz added a commit to alenkacz/redpanda that referenced this pull request Jan 6, 2023
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this pull request Mar 1, 2023
This regression has been fixed in
redpanda-data#8057.

(cherry picked from commit 7af6a9a)
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Mar 2, 2023
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Mar 2, 2023
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Mar 2, 2023
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Mar 3, 2023
RafalKorepta pushed a commit to joejulian/redpanda that referenced this pull request Mar 6, 2023
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Mar 10, 2023
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Mar 10, 2023
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Mar 10, 2023
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Mar 24, 2023
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Apr 12, 2023
This regression has been fixed in
redpanda-data#8057.

(cherry picked from commit 7af6a9a)
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Apr 12, 2023
This regression has been fixed in
redpanda-data#8057.

(cherry picked from commit 7af6a9a)
joejulian pushed a commit to joejulian/redpanda that referenced this pull request Apr 13, 2023
This regression has been fixed in
redpanda-data#8057.

(cherry picked from commit 7af6a9a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants