-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kazel K8sOpenAPIGen should respect SkippedPaths too #32
Conversation
ok, tested. pretty sure this works now. |
kazel/generator.go
Outdated
@@ -52,6 +52,11 @@ func (v *Vendorer) walkGenerated() error { | |||
// findOpenAPI searches for all packages under root that request OpenAPI. It | |||
// returns the go import paths. It does not follow symlinks. | |||
func (v *Vendorer) findOpenAPI(root string) ([]string, error) { | |||
for _, r := range v.skippedPaths { | |||
if r.Match([]byte(root)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r.MatchString(root)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. fixed similar calls elsewhere, too.
@@ -42,7 +42,7 @@ func (v *Vendorer) walkGenerated() error { | |||
return nil | |||
} | |||
v.managedAttrs = append(v.managedAttrs, "openapi_targets", "vendor_targets") | |||
paths, err := v.findOpenAPI(v.root) | |||
paths, err := v.findOpenAPI(".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SkippedPaths
uses relative paths, so the regexes won't match unless we use a relative path consistently. We use relative paths (i.e. .
) for both walk()
and walkSource()
, so this was the odd one out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and we chdir
to v.root
so .
will be valid)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
/lgtm |
tested, seems to still work. |
Automatic merge from submit-queue (batch tested with PRs 49869, 47987, 50211, 50804, 50583) Bump repo-infra/kazel dependency **What this PR does / why we need it**: `kazel` shouldn't be looking under skipped paths (like `_output`) for openapi files. This was fixed in kubernetes/repo-infra#32 and now should be included here. I've tested locally that this now ignores everything under `_output`. **Release note**: ```release-note NONE ``` /assign @mikedanese @spxtr
update README to rST format
Some of the non-Bazel kubernetes build scripts toss Go source under
_output/dockerized/go
; we should not go looking for OpenAPI packages there.Still testing this (trying to figure out what set of steps actually copies code into
_output/dockerized/go
but I think this will work./assign @mikedanese @spxtr
cc @thockin @nikhita @sttts