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

Bug: Removing conditions from Policy spec does not delete conditions #74

Open
sanderblue opened this issue May 27, 2020 · 2 comments
Open
Labels
bug Something isn't working kubernetes

Comments

@sanderblue
Copy link
Contributor

sanderblue commented May 27, 2020

Current behavior

Deleting lines 10-22 from code snippet below, then running kubectl apply does not delete the NRQL alert condition.

apiVersion: nr.k8s.newrelic.com/v1
kind: Policy
metadata:
  name: my-policy
spec:
  api_key: {{ NEW_RELIC_API_KEY }}
  name: "Alert Policy Created With k8s"
  region: "us"
  # Remove everything below here
  conditions:
    - spec:
        name: "NRQL Alert Condition Created With k8s"
        nrql:
          query: "SELECT average(duration) FROM Transaction WHERE appName = 'Dummy App'"
          since_value: "3"
        enabled: true
        terms:
          - threshold: "5"
            time_function: "all"
            duration: "3"
            priority: "critical"
            operator: "above"

But, if you leave conditions: there, but leave it empty, it will delete the conditions from the policy.

From an earlier note: Removing the conditions property after creating a condition does NOT delete the condition when running kubectl apply, however, leaving the conditions property and leaving it empty will delete any previously created conditions on the policy.

Expected behavior

Removing the conditions attribute (and its children) should delete the alert conditions.

@sanderblue sanderblue added the bug Something isn't working label May 27, 2020
@thande
Copy link
Collaborator

thande commented Jun 2, 2020

@sanderblue - I just tested after my most recent work on the policy controller and this appears to be resolved. Can you please confirm and if so, close this issue?

@sanderblue
Copy link
Contributor Author

Sure thing. Will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kubernetes
Projects
None yet
Development

No branches or pull requests

3 participants