Skip to content

Remove duplicate kubeconfig rewrite and unused crc-agent TLS helpers #29

Description

@caxu-rh

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-403
  • internal/resources/kubeconfig.go:51-68
  • cmd/crc-agent/tlsutil.go:52-202
  • cmd/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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions