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

cleanup: unexport kubernetes.Client method #1973

Merged
merged 2 commits into from Jun 9, 2022

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Jun 7, 2022

Signed-off-by: Jason Hall jason@chainguard.dev

The method is only used inside the package, and we shouldn't recommend folks depend on it, so let's unexport it.

The method encapsulates trying to create a k8s client from local environment config, and if one can't be found, it falls back to creating an in-cluster k8s client. This is used by both the policy controller, which uses the in-cluster config, and cosign generate-key-pair k8s://ns/secret-name, which may use a regular user config, or if run in a K8s cluster, would use the in-cluster config. As the policy controller moves out to its own repo we might want to consider just having it assume the in-cluster config.

This change also collapses three methods into one, for simplicity.

Release Note

NONE

Signed-off-by: Jason Hall <jason@chainguard.dev>
@codecov-commenter
Copy link

Codecov Report

Merging #1973 (93f6a28) into main (3ddce4c) will decrease coverage by 0.09%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1973      +/-   ##
==========================================
- Coverage   34.80%   34.70%   -0.10%     
==========================================
  Files         153      152       -1     
  Lines       10119    10078      -41     
==========================================
- Hits         3522     3498      -24     
+ Misses       6226     6210      -16     
+ Partials      371      370       -1     
Impacted Files Coverage Δ
pkg/cosign/kubernetes/client.go 0.00% <0.00%> (ø)
pkg/cosign/kubernetes/secret.go 37.34% <0.00%> (ø)
pkg/cosign/tuf/client.go 64.07% <0.00%> (-0.65%) ⬇️
cmd/cosign/cli/options/predicate.go 0.00% <0.00%> (ø)
pkg/cosign/tuf/store.go

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ddce4c...93f6a28. Read the comment docs.

Signed-off-by: Jason Hall <jason@chainguard.dev>
@dlorenc dlorenc merged commit c4afa21 into sigstore:main Jun 9, 2022
@github-actions github-actions bot added this to the v1.10.0 milestone Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants