Skip to content

Commit

Permalink
Update generated code for business logic
Browse files Browse the repository at this point in the history
- kubebuilder generate
  • Loading branch information
pwittrock committed Mar 21, 2018
1 parent a0ce0bd commit 5dbb53f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (in *Foo) DeepCopyInto(out *Foo) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
return
}
Expand Down Expand Up @@ -90,6 +90,15 @@ func (in *FooList) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FooSpec) DeepCopyInto(out *FooSpec) {
*out = *in
if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas
if *in == nil {
*out = nil
} else {
*out = new(int32)
**out = **in
}
}
return
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
Copyright 2017 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.
*/
package v1alpha1

import (
Expand Down Expand Up @@ -91,12 +76,25 @@ var (
Type: "object",
},
"spec": v1beta1.JSONSchemaProps{
Type: "object",
Properties: map[string]v1beta1.JSONSchemaProps{},
Type: "object",
Properties: map[string]v1beta1.JSONSchemaProps{
"deploymentName": v1beta1.JSONSchemaProps{
Type: "string",
},
"replicas": v1beta1.JSONSchemaProps{
Type: "integer",
Format: "int32",
},
},
},
"status": v1beta1.JSONSchemaProps{
Type: "object",
Properties: map[string]v1beta1.JSONSchemaProps{},
Type: "object",
Properties: map[string]v1beta1.JSONSchemaProps{
"availableReplicas": v1beta1.JSONSchemaProps{
Type: "integer",
Format: "int32",
},
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
Copyright 2017 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.
*/
package inject

import (
Expand All @@ -22,6 +7,7 @@ import (
"samplecontroller/pkg/inject/args"

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

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

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

0 comments on commit 5dbb53f

Please sign in to comment.