Merge pull request #500 from negz/providervalidation

Remove Provider validation checks, and thus Provider controllers
This commit is contained in:
Nic Cope 2019-06-04 10:59:45 -07:00 committed by GitHub
commit 8668139fee
9 changed files with 6 additions and 97 deletions

View File

@ -19,8 +19,6 @@ package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
corev1alpha1 "github.com/crossplaneio/crossplane/pkg/apis/core/v1alpha1"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
@ -36,11 +34,6 @@ type ProviderSpec struct {
Secret corev1.SecretKeySelector `json:"credentialsSecretRef"`
}
// ProviderStatus represents the status of an AWS Provider.
type ProviderStatus struct {
corev1alpha1.DeprecatedConditionedStatus
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@ -51,8 +44,7 @@ type Provider struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ProviderSpec `json:"spec,omitempty"`
Status ProviderStatus `json:"status,omitempty"`
Spec ProviderSpec `json:"spec,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@ -63,8 +55,3 @@ type ProviderList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []Provider `json:"items"`
}
// IsValid returns true if provider is valid (in ready state)
func (p *Provider) IsValid() bool {
return p.Status.IsReady()
}

View File

@ -45,7 +45,7 @@ func TestMain(m *testing.M) {
t.StopAndExit(m.Run())
}
func TestStorageProvider(t *testing.T) {
func TestProvider(t *testing.T) {
key := types.NamespacedName{Name: name, Namespace: namespace}
created := &Provider{
ObjectMeta: metav1.ObjectMeta{

View File

@ -29,7 +29,6 @@ func (in *Provider) DeepCopyInto(out *Provider) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
@ -100,20 +99,3 @@ func (in *ProviderSpec) DeepCopy() *ProviderSpec {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProviderStatus) DeepCopyInto(out *ProviderStatus) {
*out = *in
in.DeprecatedConditionedStatus.DeepCopyInto(&out.DeprecatedConditionedStatus)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderStatus.
func (in *ProviderStatus) DeepCopy() *ProviderStatus {
if in == nil {
return nil
}
out := new(ProviderStatus)
in.DeepCopyInto(out)
return out
}

View File

@ -33,11 +33,6 @@ type ProviderSpec struct {
Secret corev1.SecretKeySelector `json:"credentialsSecretRef"`
}
// ProviderStatus is the status for this provider
type ProviderStatus struct {
corev1alpha1.DeprecatedConditionedStatus
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@ -48,8 +43,7 @@ type Provider struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ProviderSpec `json:"spec,omitempty"`
Status ProviderStatus `json:"status,omitempty"`
Spec ProviderSpec `json:"spec,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@ -61,11 +55,6 @@ type ProviderList struct {
Items []Provider `json:"items"`
}
// IsValid returns true if provider is valid (in ready state)
func (p *Provider) IsValid() bool {
return p.Status.IsReady()
}
// ResourceGroupSpec defines the desired state of Resource Group
type ResourceGroupSpec struct {
// Important: Run "make generate" to regenerate code after modifying this file

View File

@ -46,7 +46,7 @@ func TestMain(m *testing.M) {
t.StopAndExit(m.Run())
}
func TestStorageProvider(t *testing.T) {
func TestProvider(t *testing.T) {
key := types.NamespacedName{Name: name, Namespace: namespace}
created := &Provider{
ObjectMeta: metav1.ObjectMeta{

View File

@ -30,7 +30,6 @@ func (in *Provider) DeepCopyInto(out *Provider) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
@ -102,23 +101,6 @@ func (in *ProviderSpec) DeepCopy() *ProviderSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProviderStatus) DeepCopyInto(out *ProviderStatus) {
*out = *in
in.DeprecatedConditionedStatus.DeepCopyInto(&out.DeprecatedConditionedStatus)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderStatus.
func (in *ProviderStatus) DeepCopy() *ProviderStatus {
if in == nil {
return nil
}
out := new(ProviderStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceGroup) DeepCopyInto(out *ResourceGroup) {
*out = *in

View File

@ -19,8 +19,6 @@ package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
corev1alpha1 "github.com/crossplaneio/crossplane/pkg/apis/core/v1alpha1"
)
// ProviderSpec defines the desired state of Provider
@ -37,11 +35,6 @@ type ProviderSpec struct {
RequiredPermissions []string `json:"requiredPermissions,omitempty"`
}
// ProviderStatus represents the status of a GCP Provider.
type ProviderStatus struct {
corev1alpha1.DeprecatedConditionedStatus
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@ -54,8 +47,7 @@ type Provider struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ProviderSpec `json:"spec,omitempty"`
Status ProviderStatus `json:"status,omitempty"`
Spec ProviderSpec `json:"spec,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@ -66,8 +58,3 @@ type ProviderList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []Provider `json:"items"`
}
// IsValid returns true if provider is valid (in ready state)
func (p *Provider) IsValid() bool {
return p.Status.IsReady()
}

View File

@ -47,7 +47,7 @@ func TestMain(m *testing.M) {
t.StopAndExit(m.Run())
}
func TestStorageProvider(t *testing.T) {
func TestProvider(t *testing.T) {
key := types.NamespacedName{Name: name, Namespace: namespace}
created := &Provider{
ObjectMeta: metav1.ObjectMeta{

View File

@ -29,7 +29,6 @@ func (in *Provider) DeepCopyInto(out *Provider) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
@ -105,20 +104,3 @@ func (in *ProviderSpec) DeepCopy() *ProviderSpec {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProviderStatus) DeepCopyInto(out *ProviderStatus) {
*out = *in
in.DeprecatedConditionedStatus.DeepCopyInto(&out.DeprecatedConditionedStatus)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderStatus.
func (in *ProviderStatus) DeepCopy() *ProviderStatus {
if in == nil {
return nil
}
out := new(ProviderStatus)
in.DeepCopyInto(out)
return out
}