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

Implement spec.uid for GrafanaContactPoint #1730

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

Baarsgaard
Copy link
Contributor

@Baarsgaard Baarsgaard commented Oct 27, 2024

While implementing this, I noticed a lot of discrepancies between the ContactPoint CR and the others.
Once this is merged I'll open a PR fixing the missing error logs when ContactPoints fail to reconcile as well as implementing the same Status fields that other CRs use. (See: 7e81cb4)

Manual Testing

make start-kind
kind export kubeconfig --name kind-grafana
kubectl delete grafana-operator --all
kubectl apply -f tests/example-resources.yaml
kubectl apply -f tmp.yml # See resources below
kubectl port-forward svc/grafana-testdata-service 3000 >/dev/null &
# Open http://localhost:3000/alerting/notifications
# username: root
# password: secret


# See that the default and two new contact points are present.
# Exporting all of them should show 3 UIDs
# Empty string, generated, and spec-uid
# Repeatedly deleting and applying tmp.yml should result in a new UID for the generated one.

tmp.yml

---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaContactPoint
metadata:
  name: metadata-uid
  namespace: default
spec:
  resyncPeriod: 3s
  instanceSelector:
    matchLabels:
      test: testdata
  name: metadata-uid
  type: email
  settings:
    addresses: "[email protected]"
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaContactPoint
metadata:
  name: constant-uid
  namespace: default
spec:
  resyncPeriod: 3s
  instanceSelector:
    matchLabels:
      test: testdata
  uid: spec-uid
  name: spec-uid
  type: email
  settings:
    addresses: "[email protected]"

Copy link
Member

@theSuess theSuess left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I've replaced a reference to "folder" and will merge now!

@theSuess theSuess added this pull request to the merge queue Nov 11, 2024
Merged via the queue into grafana:master with commit 466366f Nov 11, 2024
14 checks passed
@Baarsgaard Baarsgaard deleted the contactpoint_uid branch November 11, 2024 10:46
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.

2 participants