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

FIX: Propagate Slack channel Override #459

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

jescarri
Copy link
Contributor

@jescarri jescarri commented Jul 9, 2024

This PR fixes a bug that prevents routing slack messages to the configured target channels.

Related to: #458

Testing done:

Config file:

slack:
  channels:
    - channel: kyverno-reports1
      customFields:
        cluster: TestCluster
      filter:
        namespaces:
          include:
          - team1-a
          - team1-b
        policies:
          include:
          - test-policy
        priorities:
          include: warning
      name: team1
      skipExistingOnStartup: false
      sources:
      - kyverno
      webhook: https://slack.webhook
    - channel: kyverno-reports2
      customFields:
        cluster: TestCluster
      filter:
        namespaces:
          include:
            - team2-a
        policies:
          include:
          - test-policy
        priorities:
          include: warning
      name: team2
      skipExistingOnStartup: false
      sources:
      - kyverno
      webhook: https://same-slack-webhook-as-team1

Output

{"L":"INFO","T":"2024-07-09 16:12:34","C":"config/resolver.go:87","M":"API BasicAuth enabled"}
{"L":"INFO","T":"2024-07-09 16:12:34","C":"config/target_factory.go:351","M":"team1 configured"}
{"L":"INFO","T":"2024-07-09 16:12:34","C":"config/target_factory.go:351","M":"team2 configured"}
{"L":"INFO","T":"2024-07-09 16:12:34","C":"cmd/run.go:152","M":"start client","worker":5}
{"L":"INFO","T":"2024-07-09 16:12:35","C":"kubernetes/policy_report_client.go:63","M":"informer sync completed"}
{"L":"INFO","T":"2024-07-09 16:12:35","C":"http/utils.go:51","M":"team1: PUSH OK"}
{"L":"INFO","T":"2024-07-09 16:12:35","C":"http/utils.go:51","M":"team2: PUSH OK"}
{"L":"INFO","T":"2024-07-09 16:12:35","C":"http/utils.go:51","M":"team2: PUSH OK"}

Slack messages are routed properly

This PR fixes a bug that prevents routing slack messages
to the configured target channels.

Related to: kyverno#458

Signed-off-by: Jesus Carrillo <jesuscarrillo8@gmail.com>
@jescarri jescarri force-pushed the fix/slack_channel_override branch from 26be8af to 8025abe Compare July 9, 2024 23:18
@fjogeleit fjogeleit merged commit 397b7e2 into kyverno:main Jul 10, 2024
3 checks passed
@fjogeleit
Copy link
Member

thanks, will try to release a fixed version end of the week

@jescarri
Copy link
Contributor Author

you are welcome thanks for the quick merge.

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.

None yet

2 participants