Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#145 from newrelic-forks/rudoi/kube…
Browse files Browse the repository at this point in the history
…adm-config-template

chore: add KubeadmConfigTemplate type
  • Loading branch information
k8s-ci-robot authored Aug 19, 2019
2 parents bdfbb0d + b3cb204 commit 263a7da
Show file tree
Hide file tree
Showing 8 changed files with 1,115 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ resources:
- group: bootstrap
version: v1alpha2
kind: KubeadmConfig
- group: bootstrap
version: v1alpha2
kind: KubeadmConfigTemplate
51 changes: 51 additions & 0 deletions api/v1alpha2/kubeadmconfigtemplate_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
Copyright 2019 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 v1alpha2

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// KubeadmConfigTemplateSpec defines the desired state of KubeadmConfigTemplate
type KubeadmConfigTemplateSpec struct {
Template KubeadmConfigTemplateResource `json:"template"`
}

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=kubeadmconfigtemplates,scope=Namespaced
// +kubebuilder:storageversion

// KubeadmConfigTemplate is the Schema for the kubeadmconfigtemplates API
type KubeadmConfigTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec KubeadmConfigTemplateSpec `json:"spec,omitempty"`
}

// +kubebuilder:object:root=true

// KubeadmConfigTemplateList contains a list of KubeadmConfigTemplate
type KubeadmConfigTemplateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []KubeadmConfigTemplate `json:"items"`
}

func init() {
SchemeBuilder.Register(&KubeadmConfigTemplate{}, &KubeadmConfigTemplateList{})
}
30 changes: 30 additions & 0 deletions api/v1alpha2/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright 2019 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 v1alpha2

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2"
)

// KubeadmConfigTemplateResource defines the Template structure
type KubeadmConfigTemplateResource struct {
metav1.TypeMeta `json:",inline"`
clusterv2.ObjectMeta `json:"metadata,omitempty"`

Spec KubeadmConfigSpec `json:"spec,omitempty"`
}
92 changes: 92 additions & 0 deletions api/v1alpha2/zz_generated.deepcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,95 @@ func (in *KubeadmConfigStatus) DeepCopy() *KubeadmConfigStatus {
in.DeepCopyInto(out)
return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeadmConfigTemplate) DeepCopyInto(out *KubeadmConfigTemplate) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplate.
func (in *KubeadmConfigTemplate) DeepCopy() *KubeadmConfigTemplate {
if in == nil {
return nil
}
out := new(KubeadmConfigTemplate)
in.DeepCopyInto(out)
return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KubeadmConfigTemplate) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeadmConfigTemplateList) DeepCopyInto(out *KubeadmConfigTemplateList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]KubeadmConfigTemplate, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplateList.
func (in *KubeadmConfigTemplateList) DeepCopy() *KubeadmConfigTemplateList {
if in == nil {
return nil
}
out := new(KubeadmConfigTemplateList)
in.DeepCopyInto(out)
return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KubeadmConfigTemplateList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeadmConfigTemplateResource) DeepCopyInto(out *KubeadmConfigTemplateResource) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplateResource.
func (in *KubeadmConfigTemplateResource) DeepCopy() *KubeadmConfigTemplateResource {
if in == nil {
return nil
}
out := new(KubeadmConfigTemplateResource)
in.DeepCopyInto(out)
return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeadmConfigTemplateSpec) DeepCopyInto(out *KubeadmConfigTemplateSpec) {
*out = *in
in.Template.DeepCopyInto(&out.Template)
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplateSpec.
func (in *KubeadmConfigTemplateSpec) DeepCopy() *KubeadmConfigTemplateSpec {
if in == nil {
return nil
}
out := new(KubeadmConfigTemplateSpec)
in.DeepCopyInto(out)
return out
}
Loading

0 comments on commit 263a7da

Please sign in to comment.