Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/sdk/{action,handler,informer,query,types} should probably just be one package called sdk #162

Closed
ericchiang opened this issue Apr 3, 2018 · 1 comment
Labels
release-blocker This issue blocks the parent release milestone

Comments

@ericchiang
Copy link

All of these packages implement small bits of code and it's not clear why they're separate. Things like handler.Handler and informer.Informer are good examples of types that should just be in a common package.

We can have more than one type per package. This ain't Java.

https://rakyll.org/style-packages/

$ go doc github.com/coreos/operator-sdk/pkg/sdk/handler
package handler // import "github.com/coreos/operator-sdk/pkg/sdk/handler"

type Handler interface{ ... }
    var RegisteredHandler Handler
$ go doc github.com/coreos/operator-sdk/pkg/sdk/informer
package informer // import "github.com/coreos/operator-sdk/pkg/sdk/informer"

type Informer interface{ ... }
    func New(resourcePluralName, namespace string, resourceClient dynamic.ResourceInterface, ...) Informer
$ go doc github.com/coreos/operator-sdk/pkg/sdk/query
package query // import "github.com/coreos/operator-sdk/pkg/sdk/query"

Package query contains a set of APIs for accessing kubernetes objects.

func Get(into sdkTypes.Object, opts ...GetOption) error
func List(namespace string, into sdkTypes.Object, opts ...ListOption) error
type GetOp struct{ ... }
    func NewGetOp() *GetOp
type GetOption func(*GetOp)
    func WithGetOptions(metaGetOptions *metav1.GetOptions) GetOption
type ListOp struct{ ... }
    func NewListOp() *ListOp
type ListOption func(*ListOp)
    func WithListOptions(metaListOptions *metav1.ListOptions) ListOption
$ go doc github.com/coreos/operator-sdk/pkg/sdk/types
package types // import "github.com/coreos/operator-sdk/pkg/sdk/types"

type Context struct{ ... }
type Event struct{ ... }
type Object runtime.Object
@hasbro17
Copy link
Contributor

Fixed in #242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-blocker This issue blocks the parent release milestone
Projects
None yet
Development

No branches or pull requests

2 participants