Skip to content

Refactor step and sidecar validation to implement apis.Validatable. #8700

@twoGiants

Description

@twoGiants

Note

This issue is done. It will be merged in small batches once #8685 is merged.

Summary

While working on issue #7442 in #8685 it stood out that step and sidecar validation is implemented inconsistent with the validation of the other core structs like Pipeline, PipelineSpec, Task, TaskSpec, etc.. They implement the apis.Validatable interface and are tested against the Validate method.

After merging of #8685 step and sidecar validation will be in container_validation.go but their tests in task_validation_test.go. They can not be moved without changing the scope of container_validation_test.go or making the step and sidecar validation functions public.

This refactoring should resolve the mentioned inconsistencies.

Tasks

Main branch with all the changes below commit by commit.

Steps

Sidecar

Test Coverage

go test ./pkg/apis/pipeline/v1 -coverprofile=coverage.out
go tool cover -html=coverage.out

/kind cleanup

/good-first-issue

/assign

Metadata

Metadata

Labels

area/testingIssues or PRs related to testinggoPull requests that update go codegood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions