mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +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
|
ns string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure statically that deployments implements DeploymentInterface.
|
||||||
|
var _ DeploymentInterface = &deployments{}
|
||||||
|
|
||||||
// newDeployments returns a Deployments
|
// newDeployments returns a Deployments
|
||||||
func newDeployments(c *ExtensionsClient, namespace string) *deployments {
|
func newDeployments(c *ExtensionsClient, namespace string) *deployments {
|
||||||
return &deployments{
|
return &deployments{
|
||||||
|
@ -19,17 +19,21 @@ package testclient
|
|||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||||
|
kclientlib "k8s.io/kubernetes/pkg/client/unversioned"
|
||||||
"k8s.io/kubernetes/pkg/labels"
|
"k8s.io/kubernetes/pkg/labels"
|
||||||
"k8s.io/kubernetes/pkg/watch"
|
"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.
|
// implementation. This makes faking out just the methods you want to test easier.
|
||||||
type FakeDeployments struct {
|
type FakeDeployments struct {
|
||||||
Fake *FakeExperimental
|
Fake *FakeExperimental
|
||||||
Namespace string
|
Namespace string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure statically that FakeDeployments implements DeploymentInterface.
|
||||||
|
var _ kclientlib.DeploymentInterface = &FakeDeployments{}
|
||||||
|
|
||||||
func (c *FakeDeployments) Get(name string) (*extensions.Deployment, error) {
|
func (c *FakeDeployments) Get(name string) (*extensions.Deployment, error) {
|
||||||
obj, err := c.Fake.Invokes(NewGetAction("deployments", c.Namespace, name), &extensions.Deployment{})
|
obj, err := c.Fake.Invokes(NewGetAction("deployments", c.Namespace, name), &extensions.Deployment{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user