Skip to content

Commit

Permalink
Use official code generator scripts (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha authored Feb 17, 2018
1 parent 45fe669 commit f811c09
Show file tree
Hide file tree
Showing 49 changed files with 55 additions and 1,475 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package client
package versioned

import (
stashv1alpha1 "github.com/appscode/stash/client/typed/stash/v1alpha1"
stashv1alpha1 "github.com/appscode/stash/client/clientset/versioned/typed/stash/v1alpha1"
glog "github.com/golang/glog"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
Expand Down
2 changes: 1 addition & 1 deletion client/doc.go → client/clientset/versioned/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ limitations under the License.
*/

// This package has the automatically generated clientset.
package client
package versioned
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License.
package fake

import (
clientset "github.com/appscode/stash/client"
stashv1alpha1 "github.com/appscode/stash/client/typed/stash/v1alpha1"
fakestashv1alpha1 "github.com/appscode/stash/client/typed/stash/v1alpha1/fake"
clientset "github.com/appscode/stash/client/clientset/versioned"
stashv1alpha1 "github.com/appscode/stash/client/clientset/versioned/typed/stash/v1alpha1"
fakestashv1alpha1 "github.com/appscode/stash/client/clientset/versioned/typed/stash/v1alpha1/fake"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package fake

import (
v1alpha1 "github.com/appscode/stash/client/typed/stash/v1alpha1"
v1alpha1 "github.com/appscode/stash/client/clientset/versioned/typed/stash/v1alpha1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package v1alpha1

import (
v1alpha1 "github.com/appscode/stash/apis/stash/v1alpha1"
scheme "github.com/appscode/stash/client/scheme"
scheme "github.com/appscode/stash/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package v1alpha1

import (
v1alpha1 "github.com/appscode/stash/apis/stash/v1alpha1"
scheme "github.com/appscode/stash/client/scheme"
scheme "github.com/appscode/stash/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package v1alpha1

import (
v1alpha1 "github.com/appscode/stash/apis/stash/v1alpha1"
"github.com/appscode/stash/client/scheme"
"github.com/appscode/stash/client/clientset/versioned/scheme"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/appscode/go/log"
"github.com/appscode/kutil"
api "github.com/appscode/stash/apis/stash/v1alpha1"
cs "github.com/appscode/stash/client/typed/stash/v1alpha1"
cs "github.com/appscode/stash/client/clientset/versioned/typed/stash/v1alpha1"
"github.com/golang/glog"
kerr "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/appscode/kutil"
api "github.com/appscode/stash/apis/stash/v1alpha1"
cs "github.com/appscode/stash/client/typed/stash/v1alpha1"
cs "github.com/appscode/stash/client/clientset/versioned/typed/stash/v1alpha1"
"github.com/golang/glog"
kerr "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ limitations under the License.
package externalversions

import (
client "github.com/appscode/stash/client"
internalinterfaces "github.com/appscode/stash/informers/externalversions/internalinterfaces"
stash "github.com/appscode/stash/informers/externalversions/stash"
reflect "reflect"
sync "sync"
time "time"

versioned "github.com/appscode/stash/client/clientset/versioned"
internalinterfaces "github.com/appscode/stash/client/informers/externalversions/internalinterfaces"
stash "github.com/appscode/stash/client/informers/externalversions/stash"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
reflect "reflect"
sync "sync"
time "time"
)

type sharedInformerFactory struct {
client client.Interface
client versioned.Interface
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
lock sync.Mutex
Expand All @@ -45,14 +46,14 @@ type sharedInformerFactory struct {
}

// NewSharedInformerFactory constructs a new instance of sharedInformerFactory
func NewSharedInformerFactory(client client.Interface, defaultResync time.Duration) SharedInformerFactory {
func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory {
return NewFilteredSharedInformerFactory(client, defaultResync, v1.NamespaceAll, nil)
}

// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory.
// Listers obtained via this SharedInformerFactory will be subject to the same filters
// as specified here.
func NewFilteredSharedInformerFactory(client client.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory {
func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory {
return &sharedInformerFactory{
client: client,
namespace: namespace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package externalversions

import (
"fmt"

v1alpha1 "github.com/appscode/stash/apis/stash/v1alpha1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ limitations under the License.
package internalinterfaces

import (
client "github.com/appscode/stash/client"
time "time"

versioned "github.com/appscode/stash/client/clientset/versioned"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
cache "k8s.io/client-go/tools/cache"
time "time"
)

type NewInformerFunc func(client.Interface, time.Duration) cache.SharedIndexInformer
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer

// SharedInformerFactory a small interface to allow for adding an informer without an import cycle
type SharedInformerFactory interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ limitations under the License.
package stash

import (
internalinterfaces "github.com/appscode/stash/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/appscode/stash/informers/externalversions/stash/v1alpha1"
internalinterfaces "github.com/appscode/stash/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/appscode/stash/client/informers/externalversions/stash/v1alpha1"
)

// Interface provides access to each of this group's versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
package v1alpha1

import (
internalinterfaces "github.com/appscode/stash/informers/externalversions/internalinterfaces"
internalinterfaces "github.com/appscode/stash/client/informers/externalversions/internalinterfaces"
)

// Interface provides access to all the informers in this group version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ limitations under the License.
package v1alpha1

import (
time "time"

stash_v1alpha1 "github.com/appscode/stash/apis/stash/v1alpha1"
client "github.com/appscode/stash/client"
internalinterfaces "github.com/appscode/stash/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/appscode/stash/listers/stash/v1alpha1"
versioned "github.com/appscode/stash/client/clientset/versioned"
internalinterfaces "github.com/appscode/stash/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/appscode/stash/client/listers/stash/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
time "time"
)

// RecoveryInformer provides access to a shared informer and lister for
Expand All @@ -46,14 +47,14 @@ type recoveryInformer struct {
// NewRecoveryInformer constructs a new informer for Recovery type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewRecoveryInformer(client client.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
func NewRecoveryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredRecoveryInformer(client, namespace, resyncPeriod, indexers, nil)
}

// NewFilteredRecoveryInformer constructs a new informer for Recovery type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredRecoveryInformer(client client.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
func NewFilteredRecoveryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
Expand All @@ -75,7 +76,7 @@ func NewFilteredRecoveryInformer(client client.Interface, namespace string, resy
)
}

func (f *recoveryInformer) defaultInformer(client client.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
func (f *recoveryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredRecoveryInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ limitations under the License.
package v1alpha1

import (
time "time"

stash_v1alpha1 "github.com/appscode/stash/apis/stash/v1alpha1"
client "github.com/appscode/stash/client"
internalinterfaces "github.com/appscode/stash/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/appscode/stash/listers/stash/v1alpha1"
versioned "github.com/appscode/stash/client/clientset/versioned"
internalinterfaces "github.com/appscode/stash/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/appscode/stash/client/listers/stash/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
time "time"
)

// ResticInformer provides access to a shared informer and lister for
Expand All @@ -46,14 +47,14 @@ type resticInformer struct {
// NewResticInformer constructs a new informer for Restic type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewResticInformer(client client.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
func NewResticInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredResticInformer(client, namespace, resyncPeriod, indexers, nil)
}

// NewFilteredResticInformer constructs a new informer for Restic type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredResticInformer(client client.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
func NewFilteredResticInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
Expand All @@ -75,7 +76,7 @@ func NewFilteredResticInformer(client client.Interface, namespace string, resync
)
}

func (f *resticInformer) defaultInformer(client client.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
func (f *resticInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredResticInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}

Expand Down
90 changes: 0 additions & 90 deletions client/internalclientset/clientset.go

This file was deleted.

18 changes: 0 additions & 18 deletions client/internalclientset/doc.go

This file was deleted.

Loading

0 comments on commit f811c09

Please sign in to comment.