Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
5a99fcd2
Commit
5a99fcd2
authored
May 12, 2016
by
Saad Ali
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25431 from janetkuo/deployment-client-check
Add interface check in Deployment's client
parents
4aa332e8
feeb5751
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
deployment.go
pkg/client/unversioned/deployment.go
+3
-0
fake_deployments.go
pkg/client/unversioned/testclient/fake_deployments.go
+5
-1
No files found.
pkg/client/unversioned/deployment.go
View file @
5a99fcd2
...
...
@@ -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
{
...
...
pkg/client/unversioned/testclient/fake_deployments.go
View file @
5a99fcd2
...
...
@@ -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 Deployment
s
Interface. 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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment