From 9140358c548e92d055583a59583700b96f9fa350 Mon Sep 17 00:00:00 2001 From: Njal Karevoll Date: Thu, 6 Jun 2019 16:00:32 +0200 Subject: [PATCH] Rename HTTPService to ServiceTemplate --- operators/pkg/apis/common/v1alpha1/common.go | 24 +----- .../common/v1alpha1/zz_generated.deepcopy.go | 75 +++++-------------- 2 files changed, 21 insertions(+), 78 deletions(-) diff --git a/operators/pkg/apis/common/v1alpha1/common.go b/operators/pkg/apis/common/v1alpha1/common.go index 1d59ac1a5b..be4c4cba0b 100644 --- a/operators/pkg/apis/common/v1alpha1/common.go +++ b/operators/pkg/apis/common/v1alpha1/common.go @@ -37,7 +37,7 @@ func (s ObjectSelector) NamespacedName() types.NamespacedName { // HTTPConfig configures a HTTP-based service. type HTTPConfig struct { // Service is a template for the Kubernetes Service - Service HTTPService `json:"service,omitempty"` + Service ServiceTemplate `json:"service,omitempty"` // TLS describe additional options to consider when generating HTTP TLS certificates. TLS TLSOptions `json:"tls,omitempty"` } @@ -59,8 +59,8 @@ type SubjectAlternativeName struct { IP string `json:"ip,omitempty"` } -// HTTPService contains defaults for a HTTP service. -type HTTPService struct { +// ServiceTemplate describes the data a service should have when created from a template +type ServiceTemplate struct { // ObjectMeta is metadata for the service. // The name and namespace provided here is managed by ECK and will be ignored. // +optional @@ -70,21 +70,3 @@ type HTTPService struct { // +optional Spec v1.ServiceSpec `json:"spec,omitempty"` } - -// HTTPServiceObjectMeta is metadata for HTTP Service. -type HTTPServiceObjectMeta struct { - // Annotations is an unstructured key value map stored with a resource that may be - // set by external tools to store and retrieve arbitrary metadata. They are not - // queryable and should be preserved when modifying objects. - // More info: http://kubernetes.io/docs/user-guide/annotations - // +optional - Annotations map[string]string `json:"annotations,omitempty"` -} - -// HTTPServiceSpec contains a subset of overridable settings for the HTTP Service -type HTTPServiceSpec struct { - // Type determines which service type to use for this workload. The - // options are: `ClusterIP|LoadBalancer|NodePort`. Defaults to ClusterIP. - // +kubebuilder:validation:Enum=ClusterIP,LoadBalancer,NodePort - Type string `json:"type,omitempty"` -} diff --git a/operators/pkg/apis/common/v1alpha1/zz_generated.deepcopy.go b/operators/pkg/apis/common/v1alpha1/zz_generated.deepcopy.go index 35b2262163..a1f5a38d6b 100644 --- a/operators/pkg/apis/common/v1alpha1/zz_generated.deepcopy.go +++ b/operators/pkg/apis/common/v1alpha1/zz_generated.deepcopy.go @@ -64,63 +64,6 @@ func (in *HTTPConfig) DeepCopy() *HTTPConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HTTPService) DeepCopyInto(out *HTTPService) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPService. -func (in *HTTPService) DeepCopy() *HTTPService { - if in == nil { - return nil - } - out := new(HTTPService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HTTPServiceObjectMeta) DeepCopyInto(out *HTTPServiceObjectMeta) { - *out = *in - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPServiceObjectMeta. -func (in *HTTPServiceObjectMeta) DeepCopy() *HTTPServiceObjectMeta { - if in == nil { - return nil - } - out := new(HTTPServiceObjectMeta) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HTTPServiceSpec) DeepCopyInto(out *HTTPServiceSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPServiceSpec. -func (in *HTTPServiceSpec) DeepCopy() *HTTPServiceSpec { - if in == nil { - return nil - } - out := new(HTTPServiceSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ObjectSelector) DeepCopyInto(out *ObjectSelector) { *out = *in @@ -190,6 +133,24 @@ func (in *SelfSignedCertificate) DeepCopy() *SelfSignedCertificate { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceTemplate) DeepCopyInto(out *ServiceTemplate) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplate. +func (in *ServiceTemplate) DeepCopy() *ServiceTemplate { + if in == nil { + return nil + } + out := new(ServiceTemplate) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SubjectAlternativeName) DeepCopyInto(out *SubjectAlternativeName) { *out = *in