Add interface check in Deployment's client

This commit is contained in:
Janet Kuo 2016-05-10 14:55:37 -07:00
parent 9040bec0ba
commit feeb575112
2 changed files with 8 additions and 1 deletions

View File

@ -45,6 +45,9 @@ type deployments struct {
ns string
}
// Ensure statically that deployments implements DeploymentInterface.
var _ DeploymentInterface = &deployments{}
// newDeployments returns a Deployments
func newDeployments(c *ExtensionsClient, namespace string) *deployments {
return &deployments{

View File

@ -19,17 +19,21 @@ package testclient
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/extensions"
kclientlib "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch"
)
// FakeDeployments implements DeploymentsInterface. Meant to be embedded into a struct to get a default
// FakeDeployments implements DeploymentInterface. Meant to be embedded into a struct to get a default
// implementation. This makes faking out just the methods you want to test easier.
type FakeDeployments struct {
Fake *FakeExperimental
Namespace string
}
// Ensure statically that FakeDeployments implements DeploymentInterface.
var _ kclientlib.DeploymentInterface = &FakeDeployments{}
func (c *FakeDeployments) Get(name string) (*extensions.Deployment, error) {
obj, err := c.Fake.Invokes(NewGetAction("deployments", c.Namespace, name), &extensions.Deployment{})
if obj == nil {