Skip to content

Conversation

@abhijith-darshan
Copy link
Contributor

@abhijith-darshan abhijith-darshan commented Aug 15, 2025

notification-controller currently generates a TLS config for the underlying HTTP transport if Provider spec contains a certSecretRef.

Related to the following issues, notification-controller will also use the TLS config for mTLS GitHub App scenarios as well -

example:

apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Provider
....
spec:
  address: https://my.company.corp/org/repo
  certSecretRef:
    name: some-ca-secret # TLS config with custom ca is extracted from this secret
  secretRef:
    name: github-app-ca-secret # the ca.crt if present in this secret reference will be ignored
  type: github

TODOS:

  • ca.crt for TLS config should be generated from .spec.certSecretRef and if not specified then it should attempt to generate TLS config from .spec.secretRef (only if the provider is one of the git types)
  • Add relevant test cases
  • Update the docs regarding the ca.crt preference

Copy link
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

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

First pass 👌

@abhijith-darshan abhijith-darshan force-pushed the feat/gh_app_tls branch 3 times, most recently from 41a8320 to cb7dd16 Compare August 16, 2025 21:07
@matheuscscp matheuscscp marked this pull request as ready for review August 16, 2025 23:47
@matheuscscp
Copy link
Member

This is looking good, thanks! Please add docs and amend the commit message to match the PR title 🙏

Copy link
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

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

In the docs we must also mention that if a client cert is present, it will be used (just like we mentioned in the GitRepo docs)

This commit ensures that if GitHub app secret data contains ca.crt then a TLS config with user provided custom ca is used in the underlying HTTP transports. The ca.crt in GitHub App secretRef is ignored if certSecretRef is also provided.

Signed-off-by: abhijith-darshan <[email protected]>

(chore): keep Makefile in sync with other controllers

Signed-off-by: abhijith-darshan <[email protected]>

(chore): use proper func naming format

Signed-off-by: abhijith-darshan <[email protected]>

(chore): revert Makefile changes

Signed-off-by: abhijith-darshan <[email protected]>

(chore): add get secret helper

This commit creates a getSecret helper func which can be used to resolve secret. createNotifier re-uses this helper func to extract and pass secrets down to other methods

Signed-off-by: abhijith-darshan <[email protected]>

(chore): adds tls test cases

Signed-off-by: abhijith-darshan <[email protected]>

(chore): remove debug logs

Signed-off-by: abhijith-darshan <[email protected]>

(chore): adds documentation

Signed-off-by: abhijith-darshan <[email protected]>

(chore): update docs with mTLS info

Signed-off-by: abhijith-darshan <[email protected]>
Copy link
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@matheuscscp matheuscscp merged commit d7cba67 into fluxcd:main Aug 18, 2025
5 checks passed
@abhijith-darshan abhijith-darshan deleted the feat/gh_app_tls branch August 18, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants