Allow gorepomod to update plugin mod files

This commit is contained in:
Katrina Verey
2023-02-02 11:33:46 -05:00
parent 4fff8399ea
commit 8b51c295a1
2 changed files with 4 additions and 4 deletions

View File

@@ -36,7 +36,6 @@ var (
"docs", "docs",
"examples", "examples",
"hack", "hack",
"plugin",
"releasing", "releasing",
"site", "site",
} }

View File

@@ -45,6 +45,7 @@ func (dg *DotGitData) AbsPath() string {
// NewDotGitDataFromPath wants the incoming path to hold dotGit // NewDotGitDataFromPath wants the incoming path to hold dotGit
// E.g. // E.g.
//
// ~/gopath/src/sigs.k8s.io/kustomize // ~/gopath/src/sigs.k8s.io/kustomize
// ~/gopath/src/github.com/monopole/gorepomod // ~/gopath/src/github.com/monopole/gorepomod
func NewDotGitDataFromPath(path string) (*DotGitData, error) { func NewDotGitDataFromPath(path string) (*DotGitData, error) {
@@ -126,7 +127,7 @@ func (dg *DotGitData) checkModules(modules []*protoModule) error {
} }
} else { } else {
// Do the relative path and short name make sense? // Do the relative path and short name make sense?
if !strings.HasSuffix(pm.PathToGoMod(), string(shortName)) { if !strings.HasPrefix(string(shortName), "plugin/") && !strings.HasSuffix(pm.PathToGoMod(), string(shortName)) {
return fmt.Errorf( return fmt.Errorf(
"in %q, the module name %q doesn't match the file's pathToGoMod %q", "in %q, the module name %q doesn't match the file's pathToGoMod %q",
file, shortName, pm.PathToGoMod()) file, shortName, pm.PathToGoMod())