mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Add interface check in Deployment's client
This commit is contained in:
parent
9040bec0ba
commit
feeb575112
@ -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{
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user