Skip to content

Commit 5dbb53f

Browse files
committed
Update generated code for business logic
- kubebuilder generate
1 parent a0ce0bd commit 5dbb53f

File tree

3 files changed

+31
-35
lines changed

3 files changed

+31
-35
lines changed

samples/full/controller/src/samplecontroller/pkg/apis/samplecontroller/v1alpha1/zz_generated.deepcopy.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (in *Foo) DeepCopyInto(out *Foo) {
2929
*out = *in
3030
out.TypeMeta = in.TypeMeta
3131
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
32-
out.Spec = in.Spec
32+
in.Spec.DeepCopyInto(&out.Spec)
3333
out.Status = in.Status
3434
return
3535
}
@@ -90,6 +90,15 @@ func (in *FooList) DeepCopyObject() runtime.Object {
9090
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
9191
func (in *FooSpec) DeepCopyInto(out *FooSpec) {
9292
*out = *in
93+
if in.Replicas != nil {
94+
in, out := &in.Replicas, &out.Replicas
95+
if *in == nil {
96+
*out = nil
97+
} else {
98+
*out = new(int32)
99+
**out = **in
100+
}
101+
}
93102
return
94103
}
95104

samples/full/controller/src/samplecontroller/pkg/apis/samplecontroller/v1alpha1/zz_generated.kubebuilder.go

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/*
2-
Copyright 2017 The Kubernetes Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
161
package v1alpha1
172

183
import (
@@ -91,12 +76,25 @@ var (
9176
Type: "object",
9277
},
9378
"spec": v1beta1.JSONSchemaProps{
94-
Type: "object",
95-
Properties: map[string]v1beta1.JSONSchemaProps{},
79+
Type: "object",
80+
Properties: map[string]v1beta1.JSONSchemaProps{
81+
"deploymentName": v1beta1.JSONSchemaProps{
82+
Type: "string",
83+
},
84+
"replicas": v1beta1.JSONSchemaProps{
85+
Type: "integer",
86+
Format: "int32",
87+
},
88+
},
9689
},
9790
"status": v1beta1.JSONSchemaProps{
98-
Type: "object",
99-
Properties: map[string]v1beta1.JSONSchemaProps{},
91+
Type: "object",
92+
Properties: map[string]v1beta1.JSONSchemaProps{
93+
"availableReplicas": v1beta1.JSONSchemaProps{
94+
Type: "integer",
95+
Format: "int32",
96+
},
97+
},
10098
},
10199
},
102100
},

samples/full/controller/src/samplecontroller/pkg/inject/zz_generated.kubebuilder.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/*
2-
Copyright 2017 The Kubernetes Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
161
package inject
172

183
import (
@@ -22,6 +7,7 @@ import (
227
"samplecontroller/pkg/inject/args"
238

249
"github.com/kubernetes-sigs/kubebuilder/pkg/inject/run"
10+
appsv1 "k8s.io/api/apps/v1"
2511
rbacv1 "k8s.io/api/rbac/v1"
2612
"k8s.io/apimachinery/pkg/runtime/schema"
2713
"k8s.io/client-go/kubernetes/scheme"
@@ -39,6 +25,9 @@ func init() {
3925
}
4026

4127
// Add Kubernetes informers
28+
if err := arguments.ControllerManager.AddInformerProvider(&appsv1.Deployment{}, arguments.KubernetesInformers.Apps().V1().Deployments()); err != nil {
29+
return err
30+
}
4231

4332
if c, err := foo.ProvideController(arguments); err != nil {
4433
return err

0 commit comments

Comments
 (0)