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

Make E2E tests hermetic #3499

Merged
merged 5 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/pkg/cosign/fulcio/fulcioroots/fulcioroots.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ func GetIntermediates() (*x509.CertPool, error) {
return intermediates, singletonRootErr
}

// ReInit reinitializes the global roots and intermediates, overriding the sync.Once lock.
// This is only to be used for tests, where the trust root environment variables may change after the roots are initialized in the module.
func ReInit() error {
roots, intermediates, singletonRootErr = initRoots()
return singletonRootErr
}

func initRoots() (*x509.CertPool, *x509.CertPool, error) {
rootPool := x509.NewCertPool()
// intermediatePool should be nil if no intermediates are found
Expand Down
Loading
Loading