-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add presubmit jobs tests and linting for sig-security tool srctl #36801
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- | ||
| presubmits: | ||
| kubernetes/sig-security: | ||
| - name: pull-sig-security-srctl-tests | ||
| cluster: eks-prow-build-cluster | ||
| annotations: | ||
| testgrid-dashboards: sig-security-srctl | ||
| testgrid-create-test-group: "true" | ||
| description: Run unit tests for srctl | ||
| run_if_changed: "^sig-security-tooling/srctl/" | ||
| branches: | ||
| - main | ||
| decorate: true | ||
| spec: | ||
| containers: | ||
| - image: public.ecr.aws/docker/library/golang:1.25@sha256:ed520ab5bed37ce887012c050ced60f7d52dfcd212e3dc6fdd8951e9c4e25c1a | ||
| command: ['go'] | ||
| workingDir: sig-security-tooling/srctl | ||
| args: ['test', '-v', '-cover', './...'] | ||
| resources: | ||
| limits: | ||
| cpu: 1 | ||
| memory: "256Mi" | ||
| requests: | ||
| cpu: 1 | ||
| memory: "256Mi" | ||
|
|
||
| - name: pull-sig-security-srctl-lint | ||
| cluster: eks-prow-build-cluster | ||
| annotations: | ||
| testgrid-dashboards: sig-security-srctl | ||
| testgrid-create-test-group: "true" | ||
| description: Run linters for srctl | ||
| run_if_changed: "^sig-security-tooling/srctl/" | ||
| branches: | ||
| - main | ||
| decorate: true | ||
| spec: | ||
| containers: | ||
| - image: public.ecr.aws/docker/library/golang:1.25@sha256:ed520ab5bed37ce887012c050ced60f7d52dfcd212e3dc6fdd8951e9c4e25c1a | ||
| command: | ||
| - /bin/bash | ||
| - -c | ||
| - | | ||
| set -euo pipefail | ||
| cd sig-security-tooling/srctl | ||
| go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.4 | ||
|
Comment on lines
+44
to
+47
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe would be cool to have an image that already includes
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could try figuring out where Kubernetes keeps their images and try that, it would fit well. I'll ask what the test-infra slack thinks.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would strongly encourage moving this into the sig security repo and generally putting test target definitions and verisons there, as breifly discussed in the slack thread This makes it easier for contributors to reproduce, and makes it safe to iterate on the options and versions (because the PR that changes them will run the tests before merge) |
||
| export PATH=$PATH:$(go env GOPATH)/bin | ||
| golangci-lint run ./... | ||
| resources: | ||
| limits: | ||
| cpu: 1 | ||
| memory: "512Mi" | ||
| requests: | ||
| cpu: 1 | ||
| memory: "512Mi" | ||
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.
I've seen your comment
Tbh I'll use whatever is maintained by sig test-infra and they think is a good image. Maybe it would be interesting to ask them what they think is a good image for our use case?
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.
They told me the image I chose was fine.
https://kubernetes.slack.com/archives/C09QZ4DQB/p1776265122708969
On the flip side I do need to do some work on the golangci-lint side because the version for that that gets used should be decided in the source directory of srctl, not here in test-infra so I need to update that which means a PR over there combined with this PR being updated to take advantage of that.