Skip to content

Commit

Permalink
fix: notation validator only on docker driver
Browse files Browse the repository at this point in the history
  • Loading branch information
mxab committed Jan 2, 2024
1 parent 1e0e64d commit 7bd29ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions admissionctrl/validator/notation_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ type NotationValidator struct {
func (v *NotationValidator) Validate(job *api.Job) ([]error, error) {
for _, tg := range job.TaskGroups {
for _, task := range tg.Tasks {
// check if the task driver is docker
// should we consider podman?
if task.Driver != "docker" {
continue
}

image, ok := task.Config["image"].(string)
if !ok {
continue
Expand Down
1 change: 1 addition & 0 deletions admissionctrl/validator/notation_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func TestNotationValidatorValidate(t *testing.T) {
}{
{
driver: "magic",
image: "invalidimage:latest",
},
},
expectedErrors: nil,
Expand Down

0 comments on commit 7bd29ee

Please sign in to comment.