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

feat(test): introduce a test that executes the validatingwebhook #168

Merged
merged 10 commits into from
Aug 16, 2023
Merged

Conversation

diranged
Copy link
Owner

@diranged diranged commented Aug 16, 2023

Closes #167.

In #151 we updated some libraries and we missed the fact that kubernetes-sigs/controller-runtime#2134 removed the InjectDecoder call entirely. This PR implements a live test of the CONNECT functionality, as well as fixes for the decoder.

@coveralls
Copy link

coveralls commented Aug 16, 2023

Pull Request Test Coverage Report for Build 5882619350

  • 1 of 2 (50.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 46.158%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/controllers/podwatcher/types.go 0 1 0.0%
Totals Coverage Status
Change from base Build 5862057232: 0.07%
Covered Lines: 967
Relevant Lines: 2095

💛 - Coveralls

@diranged
Copy link
Owner Author

This test fails as-expected:

oz-controller PodAccessTemplate / PodAccessRequest [It] Should allow CONNECTing to the Pod
/Users/diranged/go/src/github.com/diranged/oz/internal/testing/e2e/e2e_test.go:205

  [FAILED] Unexpected error:
      <*errors.errorString | 0x1400059f440>: 
      kubectl exec -ti -n oz-system deployment-example-35f6c845 -- whoami failed with error: (exit status 1) Unable to use a TTY - input is not a terminal or the right kind of file
      Error from server (InternalError): Internal error occurred: failed calling webhook "vpod.kb.io": failed to call webhook: Post "https://oz-webhook-service.oz-system.svc:443/watch-v1-pod?timeout=10s": EOF
      
      {
          s: "kubectl exec -ti -n oz-system deployment-example-35f6c845 -- whoami failed with error: (exit status 1) Unable to use a TTY - input is not a terminal or the right kind of file\nError from server (InternalError): Internal error occurred: failed calling webhook \"vpod.kb.io\": failed to call webhook: Post \"https://oz-webhook-service.oz-system.svc:443/watch-v1-pod?timeout=10s\": EOF\n",
      }
  occurred
  In [It] at: /Users/diranged/go/src/github.com/diranged/oz/internal/testing/e2e/e2e_test.go:232 @ 08/16/23 06:45:04.167

I'll be merging this as is, to intentionally break main... then I will fix main.d

@github-actions github-actions bot added the github_actions Pull requests that update GitHub Actions code label Aug 16, 2023
@diranged diranged merged commit df43a3e into main Aug 16, 2023
16 checks passed
@diranged diranged deleted the test branch August 16, 2023 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build github_actions Pull requests that update GitHub Actions code repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

admission webhook controller throwing exception in 0.1.0 release
2 participants