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

[workloadmeta/kubeapiserver] Add missing types to Delete() in reflectorStore #27039

Merged

Conversation

davidor
Copy link
Member

@davidor davidor commented Jun 25, 2024

What does this PR do?

Fixes a bug in the kubeapiserver workloadmeta collector.

It doesn't delete kube metadata objects and shows an error like this one:

workloadmeta-kubeapiserver: unable to delete watch event object

I also added some test cases that cover this.

Describe how to test/QA your changes

Enable kubernetes metadata collection. Any object will do, for example, namespaces. You can use this config when deploying with the Helm chart:

datadog:
  kubelet:
    tlsVerify: false
clusterAgent:
  env:
    - name: DD_CLUSTER_AGENT_KUBE_METADATA_COLLECTION_ENABLED
      value: true
    - name: DD_CLUSTER_AGENT_KUBE_METADATA_COLLECTION_RESOURCES
      value: namespaces

Then create a namespace. For example: kubectl create namespace example and check that it shows in the cluster-agent datadog-cluster-agent workload-list. Then, delete the namespace and check that the error pasted above doesn't appear in the logs and the namespace no longer appears in datadog-cluster-agent workload-list.

@davidor davidor added this to the 7.56.0 milestone Jun 25, 2024
@davidor davidor requested a review from a team as a code owner June 25, 2024 10:23
case *corev1.Pod:
uid = v.UID
case *corev1.Node:
Copy link
Member Author

Choose a reason for hiding this comment

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

Nodes and namespaces were migrated to the new generic collector, so they're no longer needed here.

@davidor
Copy link
Member Author

davidor commented Jun 25, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jun 25, 2024

🚂 MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.

Use /merge -c to cancel this operation!

@pr-commenter
Copy link

pr-commenter bot commented Jun 25, 2024

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv create-vm --pipeline-id=37490912 --os-family=ubuntu

Note: This applies to commit 810d210

@dd-devflow
Copy link

dd-devflow bot commented Jun 25, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in main is 25m.

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot merged commit 752f294 into main Jun 25, 2024
221 of 238 checks passed
@dd-mergequeue dd-mergequeue bot deleted the davidor/contp-274-missing-types-reflector-store-delete branch June 25, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants