Commit 332d88db authored by Joe Betz's avatar Joe Betz

Generate proto bindings for: Pass {Operation}Option to Webhooks

parent 140c8c73
...@@ -90,6 +90,9 @@ func autoConvert_v1beta1_AdmissionRequest_To_admission_AdmissionRequest(in *v1be ...@@ -90,6 +90,9 @@ func autoConvert_v1beta1_AdmissionRequest_To_admission_AdmissionRequest(in *v1be
return err return err
} }
out.DryRun = (*bool)(unsafe.Pointer(in.DryRun)) out.DryRun = (*bool)(unsafe.Pointer(in.DryRun))
if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.Options, &out.Options, s); err != nil {
return err
}
return nil return nil
} }
...@@ -117,6 +120,9 @@ func autoConvert_admission_AdmissionRequest_To_v1beta1_AdmissionRequest(in *admi ...@@ -117,6 +120,9 @@ func autoConvert_admission_AdmissionRequest_To_v1beta1_AdmissionRequest(in *admi
return err return err
} }
out.DryRun = (*bool)(unsafe.Pointer(in.DryRun)) out.DryRun = (*bool)(unsafe.Pointer(in.DryRun))
if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.Options, &out.Options, s); err != nil {
return err
}
return nil return nil
} }
......
...@@ -42,6 +42,9 @@ func (in *AdmissionRequest) DeepCopyInto(out *AdmissionRequest) { ...@@ -42,6 +42,9 @@ func (in *AdmissionRequest) DeepCopyInto(out *AdmissionRequest) {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
if in.Options != nil {
out.Options = in.Options.DeepCopyObject()
}
return return
} }
......
...@@ -60,7 +60,8 @@ message AdmissionRequest { ...@@ -60,7 +60,8 @@ message AdmissionRequest {
// +optional // +optional
optional string namespace = 6; optional string namespace = 6;
// Operation is the operation being performed // Operation is the operation being performed. This may be different than the operation
// requested. e.g. a patch can result in either a CREATE or UPDATE Operation.
optional string operation = 7; optional string operation = 7;
// UserInfo is information about the requesting user // UserInfo is information about the requesting user
...@@ -78,6 +79,14 @@ message AdmissionRequest { ...@@ -78,6 +79,14 @@ message AdmissionRequest {
// Defaults to false. // Defaults to false.
// +optional // +optional
optional bool dryRun = 11; optional bool dryRun = 11;
// Options is the operation option structure of the operation being performed.
// e.g. `meta.k8s.io/v1.DeleteOptions` or `meta.k8s.io/v1.CreateOptions`. This may be
// different than the options the caller provided. e.g. for a patch request the performed
// Operation might be a CREATE, in which case the Options will a
// `meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`.
// +optional
optional k8s.io.apimachinery.pkg.runtime.RawExtension options = 12;
} }
// AdmissionResponse describes an admission response. // AdmissionResponse describes an admission response.
......
...@@ -35,11 +35,12 @@ var map_AdmissionRequest = map[string]string{ ...@@ -35,11 +35,12 @@ var map_AdmissionRequest = map[string]string{
"subResource": "SubResource is the name of the subresource being requested. This is a different resource, scoped to the parent resource, but it may have a different kind. For instance, /pods has the resource \"pods\" and the kind \"Pod\", while /pods/foo/status has the resource \"pods\", the sub resource \"status\", and the kind \"Pod\" (because status operates on pods). The binding resource for a pod though may be /pods/foo/binding, which has resource \"pods\", subresource \"binding\", and kind \"Binding\".", "subResource": "SubResource is the name of the subresource being requested. This is a different resource, scoped to the parent resource, but it may have a different kind. For instance, /pods has the resource \"pods\" and the kind \"Pod\", while /pods/foo/status has the resource \"pods\", the sub resource \"status\", and the kind \"Pod\" (because status operates on pods). The binding resource for a pod though may be /pods/foo/binding, which has resource \"pods\", subresource \"binding\", and kind \"Binding\".",
"name": "Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and rely on the server to generate the name. If that is the case, this method will return the empty string.", "name": "Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and rely on the server to generate the name. If that is the case, this method will return the empty string.",
"namespace": "Namespace is the namespace associated with the request (if any).", "namespace": "Namespace is the namespace associated with the request (if any).",
"operation": "Operation is the operation being performed", "operation": "Operation is the operation being performed. This may be different than the operation requested. e.g. a patch can result in either a CREATE or UPDATE Operation.",
"userInfo": "UserInfo is information about the requesting user", "userInfo": "UserInfo is information about the requesting user",
"object": "Object is the object from the incoming request prior to default values being applied", "object": "Object is the object from the incoming request prior to default values being applied",
"oldObject": "OldObject is the existing object. Only populated for UPDATE requests.", "oldObject": "OldObject is the existing object. Only populated for UPDATE requests.",
"dryRun": "DryRun indicates that modifications will definitely not be persisted for this request. Defaults to false.", "dryRun": "DryRun indicates that modifications will definitely not be persisted for this request. Defaults to false.",
"options": "Options is the operation option structure of the operation being performed. e.g. `meta.k8s.io/v1.DeleteOptions` or `meta.k8s.io/v1.CreateOptions`. This may be different than the options the caller provided. e.g. for a patch request the performed Operation might be a CREATE, in which case the Options will a `meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`.",
} }
func (AdmissionRequest) SwaggerDoc() map[string]string { func (AdmissionRequest) SwaggerDoc() map[string]string {
......
...@@ -38,6 +38,7 @@ func (in *AdmissionRequest) DeepCopyInto(out *AdmissionRequest) { ...@@ -38,6 +38,7 @@ func (in *AdmissionRequest) DeepCopyInto(out *AdmissionRequest) {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
in.Options.DeepCopyInto(&out.Options)
return return
} }
......
...@@ -46,7 +46,7 @@ message ConversionRequest { ...@@ -46,7 +46,7 @@ message ConversionRequest {
// ConversionResponse describes a conversion response. // ConversionResponse describes a conversion response.
message ConversionResponse { message ConversionResponse {
// `uid` is an identifier for the individual request/response. // `uid` is an identifier for the individual request/response.
// This should be copied over from the corresponding AdmissionRequest. // This should be copied over from the corresponding ConversionRequest.
optional string uid = 1; optional string uid = 1;
// `convertedObjects` is the list of converted version of `request.objects` if the `result` is successful otherwise empty. // `convertedObjects` is the list of converted version of `request.objects` if the `result` is successful otherwise empty.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment