diff --git a/test/e2e/internal/notation/file.go b/test/e2e/internal/notation/file.go index 3dc6d7a4..049f36a9 100644 --- a/test/e2e/internal/notation/file.go +++ b/test/e2e/internal/notation/file.go @@ -19,8 +19,8 @@ import ( "os" ) -// CopyFile copies the source file to the destination file -func CopyFile(src, dst string) error { +// copyFile copies the source file to the destination file +func copyFile(src, dst string) error { in, err := os.Open(src) if err != nil { return err diff --git a/test/e2e/internal/notation/host.go b/test/e2e/internal/notation/host.go index 8128cc5b..0ad17854 100644 --- a/test/e2e/internal/notation/host.go +++ b/test/e2e/internal/notation/host.go @@ -231,7 +231,7 @@ func AddTimestampTrustStoreOption(namedstore string, srcCertPath string) utils.H // AddTrustPolicyOption adds a valid trust policy for testing. func AddTrustPolicyOption(trustpolicyName string) utils.HostOption { return func(vhost *utils.VirtualHost) error { - return CopyFile( + return copyFile( filepath.Join(NotationE2ETrustPolicyDir, trustpolicyName), vhost.AbsolutePath(NotationDirName, TrustPolicyName), ) @@ -241,7 +241,7 @@ func AddTrustPolicyOption(trustpolicyName string) utils.HostOption { // AddConfigJsonOption adds a valid config.json for testing. func AddConfigJsonOption(configJsonName string) utils.HostOption { return func(vhost *utils.VirtualHost) error { - return CopyFile( + return copyFile( filepath.Join(NotationE2EConfigJsonDir, configJsonName), vhost.AbsolutePath(NotationDirName, ConfigJsonName), ) @@ -262,7 +262,7 @@ func AddPlugin(pluginPath string) utils.HostOption { if err := os.MkdirAll(e2ePluginDir, 0700); err != nil { return err } - return CopyFile( + return copyFile( NotationE2EPluginPath, filepath.Join(e2ePluginDir, "notation-"+PluginName), ) diff --git a/test/e2e/internal/notation/key.go b/test/e2e/internal/notation/key.go index efa9f581..fd11a385 100644 --- a/test/e2e/internal/notation/key.go +++ b/test/e2e/internal/notation/key.go @@ -68,10 +68,10 @@ func AddKeyPairs(destNotationConfigDir, srcKeyPath, srcCertPath string) error { os.MkdirAll(localKeysDir, 0700) // copy key and cert files - if err := CopyFile(srcKeyPath, filepath.Join(localKeysDir, keyName)); err != nil { + if err := copyFile(srcKeyPath, filepath.Join(localKeysDir, keyName)); err != nil { return err } - return CopyFile(srcCertPath, filepath.Join(localKeysDir, certName)) + return copyFile(srcCertPath, filepath.Join(localKeysDir, certName)) } // generateSigningKeys generates the signingkeys.json for notation.