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

zplugin.go isn't generated correctly with third-party plugins #6691

Closed
gcs278 opened this issue May 20, 2024 · 0 comments · Fixed by #6692
Closed

zplugin.go isn't generated correctly with third-party plugins #6691

gcs278 opened this issue May 20, 2024 · 0 comments · Fixed by #6692
Labels

Comments

@gcs278
Copy link
Contributor

gcs278 commented May 20, 2024

What happened:

When running make gen or go generate coredns.go with a third-party external CoreDNS plugin enabled, the zplugin.go will cause the TestImportOrdering unit test to fail. This is because the logic in directives_generate.go does not separate third-party external plugins from CoreDNS plugins in the go import block. This leads to the TestImportOrdering unit test failing, as it requires that third-party imports paths should be in a separate import block.

What you expected to happen:

go generate coredns.go should generate zplugin.go according to the standards enforced in TestImportOrdering.

How to reproduce it (as minimally and precisely as possible):

  1. Add an external plugin to CoreDNS by adding it to plugin.cfg, e.g. add ocp_dnsnameresolver:github.com/openshift/coredns-ocp-dnsnameresolver anywhere in plugin.cfg.
  2. Run TestImportOrdering unit test:
    === RUN   TestImportOrdering
     presubmit_test.go:195: import path for "github.com/openshift/coredns-ocp-dnsnameresolver" is not of the same type 
    "coredns" in "/home/gspence/src/github.com/coredns/coredns/core/plugin/zplugin.go"
    --- FAIL: TestImportOrdering (0.13s)
    

Anything else we need to know?:

While this issue does not affect the main CoreDNS repo, it can cause unit test failures in forks of CoreDNS that include external third-party plugins. So I understand it's a low priority.

Environment:

  • the version of CoreDNS: 1.11.3
  • Corefile: N/A
  • logs, if applicable: N/A
  • OS (e.g: cat /etc/os-release): N/A
  • Others: N/A
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 a pull request may close this issue.

1 participant