Skip to content

Commit

Permalink
fix: restore code
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Nov 12, 2024
1 parent 5ee8970 commit cecd18e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions test/e2e/internal/notation/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/internal/notation/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand All @@ -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),
)
Expand All @@ -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),
)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/internal/notation/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit cecd18e

Please sign in to comment.