Skip to content

Commit

Permalink
chore: remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyasdf committed Jul 18, 2023
1 parent a938989 commit 59ab8df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions cmd/image-syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var (
logPath, configFile, authFile, imageFile, defaultRegistry, defaultNamespace string
logPath, configFile, authFile, imageFile, defaultRegistry string

procNum, retries int

Expand Down Expand Up @@ -50,8 +50,6 @@ func init() {
RootCmd.PersistentFlags().StringVar(&logPath, "log", "", "log file path (default in os.Stderr)")
RootCmd.PersistentFlags().StringVar(&defaultRegistry, "registry", os.Getenv("DEFAULT_REGISTRY"),
"default destination registry url when destination registry is not given in the config file, can also be set with DEFAULT_REGISTRY environment value")
RootCmd.PersistentFlags().StringVar(&defaultNamespace, "namespace", os.Getenv("DEFAULT_NAMESPACE"),
"default destination namespace when destination namespace is not given in the config file, can also be set with DEFAULT_NAMESPACE environment value")
RootCmd.PersistentFlags().IntVarP(&procNum, "proc", "p", 5, "numbers of working goroutines")
RootCmd.PersistentFlags().IntVarP(&retries, "retries", "r", 2, "times to retry failed task")
RootCmd.PersistentFlags().StringArrayVar(&osFilterList, "os", []string{}, "os list to filter source tags, not works for docker v2 schema1 and OCI media")
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Config struct {
// only images with selected architecture can be sync
archFilterList []string

// If the destination registry and namespace is not provided,
// If the destination is not provided,
// the source image will be synchronized to defaultDestRegistry with origin repo name and tag.
defaultDestRegistry string
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/task/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (r *RuleTask) Run() ([]Task, string, error) {
r.destination = r.defaultDestRegistry + "/" +
sourceURLs[0].GetRepo()
} else {
return nil, "", fmt.Errorf("the default registry and namespace should not be nil if you want to use them")
return nil, "", fmt.Errorf("the default registry should not be nil if you want to use them")
}
}

Expand Down

0 comments on commit 59ab8df

Please sign in to comment.