Deal with auto-generated files.

Signed-off-by: RainbowMango <renhongcai@huawei.com>
This commit is contained in:
RainbowMango 2021-04-08 11:56:43 +08:00 committed by Hongcai Ren
parent d870a2d85c
commit 12a19ab5e5
3 changed files with 152 additions and 0 deletions

View File

@ -41,6 +41,60 @@ spec:
description: Overriders represents the override rules that would apply
on resources
properties:
imageOverrider:
description: ImageOverrider represents the rules dedicated to
handling image overrides.
items:
description: ImageOverrider represents the rules dedicated to
handling image overrides.
properties:
component:
description: 'Component is part of image name. Basically
we presume an image can be make of ''[registry/]repository[:tag]''.
The registry could be: - k8s.gcr.io - fictional.registry.example:10443
The repository could be: - kube-apiserver - fictional/nginx
The tag cloud be: - latest - v1.19.1 - @sha256:dbcc1c35ac38df41fd2f5e4130b32ffdb93ebae8b3dbe638c23575912276fc9c'
enum:
- Registry
- Repository
- Tag
type: string
operator:
description: Operator represents the operator which will
apply on the image.
enum:
- add
- remove
- replace
type: string
predicate:
description: "Predicate filters images before applying the
rule. \n Defaults to nil, in that case, the system will
automatically detect image fields if the resource type
is Pod, ReplicaSet, Deployment or StatefulSet by following
rule: - Pod: spec/containers/<N>/image - ReplicaSet:
spec/template/spec/<N>/image - Deployment: spec/template/spec/<N>/image
\ - StatefulSet: spec/template/spec/<N>/image In addition,
all images will be processed if the resource object has
more than one containers. \n If not nil, only images matches
the filters will be processed."
properties:
path:
description: Path indicates the path of target field
type: string
required:
- path
type: object
value:
description: Value to be applied to image. Must not be empty
when operator is 'add' or 'replace'. Defaults to empty
and ignored when operator is 'remove'.
type: string
required:
- component
- operator
type: object
type: array
plaintext:
description: Plaintext represents override rules defined with
plaintext overriders.

View File

@ -41,6 +41,60 @@ spec:
description: Overriders represents the override rules that would apply
on resources
properties:
imageOverrider:
description: ImageOverrider represents the rules dedicated to
handling image overrides.
items:
description: ImageOverrider represents the rules dedicated to
handling image overrides.
properties:
component:
description: 'Component is part of image name. Basically
we presume an image can be make of ''[registry/]repository[:tag]''.
The registry could be: - k8s.gcr.io - fictional.registry.example:10443
The repository could be: - kube-apiserver - fictional/nginx
The tag cloud be: - latest - v1.19.1 - @sha256:dbcc1c35ac38df41fd2f5e4130b32ffdb93ebae8b3dbe638c23575912276fc9c'
enum:
- Registry
- Repository
- Tag
type: string
operator:
description: Operator represents the operator which will
apply on the image.
enum:
- add
- remove
- replace
type: string
predicate:
description: "Predicate filters images before applying the
rule. \n Defaults to nil, in that case, the system will
automatically detect image fields if the resource type
is Pod, ReplicaSet, Deployment or StatefulSet by following
rule: - Pod: spec/containers/<N>/image - ReplicaSet:
spec/template/spec/<N>/image - Deployment: spec/template/spec/<N>/image
\ - StatefulSet: spec/template/spec/<N>/image In addition,
all images will be processed if the resource object has
more than one containers. \n If not nil, only images matches
the filters will be processed."
properties:
path:
description: Path indicates the path of target field
type: string
required:
- path
type: object
value:
description: Value to be applied to image. Must not be empty
when operator is 'add' or 'replace'. Defaults to empty
and ignored when operator is 'remove'.
type: string
required:
- component
- operator
type: object
type: array
plaintext:
description: Plaintext represents override rules defined with
plaintext overriders.

View File

@ -212,6 +212,43 @@ func (in *FieldSelector) DeepCopy() *FieldSelector {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ImageOverrider) DeepCopyInto(out *ImageOverrider) {
*out = *in
if in.Predicate != nil {
in, out := &in.Predicate, &out.Predicate
*out = new(ImagePredicate)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageOverrider.
func (in *ImageOverrider) DeepCopy() *ImageOverrider {
if in == nil {
return nil
}
out := new(ImageOverrider)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ImagePredicate) DeepCopyInto(out *ImagePredicate) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePredicate.
func (in *ImagePredicate) DeepCopy() *ImagePredicate {
if in == nil {
return nil
}
out := new(ImagePredicate)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OverridePolicy) DeepCopyInto(out *OverridePolicy) {
*out = *in
@ -307,6 +344,13 @@ func (in *Overriders) DeepCopyInto(out *Overriders) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ImageOverrider != nil {
in, out := &in.ImageOverrider, &out.ImageOverrider
*out = make([]ImageOverrider, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}