mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-30 13:23:52 +00:00
Use file tags to generate conversions
This drives conversion generation from file tags like: // +conversion-gen=k8s.io/my/internal/version .. rather than hardcoded lists of packages. The only net change in generated code can be explained as correct. Previously it didn't know that conversion was available.
This commit is contained in:
@@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/api
|
||||
|
||||
// Package v1 is the v1 version of the API.
|
||||
// +genconversion=true
|
||||
package v1
|
||||
|
||||
@@ -2481,7 +2481,7 @@ message Secret {
|
||||
// It is provided as a write-only convenience method.
|
||||
// All keys and values are merged into the data field on write, overwriting any existing values.
|
||||
// It is never output when reading from the API.
|
||||
// +genconversion=false
|
||||
// +k8s:conversion-gen=false
|
||||
map<string, string> stringData = 4;
|
||||
|
||||
// Used to facilitate programmatic handling of secret data.
|
||||
@@ -2715,7 +2715,7 @@ message ServiceSpec {
|
||||
// API for compatibility until at least 8/20/2016. It will be removed from
|
||||
// any new API revisions. If both deprecatedPublicIPs *and* externalIPs are
|
||||
// set, deprecatedPublicIPs is used.
|
||||
// +genconversion=false
|
||||
// +k8s:conversion-gen=false
|
||||
repeated string deprecatedPublicIPs = 6;
|
||||
|
||||
// Supports "ClientIP" and "None". Used to maintain session affinity.
|
||||
|
||||
@@ -2081,7 +2081,7 @@ type ServiceSpec struct {
|
||||
// API for compatibility until at least 8/20/2016. It will be removed from
|
||||
// any new API revisions. If both deprecatedPublicIPs *and* externalIPs are
|
||||
// set, deprecatedPublicIPs is used.
|
||||
// +genconversion=false
|
||||
// +k8s:conversion-gen=false
|
||||
DeprecatedPublicIPs []string `json:"deprecatedPublicIPs,omitempty" protobuf:"bytes,6,rep,name=deprecatedPublicIPs"`
|
||||
|
||||
// Supports "ClientIP" and "None". Used to maintain session affinity.
|
||||
@@ -3096,7 +3096,7 @@ type Secret struct {
|
||||
// It is provided as a write-only convenience method.
|
||||
// All keys and values are merged into the data field on write, overwriting any existing values.
|
||||
// It is never output when reading from the API.
|
||||
// +genconversion=false
|
||||
// +k8s:conversion-gen=false
|
||||
StringData map[string]string `json:"stringData,omitempty" protobuf:"bytes,4,rep,name=stringData"`
|
||||
|
||||
// Used to facilitate programmatic handling of secret data.
|
||||
|
||||
@@ -15,6 +15,6 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps
|
||||
|
||||
// +genconversion=true
|
||||
package v1alpha1
|
||||
|
||||
@@ -15,6 +15,6 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/authentication.k8s.io
|
||||
|
||||
// +genconversion=true
|
||||
package v1beta1
|
||||
|
||||
@@ -15,6 +15,6 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/authorization
|
||||
|
||||
// +genconversion=true
|
||||
package v1beta1
|
||||
|
||||
@@ -15,6 +15,6 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling
|
||||
|
||||
// +genconversion=true
|
||||
package v1
|
||||
|
||||
@@ -15,6 +15,6 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/batch
|
||||
|
||||
// +genconversion=true
|
||||
package v1
|
||||
|
||||
@@ -15,6 +15,6 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/batch
|
||||
|
||||
// +genconversion=true
|
||||
package v2alpha1
|
||||
|
||||
@@ -15,6 +15,6 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/certificates
|
||||
|
||||
// +genconversion=true
|
||||
package v1alpha1
|
||||
|
||||
@@ -15,6 +15,6 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/componentconfig
|
||||
|
||||
// +genconversion=true
|
||||
package v1alpha1
|
||||
|
||||
@@ -62,6 +62,8 @@ func init() {
|
||||
Convert_extensions_DeploymentStatus_To_v1beta1_DeploymentStatus,
|
||||
Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy,
|
||||
Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy,
|
||||
Convert_v1beta1_ExportOptions_To_api_ExportOptions,
|
||||
Convert_api_ExportOptions_To_v1beta1_ExportOptions,
|
||||
Convert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions,
|
||||
Convert_extensions_FSGroupStrategyOptions_To_v1beta1_FSGroupStrategyOptions,
|
||||
Convert_v1beta1_HTTPIngressPath_To_extensions_HTTPIngressPath,
|
||||
@@ -110,6 +112,8 @@ func init() {
|
||||
Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector,
|
||||
Convert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement,
|
||||
Convert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement,
|
||||
Convert_v1beta1_ListOptions_To_api_ListOptions,
|
||||
Convert_api_ListOptions_To_v1beta1_ListOptions,
|
||||
Convert_v1beta1_NetworkPolicy_To_extensions_NetworkPolicy,
|
||||
Convert_extensions_NetworkPolicy_To_v1beta1_NetworkPolicy,
|
||||
Convert_v1beta1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule,
|
||||
@@ -644,6 +648,32 @@ func autoConvert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_ExportOptions_To_api_ExportOptions(in *ExportOptions, out *api.ExportOptions, s conversion.Scope) error {
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Export = in.Export
|
||||
out.Exact = in.Exact
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_ExportOptions_To_api_ExportOptions(in *ExportOptions, out *api.ExportOptions, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_ExportOptions_To_api_ExportOptions(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_ExportOptions_To_v1beta1_ExportOptions(in *api.ExportOptions, out *ExportOptions, s conversion.Scope) error {
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Export = in.Export
|
||||
out.Exact = in.Exact
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_ExportOptions_To_v1beta1_ExportOptions(in *api.ExportOptions, out *ExportOptions, s conversion.Scope) error {
|
||||
return autoConvert_api_ExportOptions_To_v1beta1_ExportOptions(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions(in *FSGroupStrategyOptions, out *extensions.FSGroupStrategyOptions, s conversion.Scope) error {
|
||||
out.Rule = extensions.FSGroupStrategyType(in.Rule)
|
||||
if in.Ranges != nil {
|
||||
@@ -1440,6 +1470,46 @@ func Convert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequir
|
||||
return autoConvert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, s conversion.Scope) error {
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.Convert_string_To_labels_Selector(&in.LabelSelector, &out.LabelSelector, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.Convert_string_To_fields_Selector(&in.FieldSelector, &out.FieldSelector, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Watch = in.Watch
|
||||
out.ResourceVersion = in.ResourceVersion
|
||||
out.TimeoutSeconds = in.TimeoutSeconds
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_ListOptions_To_api_ListOptions(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_api_ListOptions_To_v1beta1_ListOptions(in *api.ListOptions, out *ListOptions, s conversion.Scope) error {
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.Convert_labels_Selector_To_string(&in.LabelSelector, &out.LabelSelector, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.Convert_fields_Selector_To_string(&in.FieldSelector, &out.FieldSelector, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Watch = in.Watch
|
||||
out.ResourceVersion = in.ResourceVersion
|
||||
out.TimeoutSeconds = in.TimeoutSeconds
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_ListOptions_To_v1beta1_ListOptions(in *api.ListOptions, out *ListOptions, s conversion.Scope) error {
|
||||
return autoConvert_api_ListOptions_To_v1beta1_ListOptions(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NetworkPolicy_To_extensions_NetworkPolicy(in *NetworkPolicy, out *extensions.NetworkPolicy, s conversion.Scope) error {
|
||||
SetDefaults_NetworkPolicy(in)
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
|
||||
@@ -15,6 +15,8 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/extensions
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/batch
|
||||
|
||||
// +genconversion=true
|
||||
package v1beta1
|
||||
|
||||
@@ -15,9 +15,9 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/policy
|
||||
|
||||
// Package policy is for any kind of policy object. Suitable examples, even if
|
||||
// they aren't all here, are PodDisruptionBudget, PodSecurityPolicy,
|
||||
// NetworkPolicy, etc.
|
||||
// +genconversion=true
|
||||
package v1alpha1
|
||||
|
||||
@@ -16,6 +16,6 @@ limitations under the License.
|
||||
|
||||
// +groupName=rbac.authorization.k8s.io
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/rbac
|
||||
|
||||
// +genconversion=true
|
||||
package v1alpha1
|
||||
|
||||
Reference in New Issue
Block a user