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

[SA-6478] Add owner label as a prefix while creating integration #165

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

John2020-cyber
Copy link
Contributor

@John2020-cyber John2020-cyber commented Dec 13, 2024

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:

  1. Data Preparation:

Extracts the list of managed clusters with their associated owners from managed_clusters.
Filters clusters that need integration based on predefined criteria.

  1. Prefix Handling:

Ensures that cluster names and owners are prefixed with name: and owner: to match the required format for integration creation.

  1. 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.

Copy link

@John2020-cyber Yikes! You better fix it before anyone else finds out! Build has Failed!

Copy link

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-5a9749ce

Copy link

@John2020-cyber Yikes! You better fix it before anyone else finds out! Build has Failed!

Copy link

@John2020-cyber Yikes! You better fix it before anyone else finds out! Build has Failed!

Copy link

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-bb6b8792

@John2020-cyber John2020-cyber changed the title Add owner label as a prefix while creating integration [SA-6478] Add owner label as a prefix while creating integration Dec 31, 2024
KhizerJaan
KhizerJaan previously approved these changes Dec 31, 2024
Copy link

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-216a83c1

KhizerJaan
KhizerJaan previously approved these changes Dec 31, 2024
Copy link

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-d80869f5

Copy link

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-316825fe

Copy link

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-5bba315e

ansible.builtin.set_fact:
managed_clusters: "{{ managed_clusters | default([]) + [{'name': item.metadata.name}] }}"
managed_clusters_create: "{{ managed_clusters_create | default([]) + [{'name': item.metadata.name}] }}"
Copy link
Contributor

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
Copy link
Contributor

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

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-bb371a90

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Yikes! You better fix it before anyone else finds out! Build has Failed!

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-4f4ba583

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-6993d794

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-04d450ac

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-fb5a916b

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-1155d1af

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-ba415907

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-ee54ea81

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-755288b6

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-f1f85c92

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Yikes! You better fix it before anyone else finds out! Build has Failed!

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-dddfba01

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-ad85cee4

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-83b7b1e7

Copy link

github-actions bot commented Jan 7, 2025

@John2020-cyber Image is available for testing. docker pull ghcr.io/stakater/grafana-cloud-ansible-operator:snapshot-pr-165-50b22c22

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