Skip to content

NE-2449: add netedge tool and get_coredns_config#131

Merged
matzew merged 3 commits intoopenshift:mainfrom
bentito:feat/netedge-coredns
Feb 10, 2026
Merged

NE-2449: add netedge tool and get_coredns_config#131
matzew merged 3 commits intoopenshift:mainfrom
bentito:feat/netedge-coredns

Conversation

@bentito
Copy link

@bentito bentito commented Feb 3, 2026

This PR introduces the netedge toolset for Network Ingress & DNS troubleshooting, starting with a specialized tool to inspect CoreDNS configuration.

Changes:

  • New Toolset: Created pkg/toolsets/netedge to house network edge diagnostic tools.
  • New Tool (get_coredns_config):
    • Implements a read-only tool to retrieve the active CoreDNS configuration.
    • Specifically targets the dns-default ConfigMap in the openshift-dns namespace to extract the Corefile.
    • Utilizes a controller-runtime client for Kubernetes interactions, setting a pattern for future tools in this set.
    • Configured with OpenWorldHint: true to allow broad usage in troubleshooting contexts.
  • Testing: Added unit tests using controller-runtime's fake client to verify handler logic (ConfigMap retrieval, error handling for missing keys/resources) without requiring a live cluster.
  • Dependencies: Updated vendor/ to include controller-runtime/pkg/client/fake and related packages to support the new testing pattern.

Update Kubernetes client-go apply configurations and controller-runtime fake client.

Signed-off-by: bentito <btofel@redhat.com>
@openshift-ci openshift-ci bot requested review from Cali0707 and matzew February 3, 2026 21:14
@openshift-ci
Copy link

openshift-ci bot commented Feb 3, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bentito
Once this PR has been reviewed and has the lgtm label, please assign manusa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: bentito <btofel@redhat.com>
Signed-off-by: bentito <btofel@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Feb 3, 2026

@bentito: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security 309061c link false /test security

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@bentito bentito changed the title feat: add netedge tool and get_coredns_config NE-2449: add netedge tool and get_coredns_config Feb 4, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 4, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 4, 2026

@bentito: This pull request references NE-2449 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

This PR introduces the netedge toolset for Network Ingress & DNS troubleshooting, starting with a specialized tool to inspect CoreDNS configuration.

Changes:

  • New Toolset: Created pkg/toolsets/netedge to house network edge diagnostic tools.
  • New Tool (get_coredns_config):
    • Implements a read-only tool to retrieve the active CoreDNS configuration.
    • Specifically targets the dns-default ConfigMap in the openshift-dns namespace to extract the Corefile.
    • Utilizes a controller-runtime client for Kubernetes interactions, setting a pattern for future tools in this set.
    • Configured with OpenWorldHint: true to allow broad usage in troubleshooting contexts.
  • Testing: Added unit tests using controller-runtime's fake client to verify handler logic (ConfigMap retrieval, error handling for missing keys/resources) without requiring a live cluster.
  • Dependencies: Updated vendor/ to include controller-runtime/pkg/client/fake and related packages to support the new testing pattern.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@bentito
Copy link
Author

bentito commented Feb 4, 2026

/jira-refresh

1 similar comment
@bentito
Copy link
Author

bentito commented Feb 4, 2026

/jira-refresh

}

cm := &corev1.ConfigMap{}
err = cl.Get(params.Context, types.NamespacedName{Name: "dns-default", Namespace: "openshift-dns"}, cm)
Copy link
Member

Choose a reason for hiding this comment

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

I guess this is anyways just OCP - hence the hardcoded ns value is ok?

"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
)

Copy link
Member

Choose a reason for hiding this comment

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

Could we group the tests to use the testify/suite pattern, as mentioned on the AGENTS.md file?

e.g. like

  type CoreDNSSuite struct {
      suite.Suite
  }

and have tests registered on that CoreDNSSuite ?

@matzew
Copy link
Member

matzew commented Feb 4, 2026

I guess this conflicts with your "prometheus" PR (e.g. pkg/toolsets/netedge/toolset.go 😅 ) - so do you want this in before the other? just wondering

@matzew matzew merged commit 5e4eb74 into openshift:main Feb 10, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments