Remove duplicate kubeconfig rewrite and unused crc-agent TLS helpers
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1
- Forks
- 0
- Avg merge
- 9h 55m
- Merged PRs (30d)
- 25
Description
Problem
cmd/crc-agent/main.go contains a map-based rewriteKubeconfigServer, while internal/resources/kubeconfig.go already provides the typed shared RewriteKubeconfigServer. The implementations differ: the agent copy silently skips malformed entries and does not clear insecure-skip-tls-verify, while the shared helper does.
cmd/crc-agent/tlsutil.go also contains unused CA, client-certificate, serving-certificate, and PEM helpers. Only TLSFromPEM is used, and it only wraps tls.X509KeyPair.
References
cmd/crc-agent/main.go:374-403internal/resources/kubeconfig.go:51-68cmd/crc-agent/tlsutil.go:52-202cmd/crc-agent/clusterclient.go:72-74
Suggested direction
Use the shared kubeconfig rewrite and remove the local duplicate. Remove unused TLS helpers and private constants, or call tls.X509KeyPair directly. Preserve tests for insecure flags, file-based CA data, and empty or malformed cluster entries.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare cmd/crc-agent/main.go:374-403 with internal/resources/kubeconfig.go:51-68, then inspect the TLS helpers in cmd/crc-agent/tlsutil.go:52-202 and their use from cmd/crc-agent/clusterclient.go:72-74. Reuse the shared kubeconfig rewrite, remove the unused helpers or direct wrapper, and preserve coverage for insecure flags, file-based CA data, and empty or malformed cluster entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, security
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100