mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-08-08 19:20:38 +00:00
imagepolicy: enable commentstart kube-api-linter rule
Enable the commentstart kube-api-linter rule for the imagepolicy API group by dropping it from the rule's exclusion list and updating the field godoc comments to start with the serialized (JSON) field name, as the rule requires. This is part of the wider effort to enable kube-api-linter rules on the built-in API groups one group at a time.
This commit is contained in:
@@ -147,7 +147,7 @@ linters:
|
||||
# Commentstart - Ignore commentstart issues for existing API group
|
||||
# TODO: For each existing API group, we aim to remove it over time.
|
||||
- text: "godoc for field .* should start with '.* ...'"
|
||||
path: "staging/src/k8s.io/api/(apps|batch|certificates|core|extensions|flowcontrol|imagepolicy|networking|resource|scheduling|storage|storagemigration)"
|
||||
path: "staging/src/k8s.io/api/(apps|batch|certificates|core|extensions|flowcontrol|networking|resource|scheduling|storage|storagemigration)"
|
||||
|
||||
# notimestamp: Legacy 'Timestamp' fields retained for backward compatibility
|
||||
- text: 'notimestamp: naming convention "notimestamp": field TokenRequestStatus.ExpirationTimestamp: prefer use of the term ''time'' over ''timestamp'''
|
||||
|
||||
@@ -162,7 +162,7 @@ linters:
|
||||
# Commentstart - Ignore commentstart issues for existing API group
|
||||
# TODO: For each existing API group, we aim to remove it over time.
|
||||
- text: "godoc for field .* should start with '.* ...'"
|
||||
path: "staging/src/k8s.io/api/(apps|batch|certificates|core|extensions|flowcontrol|imagepolicy|networking|resource|scheduling|storage|storagemigration)"
|
||||
path: "staging/src/k8s.io/api/(apps|batch|certificates|core|extensions|flowcontrol|networking|resource|scheduling|storage|storagemigration)"
|
||||
|
||||
# notimestamp: Legacy 'Timestamp' fields retained for backward compatibility
|
||||
- text: 'notimestamp: naming convention "notimestamp": field TokenRequestStatus.ExpirationTimestamp: prefer use of the term ''time'' over ''timestamp'''
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
# Commentstart - Ignore commentstart issues for existing API group
|
||||
# TODO: For each existing API group, we aim to remove it over time.
|
||||
- text: "godoc for field .* should start with '.* ...'"
|
||||
path: "staging/src/k8s.io/api/(apps|batch|certificates|core|extensions|flowcontrol|imagepolicy|networking|resource|scheduling|storage|storagemigration)"
|
||||
path: "staging/src/k8s.io/api/(apps|batch|certificates|core|extensions|flowcontrol|networking|resource|scheduling|storage|storagemigration)"
|
||||
|
||||
# notimestamp: Legacy 'Timestamp' fields retained for backward compatibility
|
||||
- text: 'notimestamp: naming convention "notimestamp": field TokenRequestStatus.ExpirationTimestamp: prefer use of the term ''time'' over ''timestamp'''
|
||||
|
||||
@@ -29,39 +29,39 @@ import (
|
||||
// +k8s:supportsSubresource="/status"
|
||||
type ImageReview struct {
|
||||
metav1.TypeMeta `json:""`
|
||||
// Standard object's metadata.
|
||||
// metadata is the standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
// +optional
|
||||
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
|
||||
// Spec holds information about the pod being evaluated
|
||||
// spec holds information about the pod being evaluated
|
||||
// +optional
|
||||
Spec ImageReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
|
||||
|
||||
// Status is filled in by the backend and indicates whether the pod should be allowed.
|
||||
// status is filled in by the backend and indicates whether the pod should be allowed.
|
||||
// +optional
|
||||
Status ImageReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
|
||||
}
|
||||
|
||||
// ImageReviewSpec is a description of the pod creation request.
|
||||
type ImageReviewSpec struct {
|
||||
// Containers is a list of a subset of the information in each container of the Pod being created.
|
||||
// containers is a list of a subset of the information in each container of the Pod being created.
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
Containers []ImageReviewContainerSpec `json:"containers,omitempty" protobuf:"bytes,1,rep,name=containers"`
|
||||
// Annotations is a list of key-value pairs extracted from the Pod's annotations.
|
||||
// annotations is a list of key-value pairs extracted from the Pod's annotations.
|
||||
// It only includes keys which match the pattern `*.image-policy.k8s.io/*`.
|
||||
// It is up to each webhook backend to determine how to interpret these annotations, if at all.
|
||||
// +optional
|
||||
Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,2,rep,name=annotations"`
|
||||
// Namespace is the namespace the pod is being created in.
|
||||
// namespace is the namespace the pod is being created in.
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"`
|
||||
}
|
||||
|
||||
// ImageReviewContainerSpec is a description of a container within the pod creation request.
|
||||
type ImageReviewContainerSpec struct {
|
||||
// This can be in the form image:tag or image@SHA:012345679abcdef.
|
||||
// image can be in the form image:tag or image@SHA:012345679abcdef.
|
||||
// +optional
|
||||
Image string `json:"image,omitempty" protobuf:"bytes,1,opt,name=image"`
|
||||
// In future, we may add command line overrides, exec health check command lines, and so on.
|
||||
@@ -69,15 +69,15 @@ type ImageReviewContainerSpec struct {
|
||||
|
||||
// ImageReviewStatus is the result of the review for the pod creation request.
|
||||
type ImageReviewStatus struct {
|
||||
// Allowed indicates that all images were allowed to be run.
|
||||
// allowed indicates that all images were allowed to be run.
|
||||
// +optional
|
||||
Allowed bool `json:"allowed" protobuf:"varint,1,opt,name=allowed"`
|
||||
// Reason should be empty unless Allowed is false in which case it
|
||||
// reason should be empty unless Allowed is false in which case it
|
||||
// may contain a short description of what is wrong. Kubernetes
|
||||
// may truncate excessively long errors when displaying to the user.
|
||||
// +optional
|
||||
Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"`
|
||||
// AuditAnnotations will be added to the attributes object of the
|
||||
// auditAnnotations will be added to the attributes object of the
|
||||
// admission controller request using 'AddAnnotation'. The keys should
|
||||
// be prefix-less (i.e., the admission controller will add an
|
||||
// appropriate prefix).
|
||||
|
||||
Reference in New Issue
Block a user