mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-05-01 00:00:03 +08:00
Merge pull request #51321 from mengqiy/kubectl_apply_openapi
Automatic merge from submit-queue (batch tested with PRs 51321, 55969, 55039, 56183, 55976). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Kubectl apply and strategic merge patch using openapi - [x] support openapi in strategic merge patch - [x] test openapi in strategic merge patch - [x] kubectl apply use openapi to calculate diff be default. It will fall back to use baked-in types when openapi is not available. - [x] test openapi in kubectl apply Fixes: kubernetes/kubectl#55 ```release-note kubectl apply use openapi to calculate diff be default. It will fall back to use baked-in types when openapi is not available. ``` /assign @apelisse Kubernetes-commit: e412ad5393b8c949474b904616fc411c3aa478a9
This commit is contained in:
+1536
-1073
File diff suppressed because it is too large
Load Diff
+43
-3
@@ -2681,6 +2681,38 @@ message PodCondition {
|
||||
optional string message = 6;
|
||||
}
|
||||
|
||||
// PodDNSConfig defines the DNS parameters of a pod in addition to
|
||||
// those generated from DNSPolicy.
|
||||
message PodDNSConfig {
|
||||
// A list of DNS name server IP addresses.
|
||||
// This will be appended to the base nameservers generated from DNSPolicy.
|
||||
// Duplicated nameservers will be removed.
|
||||
// +optional
|
||||
repeated string nameservers = 1;
|
||||
|
||||
// A list of DNS search domains for host-name lookup.
|
||||
// This will be appended to the base search paths generated from DNSPolicy.
|
||||
// Duplicated search paths will be removed.
|
||||
// +optional
|
||||
repeated string searches = 2;
|
||||
|
||||
// A list of DNS resolver options.
|
||||
// This will be merged with the base options generated from DNSPolicy.
|
||||
// Duplicated entries will be removed. Resolution options given in Options
|
||||
// will override those that appear in the base DNSPolicy.
|
||||
// +optional
|
||||
repeated PodDNSConfigOption options = 3;
|
||||
}
|
||||
|
||||
// PodDNSConfigOption defines DNS resolver options of a pod.
|
||||
message PodDNSConfigOption {
|
||||
// Required.
|
||||
optional string name = 1;
|
||||
|
||||
// +optional
|
||||
optional string value = 2;
|
||||
}
|
||||
|
||||
// PodExecOptions is the query options to a Pod's remote exec call.
|
||||
// ---
|
||||
// TODO: This is largely identical to PodAttachOptions above, make sure they stay in sync and see about merging
|
||||
@@ -2905,10 +2937,12 @@ message PodSpec {
|
||||
// +optional
|
||||
optional int64 activeDeadlineSeconds = 5;
|
||||
|
||||
// Set DNS policy for containers within the pod.
|
||||
// One of 'ClusterFirstWithHostNet', 'ClusterFirst' or 'Default'.
|
||||
// Set DNS policy for the pod.
|
||||
// Defaults to "ClusterFirst".
|
||||
// To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.
|
||||
// Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.
|
||||
// DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.
|
||||
// To have DNS options set along with hostNetwork, you have to specify DNS policy
|
||||
// explicitly to 'ClusterFirstWithHostNet'.
|
||||
// +optional
|
||||
optional string dnsPolicy = 6;
|
||||
|
||||
@@ -3017,6 +3051,12 @@ message PodSpec {
|
||||
// The higher the value, the higher the priority.
|
||||
// +optional
|
||||
optional int32 priority = 25;
|
||||
|
||||
// Specifies the DNS parameters of a pod.
|
||||
// Parameters specified here will be merged to the generated DNS
|
||||
// configuration based on DNSPolicy.
|
||||
// +optional
|
||||
optional PodDNSConfig dnsConfig = 26;
|
||||
}
|
||||
|
||||
// PodStatus represents information about the status of a pod. Status may trail the actual
|
||||
|
||||
+44
-5
@@ -2431,6 +2431,11 @@ const (
|
||||
// determined by kubelet) DNS settings.
|
||||
DNSDefault DNSPolicy = "Default"
|
||||
|
||||
// DNSNone indicates that the pod should use empty DNS settings. DNS
|
||||
// parameters such as nameservers and search paths should be defined via
|
||||
// DNSConfig.
|
||||
DNSNone DNSPolicy = "None"
|
||||
|
||||
DefaultTerminationGracePeriodSeconds = 30
|
||||
)
|
||||
|
||||
@@ -2760,10 +2765,12 @@ type PodSpec struct {
|
||||
// Value must be a positive integer.
|
||||
// +optional
|
||||
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,5,opt,name=activeDeadlineSeconds"`
|
||||
// Set DNS policy for containers within the pod.
|
||||
// One of 'ClusterFirstWithHostNet', 'ClusterFirst' or 'Default'.
|
||||
// Set DNS policy for the pod.
|
||||
// Defaults to "ClusterFirst".
|
||||
// To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.
|
||||
// Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.
|
||||
// DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.
|
||||
// To have DNS options set along with hostNetwork, you have to specify DNS policy
|
||||
// explicitly to 'ClusterFirstWithHostNet'.
|
||||
// +optional
|
||||
DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,6,opt,name=dnsPolicy,casttype=DNSPolicy"`
|
||||
// NodeSelector is a selector which must be true for the pod to fit on a node.
|
||||
@@ -2856,6 +2863,11 @@ type PodSpec struct {
|
||||
// The higher the value, the higher the priority.
|
||||
// +optional
|
||||
Priority *int32 `json:"priority,omitempty" protobuf:"bytes,25,opt,name=priority"`
|
||||
// Specifies the DNS parameters of a pod.
|
||||
// Parameters specified here will be merged to the generated DNS
|
||||
// configuration based on DNSPolicy.
|
||||
// +optional
|
||||
DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty" protobuf:"bytes,26,opt,name=dnsConfig"`
|
||||
}
|
||||
|
||||
// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the
|
||||
@@ -2923,6 +2935,35 @@ const (
|
||||
PodQOSBestEffort PodQOSClass = "BestEffort"
|
||||
)
|
||||
|
||||
// PodDNSConfig defines the DNS parameters of a pod in addition to
|
||||
// those generated from DNSPolicy.
|
||||
type PodDNSConfig struct {
|
||||
// A list of DNS name server IP addresses.
|
||||
// This will be appended to the base nameservers generated from DNSPolicy.
|
||||
// Duplicated nameservers will be removed.
|
||||
// +optional
|
||||
Nameservers []string `json:"nameservers,omitempty" protobuf:"bytes,1,rep,name=nameservers"`
|
||||
// A list of DNS search domains for host-name lookup.
|
||||
// This will be appended to the base search paths generated from DNSPolicy.
|
||||
// Duplicated search paths will be removed.
|
||||
// +optional
|
||||
Searches []string `json:"searches,omitempty" protobuf:"bytes,2,rep,name=searches"`
|
||||
// A list of DNS resolver options.
|
||||
// This will be merged with the base options generated from DNSPolicy.
|
||||
// Duplicated entries will be removed. Resolution options given in Options
|
||||
// will override those that appear in the base DNSPolicy.
|
||||
// +optional
|
||||
Options []PodDNSConfigOption `json:"options,omitempty" protobuf:"bytes,3,rep,name=options"`
|
||||
}
|
||||
|
||||
// PodDNSConfigOption defines DNS resolver options of a pod.
|
||||
type PodDNSConfigOption struct {
|
||||
// Required.
|
||||
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
|
||||
// +optional
|
||||
Value *string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
|
||||
}
|
||||
|
||||
// PodStatus represents information about the status of a pod. Status may trail the actual
|
||||
// state of a system.
|
||||
type PodStatus struct {
|
||||
@@ -3940,8 +3981,6 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
// Namespace prefix for opaque counted resources (alpha).
|
||||
ResourceOpaqueIntPrefix = "pod.alpha.kubernetes.io/opaque-int-resource-"
|
||||
// Default namespace prefix.
|
||||
ResourceDefaultNamespacePrefix = "kubernetes.io/"
|
||||
// Name prefix for huge page resources (alpha).
|
||||
|
||||
+22
-1
@@ -1356,6 +1356,26 @@ func (PodCondition) SwaggerDoc() map[string]string {
|
||||
return map_PodCondition
|
||||
}
|
||||
|
||||
var map_PodDNSConfig = map[string]string{
|
||||
"": "PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.",
|
||||
"nameservers": "A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.",
|
||||
"searches": "A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.",
|
||||
"options": "A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.",
|
||||
}
|
||||
|
||||
func (PodDNSConfig) SwaggerDoc() map[string]string {
|
||||
return map_PodDNSConfig
|
||||
}
|
||||
|
||||
var map_PodDNSConfigOption = map[string]string{
|
||||
"": "PodDNSConfigOption defines DNS resolver options of a pod.",
|
||||
"name": "Required.",
|
||||
}
|
||||
|
||||
func (PodDNSConfigOption) SwaggerDoc() map[string]string {
|
||||
return map_PodDNSConfigOption
|
||||
}
|
||||
|
||||
var map_PodExecOptions = map[string]string{
|
||||
"": "PodExecOptions is the query options to a Pod's remote exec call.",
|
||||
"stdin": "Redirect the standard input stream of the pod for this call. Defaults to false.",
|
||||
@@ -1444,7 +1464,7 @@ var map_PodSpec = map[string]string{
|
||||
"restartPolicy": "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy",
|
||||
"terminationGracePeriodSeconds": "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.",
|
||||
"activeDeadlineSeconds": "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.",
|
||||
"dnsPolicy": "Set DNS policy for containers within the pod. One of 'ClusterFirstWithHostNet', 'ClusterFirst' or 'Default'. Defaults to \"ClusterFirst\". To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.",
|
||||
"dnsPolicy": "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.",
|
||||
"nodeSelector": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/",
|
||||
"serviceAccountName": "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/",
|
||||
"serviceAccount": "DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.",
|
||||
@@ -1463,6 +1483,7 @@ var map_PodSpec = map[string]string{
|
||||
"hostAliases": "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.",
|
||||
"priorityClassName": "If specified, indicates the pod's priority. \"SYSTEM\" is a special keyword which indicates the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.",
|
||||
"priority": "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.",
|
||||
"dnsConfig": "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.",
|
||||
}
|
||||
|
||||
func (PodSpec) SwaggerDoc() map[string]string {
|
||||
|
||||
+67
@@ -3483,6 +3483,64 @@ func (in *PodCondition) DeepCopy() *PodCondition {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PodDNSConfig) DeepCopyInto(out *PodDNSConfig) {
|
||||
*out = *in
|
||||
if in.Nameservers != nil {
|
||||
in, out := &in.Nameservers, &out.Nameservers
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Searches != nil {
|
||||
in, out := &in.Searches, &out.Searches
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Options != nil {
|
||||
in, out := &in.Options, &out.Options
|
||||
*out = make([]PodDNSConfigOption, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDNSConfig.
|
||||
func (in *PodDNSConfig) DeepCopy() *PodDNSConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PodDNSConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PodDNSConfigOption) DeepCopyInto(out *PodDNSConfigOption) {
|
||||
*out = *in
|
||||
if in.Value != nil {
|
||||
in, out := &in.Value, &out.Value
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDNSConfigOption.
|
||||
func (in *PodDNSConfigOption) DeepCopy() *PodDNSConfigOption {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PodDNSConfigOption)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PodExecOptions) DeepCopyInto(out *PodExecOptions) {
|
||||
*out = *in
|
||||
@@ -3853,6 +3911,15 @@ func (in *PodSpec) DeepCopyInto(out *PodSpec) {
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.DNSConfig != nil {
|
||||
in, out := &in.DNSConfig, &out.DNSConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(PodDNSConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user