-
Notifications
You must be signed in to change notification settings - Fork 1
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
[SA-6478] Add owner label as a prefix while creating integration #165
base: main
Are you sure you want to change the base?
Conversation
@John2020-cyber Yikes! You better fix it before anyone else finds out! Build has Failed! |
@John2020-cyber Image is available for testing. |
@John2020-cyber Yikes! You better fix it before anyone else finds out! Build has Failed! |
@John2020-cyber Yikes! You better fix it before anyone else finds out! Build has Failed! |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
ansible.builtin.set_fact: | ||
managed_clusters: "{{ managed_clusters | default([]) + [{'name': item.metadata.name}] }}" | ||
managed_clusters_create: "{{ managed_clusters_create | default([]) + [{'name': item.metadata.name}] }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the variable name can be changed to managed_clusters_labeled
@@ -34,6 +34,10 @@ | |||
kind: ManagedCluster | |||
register: managed_clusters_raw | |||
|
|||
- name: Initialize managed_clusters as an empty list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comments on each code block why you need this , like first initialize list then extract names of managed clusters .. currently code is not very understandable
@John2020-cyber Image is available for testing. |
@John2020-cyber Yikes! You better fix it before anyone else finds out! Build has Failed! |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Yikes! You better fix it before anyone else finds out! Build has Failed! |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
@John2020-cyber Image is available for testing. |
Functionality of added Code in the playbook:
This task automates the creation of Grafana OnCall integrations for managed clusters, based on a list of clusters to be integrated. It includes the following steps:
Extracts the list of managed clusters with their associated owners from managed_clusters.
Filters clusters that need integration based on predefined criteria.
Ensures that cluster names and owners are prefixed with name: and owner: to match the required format for integration creation.
Iterates over the filtered clusters, creating a new integration in Grafana OnCall for each relevant cluster.
The integration's name is dynamically constructed by concatenating the cluster name and owner (e.g., alpha-test-stakater).
Slack notification settings are configured for each integration, based on available configurations.