Connect: add e2e tests for kube access - #65929
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c44ef78702
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
# Conflicts: # e2e/runner/go.mod # e2e/runner/go.sum
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7be48d178f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10b4bf2ea2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
18efb19 to
4277ef7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4277ef7288
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
E2E Test Results+ 61 passed
- 1 failed
! 1 flaky
# 5 skipped
# 2m 42sFailures
|
4277ef7 to
a100964
Compare
a100964 to
146a411
Compare
| return nil | ||
| } | ||
|
|
||
| func rewriteKubeconfigServerHost(kubeconfigPath, targetHost string) error { |
There was a problem hiding this comment.
I'm not an expert in Docker networking, so maybe I missed a simpler way.
The issue is that by default kind writes kubeconfig with an API server endpoint like https://127.0.0.1:<port>. That works fine when Teleport runs on the same host.
However, in CI, Teleport runs in a different container, so 127.0.0.1 resolves to Teleport's own loopback, not the kind API server.
A workaround is to rewrite kubeconfig to use a reachable host.
|
The failure at |
# Conflicts: # e2e/config/state.yaml.tmpl # e2e/runner/go.mod # e2e/runner/teleport.go
|
@ravicious @ryanclark I've resolved conflicts, please take a look when you get a chance |
| const kubeResourceName = /teleport-e2e-kube-/i; | ||
| const kubePromptText = 'Try "kubectl version" to test the connection.'; | ||
|
|
||
| async function openKubeTerminal( |
There was a problem hiding this comment.
Should this be a method on one of the pages instead?
There was a problem hiding this comment.
I think there's no good place to move it:
connectWithoutLoginbelongs toUnifiedResourcesPage.waitForTextbelongs toTerminalPage.
We would need a page that depends on both. I think it's fine to keep this function here until we need it in another place.
| await openKubeTerminal(resources, terminal); | ||
|
|
||
| const kubectlRunOutput = await terminal.execAndWait( | ||
| `${kubectlCommand} run ${podName} --image=busybox:1.37.0 --command -- sh -c 'sleep 3600'` |
There was a problem hiding this comment.
Won't this make each test run download a new image on every run? It'd be best to use something less intrusive if possible.
There was a problem hiding this comment.
Yeah it could make this test flaky. I replaced pulling an image with exec into kind's internal pod.
# Conflicts: # e2e/README.md # e2e/helpers/fixtures.ts # e2e/helpers/pages/UnifiedResources.ts # e2e/runner/fixtures/fixtures.go # e2e/runner/go.mod # e2e/runner/go.sum # e2e/runner/instance.go # e2e/runner/main.go
Unfortunately, I didn't have a chance to look into this, so I disabled the tests for now. I left a TODO for myself to (hopefully) re-enable them soon. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74f0fa8871
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…app-access-tbot * origin/master: (118 commits) Connect: add e2e tests for kube access (#65929) docs: Add 'sudo' to teleport-update uninstall command (#69618) MWI: issuance: Add UsageApp support to IssueScopedBotCerts (#69449) Fix TestNewWebSessionScopedTrustedDeviceRequirement flakiness (#69506) Deprecate recording of join metadata into bot instance record (#69571) Terraform: convert auto update version to generic provider (#69514) docs: entra id metrics (#69343) auth: Add v9 downgrade property tests (#68916) docs: address codex feedback for username trait in PingFederate role (#69589) Terraform: convert ui config to generic provider (#69507) waiting for kube server to land in unified resource cache before proceeding with test cases (#69619) Implement tctl observability (#67904) IAC SSH Server Namespacing support (#69542) Remove Firestore key migration (#69590) tfgen: support generating top-level access list scope field (#69337) mark bloat binary builds as dev builds so they do not require keys (#69609) Fix improper userca.pem concatenation by kinitProvider (#69582) Terraform: convert recording config to generic provider (#69491) Terraform: convert classifier to generic provider (#69423) Fix `teleport-investigate` and `teleport-access-review` skill inaccuracies (#69309) ...
The kube cluster is provided using https://kind.sigs.k8s.io/, and setting it up takes about 10 seconds on my machine. The kube service runs as part of the main Teleport process.
Manual Test Plan
Test Environment
pnpm start-teleportTest Cases