-
Notifications
You must be signed in to change notification settings - Fork 227
Client and Storage rework: Recognize multiple API groups #221
Conversation
…meta.Kind. Also add a .New method
…e client, too. Make the client GroupVersion-aware
…ializer, and set the gvk in Storage.decode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very welcome improvement 👍 just a couple of little cleanup suggestions.
log "github.com/sirupsen/logrus" | ||
api "github.com/weaveworks/ignite/pkg/apis/ignite" | ||
meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" | ||
"github.com/weaveworks/ignite/pkg/storage" | ||
"github.com/weaveworks/ignite/pkg/storage/filterer" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove blank line?
log "github.com/sirupsen/logrus" | ||
api "github.com/weaveworks/ignite/pkg/apis/ignite" | ||
meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" | ||
"github.com/weaveworks/ignite/pkg/storage" | ||
"github.com/weaveworks/ignite/pkg/storage/filterer" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rerun make tidy
after removing the blank line from template
meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove two blank lines
@@ -5,6 +5,8 @@ import ( | |||
|
|||
meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" | |||
"github.com/weaveworks/ignite/pkg/storage" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove blank line
The blank lines are rebase conflict. I'll fixup those in this follow up: #224 |
Before this, the client and storage framework was locked in to only one particular combination of
apiVersion
, or in other words,GroupVersion
. We only checkedmeta.Kind
everywhere; but that always implicitly assumed that the GroupVersion was ignite/v1alpha1Fixes: #199
This PR:
Storage
(Cache
), andFilterer
interfaces operate onschema.GroupVersionKind
, notmeta.Kind
Client
struct to a gv-specificIgniteInternalClient
, and passes through the GVK automatically to the storage as a consequence.Client.New
->Storage.New
method being the canonical way to create a new API object. In other words, do not do&api.VM{}
or similar anymore.