mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-10 18:06:55 +00:00
* chore: Add a new field in the test results CRD to specify patched resources
- The currently existing PatchedResource field has a misleading name, leading to users believing that
it can only take a yaml containing a single resource. Another field with proper naming is added until this field is removed completely.
- Generate the new CRD from the struct.
Signed-off-by: aerosouund <aerosound161@gmail.com>
* Update cmd/cli/kubectl-kyverno/apis/v1alpha1/test_result.go
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* chore: use more chainsaw step templates (#11296)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
* chore(deps): bump golangci/golangci-lint-action from 6.1.0 to 6.1.1 (#11298)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.1.0 to 6.1.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](aaa42aa062...971e284b60
)
---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore: use more chainsaw step templates (#11300)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
* chore: use more chainsaw step templates (#11303)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
---------
Signed-off-by: aerosouund <aerosound161@gmail.com>
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: shuting <shuting@nirmata.com>
71 lines
2.9 KiB
Go
71 lines
2.9 KiB
Go
package v1alpha1
|
|
|
|
import (
|
|
policyreportv1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
|
|
)
|
|
|
|
// TestResultBase declares a test result base fields
|
|
type TestResultBase struct {
|
|
// Policy mentions the name of the policy.
|
|
Policy string `json:"policy"`
|
|
|
|
// Rule mentions the name of the rule in the policy.
|
|
// It's required in case policy is a kyverno policy.
|
|
// +optional
|
|
Rule string `json:"rule,omitempty"`
|
|
|
|
// IsValidatingAdmissionPolicy indicates if the policy is a validating admission policy.
|
|
// It's required in case policy is a validating admission policy.
|
|
// +optional
|
|
IsValidatingAdmissionPolicy bool `json:"isValidatingAdmissionPolicy,omitempty"`
|
|
|
|
// Result mentions the result that the user is expecting.
|
|
// Possible values are pass, fail and skip.
|
|
Result policyreportv1alpha2.PolicyResult `json:"result"`
|
|
|
|
// Kind mentions the kind of the resource on which the policy is to be applied.
|
|
Kind string `json:"kind"`
|
|
|
|
// Deprecated. Use `patchedResources` instead.
|
|
// PatchedResource takes a resource configuration file in yaml format from
|
|
// the user to compare it against the Kyverno mutated resource configuration.
|
|
PatchedResource string `json:"patchedResource,omitempty"`
|
|
|
|
// PatchedResource takes a resource configuration file in yaml format from
|
|
// the user to compare it against the Kyverno mutated resource configuration.
|
|
// Multiple resources can be passed in the same file
|
|
PatchedResources string `json:"patchedResources,omitempty"`
|
|
|
|
// GeneratedResource takes a resource configuration file in yaml format from
|
|
// the user to compare it against the Kyverno generated resource configuration.
|
|
GeneratedResource string `json:"generatedResource,omitempty"`
|
|
|
|
// CloneSourceResource takes the resource configuration file in yaml format
|
|
// from the user which is meant to be cloned by the generate rule.
|
|
CloneSourceResource string `json:"cloneSourceResource,omitempty"`
|
|
}
|
|
|
|
// TestResultBase declares a test result deprecated fields
|
|
type TestResultDeprecated struct {
|
|
// Status mentions the status that the user is expecting.
|
|
// Possible values are pass, fail and skip.
|
|
// This is DEPRECATED, use `Result` instead.
|
|
Status policyreportv1alpha2.PolicyResult `json:"status,omitempty"`
|
|
|
|
// Resource mentions the name of the resource on which the policy is to be applied.
|
|
// This is DEPRECATED, use `Resources` instead.
|
|
Resource string `json:"resource,omitempty"`
|
|
|
|
// Namespace mentions the namespace of the policy which has namespace scope.
|
|
// This is DEPRECATED, use a name in the form `<namespace>/<name>` for policies and/or resources instead.
|
|
Namespace string `json:"namespace,omitempty"`
|
|
}
|
|
|
|
// TestResultBase declares a test result
|
|
type TestResult struct {
|
|
TestResultBase `json:",inline,omitempty"`
|
|
TestResultDeprecated `json:",inline,omitempty"`
|
|
|
|
// Resources gives us the list of resources on which the policy is going to be applied.
|
|
Resources []string `json:"resources"`
|
|
}
|