Skip to content

Commit

Permalink
Remove internal types (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha authored Feb 18, 2018
1 parent 9b497a8 commit ffd0701
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 1,534 deletions.
5 changes: 0 additions & 5 deletions apis/stash/doc.go

This file was deleted.

27 changes: 0 additions & 27 deletions apis/stash/install/install.go

This file was deleted.

34 changes: 0 additions & 34 deletions apis/stash/register.go
Original file line number Diff line number Diff line change
@@ -1,38 +1,4 @@
package stash

import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)

// GroupName is the group name use in this package
const GroupName = "stash.appscode.com"

// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}

// Kind takes an unqualified kind and returns a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}

// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}

var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Restic{},
&ResticList{},
&Recovery{},
&RecoveryList{},
)
return nil
}
219 changes: 0 additions & 219 deletions apis/stash/types.go

This file was deleted.

22 changes: 11 additions & 11 deletions apis/stash/v1alpha1/crd.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
package v1alpha1

import (
sapi "github.com/appscode/stash/apis/stash"
"github.com/appscode/stash/apis/stash"
apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func (c Restic) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
return &apiextensions.CustomResourceDefinition{
ObjectMeta: metav1.ObjectMeta{
Name: sapi.ResourceTypeRestic + "." + SchemeGroupVersion.Group,
Name: ResourceTypeRestic + "." + SchemeGroupVersion.Group,
Labels: map[string]string{"app": "stash"},
},
Spec: apiextensions.CustomResourceDefinitionSpec{
Group: sapi.GroupName,
Group: stash.GroupName,
Version: SchemeGroupVersion.Version,
Scope: apiextensions.NamespaceScoped,
Names: apiextensions.CustomResourceDefinitionNames{
Singular: sapi.ResourceNameRestic,
Plural: sapi.ResourceTypeRestic,
Kind: sapi.ResourceKindRestic,
Singular: ResourceNameRestic,
Plural: ResourceTypeRestic,
Kind: ResourceKindRestic,
ShortNames: []string{"rst"},
},
},
Expand All @@ -29,17 +29,17 @@ func (c Restic) CustomResourceDefinition() *apiextensions.CustomResourceDefiniti
func (c Recovery) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
return &apiextensions.CustomResourceDefinition{
ObjectMeta: metav1.ObjectMeta{
Name: sapi.ResourceTypeRecovery + "." + SchemeGroupVersion.Group,
Name: ResourceTypeRecovery + "." + SchemeGroupVersion.Group,
Labels: map[string]string{"app": "stash"},
},
Spec: apiextensions.CustomResourceDefinitionSpec{
Group: sapi.GroupName,
Group: stash.GroupName,
Version: SchemeGroupVersion.Version,
Scope: apiextensions.NamespaceScoped,
Names: apiextensions.CustomResourceDefinitionNames{
Singular: sapi.ResourceNameRecovery,
Plural: sapi.ResourceTypeRecovery,
Kind: sapi.ResourceKindRecovery,
Singular: ResourceNameRecovery,
Plural: ResourceTypeRecovery,
Kind: ResourceKindRecovery,
ShortNames: []string{"rec"},
},
},
Expand Down
Loading

0 comments on commit ffd0701

Please sign in to comment.