1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

remove TUF initialization from main (#4098)

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
This commit is contained in:
Jim Bugwadia 2022-06-10 00:52:12 -07:00 committed by GitHub
parent 7f4f6d14fd
commit c3be689851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 19 deletions

View file

@ -404,11 +404,6 @@ func main() {
// the webhook server runs across all instances
openAPIController := startOpenAPIController(dynamicClient, stopCh)
if err := cosign.Init(); err != nil {
setupLog.Error(err, "initialization failed")
os.Exit(1)
}
// WEBHOOK
// - https server to provide endpoints called based on rules defined in Mutating & Validation webhook configuration
// - reports the results based on the response from the policy engine:

View file

@ -181,6 +181,9 @@ func buildCosignOptions(opts Options) (*cosign.CheckOpts, error) {
// if key, cert, and roots are not provided, default to Fulcio roots
if cosignOpts.RootCerts == nil {
cosignOpts.RootCerts = fulcio.GetRoots()
if cosignOpts.RootCerts == nil {
return nil, fmt.Errorf("failed to initialize roots")
}
}
}
}

View file

@ -1,14 +0,0 @@
package cosign
import (
"fmt"
"github.com/sigstore/cosign/cmd/cosign/cli/fulcio"
)
func Init() error {
if fulcio.GetRoots() == nil {
return fmt.Errorf("failed to initialize Fulcio roots")
}
return nil
}