mirror of https://github.com/k3s-io/k3s
Merge pull request #62748 from liggitt/default-gen
Automatic merge from submit-queue (batch tested with PRs 62748, 60536, 62300, 62661, 62731). 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>. Update default generation for example packages the example API packages were missing default generation tags, which meant that calls to the generated defaults were not satisfied in cross-build, which regenerates all files follow-up to https://github.com/kubernetes/kubernetes/pull/62472 ```release-note NONE ```pull/8/head
commit
1112fa4484
|
@ -15,6 +15,7 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +k8s:conversion-gen=k8s.io/code-generator/_examples/apiserver/apis/example
|
||||
// +groupName=example.apiserver.code-generator.k8s.io
|
||||
package v1
|
||||
|
|
|
@ -15,6 +15,7 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=example.test.apiserver.code-generator.k8s.io
|
||||
// +k8s:conversion-gen=k8s.io/code-generator/_examples/apiserver/apis/example2
|
||||
// +groupGoName=SecondExample
|
||||
|
|
|
@ -15,5 +15,6 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=example.crd.code-generator.k8s.io
|
||||
package v1
|
||||
|
|
32
staging/src/k8s.io/code-generator/_examples/crd/apis/example/v1/zz_generated.defaults.go
generated
Normal file
32
staging/src/k8s.io/code-generator/_examples/crd/apis/example/v1/zz_generated.defaults.go
generated
Normal file
|
@ -0,0 +1,32 @@
|
|||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by defaulter-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
// All generated defaulters are covering - they call all nested defaulters.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
return nil
|
||||
}
|
|
@ -15,6 +15,7 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=example.test.crd.code-generator.k8s.io
|
||||
// +groupGoName=SecondExample
|
||||
package v1
|
||||
|
|
32
staging/src/k8s.io/code-generator/_examples/crd/apis/example2/v1/zz_generated.defaults.go
generated
Normal file
32
staging/src/k8s.io/code-generator/_examples/crd/apis/example2/v1/zz_generated.defaults.go
generated
Normal file
|
@ -0,0 +1,32 @@
|
|||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by defaulter-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
// All generated defaulters are covering - they call all nested defaulters.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
return nil
|
||||
}
|
|
@ -16,6 +16,7 @@ limitations under the License.
|
|||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/sample-apiserver/pkg/apis/wardle
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
|
||||
// Package v1alpha1 is the v1alpha1 version of the API.
|
||||
// +groupName=wardle.k8s.io
|
||||
|
|
|
@ -28,5 +28,18 @@ import (
|
|||
// Public to allow building arbitrary schemes.
|
||||
// All generated defaulters are covering - they call all nested defaulters.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
scheme.AddTypeDefaultingFunc(&Flunder{}, func(obj interface{}) { SetObjectDefaults_Flunder(obj.(*Flunder)) })
|
||||
scheme.AddTypeDefaultingFunc(&FlunderList{}, func(obj interface{}) { SetObjectDefaults_FlunderList(obj.(*FlunderList)) })
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetObjectDefaults_Flunder(in *Flunder) {
|
||||
SetDefaults_FlunderSpec(&in.Spec)
|
||||
}
|
||||
|
||||
func SetObjectDefaults_FlunderList(in *FlunderList) {
|
||||
for i := range in.Items {
|
||||
a := &in.Items[i]
|
||||
SetObjectDefaults_Flunder(a)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ limitations under the License.
|
|||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/sample-apiserver/pkg/apis/wardle
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
|
||||
// Package v1beta1 is the v1beta1 version of the API.
|
||||
// +groupName=wardle.k8s.io
|
||||
|
|
Loading…
Reference in New Issue