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
9a812bd0
Commit
9a812bd0
authored
Oct 12, 2015
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grep sed ExperimentalClient
parent
9aa163aa
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
26 additions
and
26 deletions
+26
-26
integration.go
cmd/integration/integration.go
+2
-2
client.go
pkg/client/unversioned/client.go
+2
-2
client_test.go
pkg/client/unversioned/client_test.go
+1
-1
daemon_sets.go
pkg/client/unversioned/daemon_sets.go
+2
-2
deployment.go
pkg/client/unversioned/deployment.go
+2
-2
helper.go
pkg/client/unversioned/helper.go
+2
-2
horizontalpodautoscaler.go
pkg/client/unversioned/horizontalpodautoscaler.go
+2
-2
ingress.go
pkg/client/unversioned/ingress.go
+2
-2
jobs.go
pkg/client/unversioned/jobs.go
+2
-2
scale.go
pkg/client/unversioned/scale.go
+2
-2
factory.go
pkg/kubectl/cmd/util/factory.go
+3
-3
scale_test.go
pkg/kubectl/scale_test.go
+4
-4
No files found.
cmd/integration/integration.go
View file @
9a812bd0
...
@@ -136,7 +136,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
...
@@ -136,7 +136,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
// We will fix this by supporting multiple group versions in Config
// We will fix this by supporting multiple group versions in Config
cl
.
Ex
perimental
Client
=
client
.
NewExperimentalOrDie
(
&
client
.
Config
{
Host
:
apiServer
.
URL
,
Version
:
testapi
.
Extensions
.
GroupAndVersion
()})
cl
.
Ex
tensions
Client
=
client
.
NewExperimentalOrDie
(
&
client
.
Config
{
Host
:
apiServer
.
URL
,
Version
:
testapi
.
Extensions
.
GroupAndVersion
()})
storageVersions
:=
make
(
map
[
string
]
string
)
storageVersions
:=
make
(
map
[
string
]
string
)
etcdStorage
,
err
:=
master
.
NewEtcdStorage
(
etcdClient
,
latest
.
GroupOrDie
(
""
)
.
InterfacesFor
,
testapi
.
Default
.
GroupAndVersion
(),
etcdtest
.
PathPrefix
())
etcdStorage
,
err
:=
master
.
NewEtcdStorage
(
etcdClient
,
latest
.
GroupOrDie
(
""
)
.
InterfacesFor
,
testapi
.
Default
.
GroupAndVersion
(),
etcdtest
.
PathPrefix
())
...
@@ -986,7 +986,7 @@ func main() {
...
@@ -986,7 +986,7 @@ func main() {
kubeClient
:=
client
.
NewOrDie
(
&
client
.
Config
{
Host
:
apiServerURL
,
Version
:
testapi
.
Default
.
GroupAndVersion
()})
kubeClient
:=
client
.
NewOrDie
(
&
client
.
Config
{
Host
:
apiServerURL
,
Version
:
testapi
.
Default
.
GroupAndVersion
()})
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
// We will fix this by supporting multiple group versions in Config
// We will fix this by supporting multiple group versions in Config
kubeClient
.
Ex
perimental
Client
=
client
.
NewExperimentalOrDie
(
&
client
.
Config
{
Host
:
apiServerURL
,
Version
:
testapi
.
Extensions
.
GroupAndVersion
()})
kubeClient
.
Ex
tensions
Client
=
client
.
NewExperimentalOrDie
(
&
client
.
Config
{
Host
:
apiServerURL
,
Version
:
testapi
.
Extensions
.
GroupAndVersion
()})
// Run tests in parallel
// Run tests in parallel
testFuncs
:=
[]
testFunc
{
testFuncs
:=
[]
testFunc
{
...
...
pkg/client/unversioned/client.go
View file @
9a812bd0
...
@@ -128,7 +128,7 @@ type APIStatus interface {
...
@@ -128,7 +128,7 @@ type APIStatus interface {
// Client is the implementation of a Kubernetes client.
// Client is the implementation of a Kubernetes client.
type
Client
struct
{
type
Client
struct
{
*
RESTClient
*
RESTClient
*
Ex
perimental
Client
*
Ex
tensions
Client
}
}
// ServerVersion retrieves and parses the server's version.
// ServerVersion retrieves and parses the server's version.
...
@@ -244,5 +244,5 @@ func IsTimeout(err error) bool {
...
@@ -244,5 +244,5 @@ func IsTimeout(err error) bool {
}
}
func
(
c
*
Client
)
Experimental
()
ExtensionsInterface
{
func
(
c
*
Client
)
Experimental
()
ExtensionsInterface
{
return
c
.
Ex
perimental
Client
return
c
.
Ex
tensions
Client
}
}
pkg/client/unversioned/client_test.go
View file @
9a812bd0
...
@@ -95,7 +95,7 @@ func (c *testClient) Setup(t *testing.T) *testClient {
...
@@ -95,7 +95,7 @@ func (c *testClient) Setup(t *testing.T) *testClient {
if
len
(
version
)
==
0
{
if
len
(
version
)
==
0
{
version
=
testapi
.
Extensions
.
Version
()
version
=
testapi
.
Extensions
.
Version
()
}
}
c
.
Ex
perimental
Client
=
NewExperimentalOrDie
(
&
Config
{
c
.
Ex
tensions
Client
=
NewExperimentalOrDie
(
&
Config
{
Host
:
c
.
server
.
URL
,
Host
:
c
.
server
.
URL
,
Version
:
version
,
Version
:
version
,
})
})
...
...
pkg/client/unversioned/daemon_sets.go
View file @
9a812bd0
...
@@ -40,11 +40,11 @@ type DaemonSetInterface interface {
...
@@ -40,11 +40,11 @@ type DaemonSetInterface interface {
// daemonSets implements DaemonsSetsNamespacer interface
// daemonSets implements DaemonsSetsNamespacer interface
type
daemonSets
struct
{
type
daemonSets
struct
{
r
*
Ex
perimental
Client
r
*
Ex
tensions
Client
ns
string
ns
string
}
}
func
newDaemonSets
(
c
*
Ex
perimental
Client
,
namespace
string
)
*
daemonSets
{
func
newDaemonSets
(
c
*
Ex
tensions
Client
,
namespace
string
)
*
daemonSets
{
return
&
daemonSets
{
c
,
namespace
}
return
&
daemonSets
{
c
,
namespace
}
}
}
...
...
pkg/client/unversioned/deployment.go
View file @
9a812bd0
...
@@ -41,12 +41,12 @@ type DeploymentInterface interface {
...
@@ -41,12 +41,12 @@ type DeploymentInterface interface {
// deployments implements DeploymentInterface
// deployments implements DeploymentInterface
type
deployments
struct
{
type
deployments
struct
{
client
*
Ex
perimental
Client
client
*
Ex
tensions
Client
ns
string
ns
string
}
}
// newDeployments returns a Deployments
// newDeployments returns a Deployments
func
newDeployments
(
c
*
Ex
perimental
Client
,
namespace
string
)
*
deployments
{
func
newDeployments
(
c
*
Ex
tensions
Client
,
namespace
string
)
*
deployments
{
return
&
deployments
{
return
&
deployments
{
client
:
c
,
client
:
c
,
ns
:
namespace
,
ns
:
namespace
,
...
...
pkg/client/unversioned/helper.go
View file @
9a812bd0
...
@@ -147,14 +147,14 @@ func New(c *Config) (*Client, error) {
...
@@ -147,14 +147,14 @@ func New(c *Config) (*Client, error) {
}
}
if
_
,
err
:=
latest
.
Group
(
"extensions"
);
err
!=
nil
{
if
_
,
err
:=
latest
.
Group
(
"extensions"
);
err
!=
nil
{
return
&
Client
{
RESTClient
:
client
,
Ex
perimental
Client
:
nil
},
nil
return
&
Client
{
RESTClient
:
client
,
Ex
tensions
Client
:
nil
},
nil
}
}
experimentalConfig
:=
*
c
experimentalConfig
:=
*
c
experimentalClient
,
err
:=
NewExperimental
(
&
experimentalConfig
)
experimentalClient
,
err
:=
NewExperimental
(
&
experimentalConfig
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
return
&
Client
{
RESTClient
:
client
,
Ex
perimental
Client
:
experimentalClient
},
nil
return
&
Client
{
RESTClient
:
client
,
Ex
tensions
Client
:
experimentalClient
},
nil
}
}
// MatchesServerVersion queries the server to compares the build version
// MatchesServerVersion queries the server to compares the build version
...
...
pkg/client/unversioned/horizontalpodautoscaler.go
View file @
9a812bd0
...
@@ -42,12 +42,12 @@ type HorizontalPodAutoscalerInterface interface {
...
@@ -42,12 +42,12 @@ type HorizontalPodAutoscalerInterface interface {
// horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface
// horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface
type
horizontalPodAutoscalers
struct
{
type
horizontalPodAutoscalers
struct
{
client
*
Ex
perimental
Client
client
*
Ex
tensions
Client
ns
string
ns
string
}
}
// newHorizontalPodAutoscalers returns a horizontalPodAutoscalers
// newHorizontalPodAutoscalers returns a horizontalPodAutoscalers
func
newHorizontalPodAutoscalers
(
c
*
Ex
perimental
Client
,
namespace
string
)
*
horizontalPodAutoscalers
{
func
newHorizontalPodAutoscalers
(
c
*
Ex
tensions
Client
,
namespace
string
)
*
horizontalPodAutoscalers
{
return
&
horizontalPodAutoscalers
{
return
&
horizontalPodAutoscalers
{
client
:
c
,
client
:
c
,
ns
:
namespace
,
ns
:
namespace
,
...
...
pkg/client/unversioned/ingress.go
View file @
9a812bd0
...
@@ -42,12 +42,12 @@ type IngressInterface interface {
...
@@ -42,12 +42,12 @@ type IngressInterface interface {
// ingress implements IngressNamespacer interface
// ingress implements IngressNamespacer interface
type
ingress
struct
{
type
ingress
struct
{
r
*
Ex
perimental
Client
r
*
Ex
tensions
Client
ns
string
ns
string
}
}
// newIngress returns a ingress
// newIngress returns a ingress
func
newIngress
(
c
*
Ex
perimental
Client
,
namespace
string
)
*
ingress
{
func
newIngress
(
c
*
Ex
tensions
Client
,
namespace
string
)
*
ingress
{
return
&
ingress
{
c
,
namespace
}
return
&
ingress
{
c
,
namespace
}
}
}
...
...
pkg/client/unversioned/jobs.go
View file @
9a812bd0
...
@@ -43,12 +43,12 @@ type JobInterface interface {
...
@@ -43,12 +43,12 @@ type JobInterface interface {
// jobs implements JobsNamespacer interface
// jobs implements JobsNamespacer interface
type
jobs
struct
{
type
jobs
struct
{
r
*
Ex
perimental
Client
r
*
Ex
tensions
Client
ns
string
ns
string
}
}
// newJobs returns a jobs
// newJobs returns a jobs
func
newJobs
(
c
*
Ex
perimental
Client
,
namespace
string
)
*
jobs
{
func
newJobs
(
c
*
Ex
tensions
Client
,
namespace
string
)
*
jobs
{
return
&
jobs
{
c
,
namespace
}
return
&
jobs
{
c
,
namespace
}
}
}
...
...
pkg/client/unversioned/scale.go
View file @
9a812bd0
...
@@ -33,12 +33,12 @@ type ScaleInterface interface {
...
@@ -33,12 +33,12 @@ type ScaleInterface interface {
// horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface
// horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface
type
scales
struct
{
type
scales
struct
{
client
*
Ex
perimental
Client
client
*
Ex
tensions
Client
ns
string
ns
string
}
}
// newHorizontalPodAutoscalers returns a horizontalPodAutoscalers
// newHorizontalPodAutoscalers returns a horizontalPodAutoscalers
func
newScales
(
c
*
Ex
perimental
Client
,
namespace
string
)
*
scales
{
func
newScales
(
c
*
Ex
tensions
Client
,
namespace
string
)
*
scales
{
return
&
scales
{
return
&
scales
{
client
:
c
,
client
:
c
,
ns
:
namespace
,
ns
:
namespace
,
...
...
pkg/kubectl/cmd/util/factory.go
View file @
9a812bd0
...
@@ -143,7 +143,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
...
@@ -143,7 +143,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
case
""
:
case
""
:
return
client
.
RESTClient
,
nil
return
client
.
RESTClient
,
nil
case
"extensions"
:
case
"extensions"
:
return
client
.
Ex
perimental
Client
.
RESTClient
,
nil
return
client
.
Ex
tensions
Client
.
RESTClient
,
nil
}
}
return
nil
,
fmt
.
Errorf
(
"unable to get RESTClient for resource '%s'"
,
mapping
.
Resource
)
return
nil
,
fmt
.
Errorf
(
"unable to get RESTClient for resource '%s'"
,
mapping
.
Resource
)
},
},
...
@@ -407,10 +407,10 @@ func (c *clientSwaggerSchema) ValidateBytes(data []byte) error {
...
@@ -407,10 +407,10 @@ func (c *clientSwaggerSchema) ValidateBytes(data []byte) error {
return
fmt
.
Errorf
(
"could not find api group for %s: %v"
,
kind
,
err
)
return
fmt
.
Errorf
(
"could not find api group for %s: %v"
,
kind
,
err
)
}
}
if
group
==
"extensions"
{
if
group
==
"extensions"
{
if
c
.
c
.
Ex
perimental
Client
==
nil
{
if
c
.
c
.
Ex
tensions
Client
==
nil
{
return
errors
.
New
(
"unable to validate: no experimental client"
)
return
errors
.
New
(
"unable to validate: no experimental client"
)
}
}
return
getSchemaAndValidate
(
c
.
c
.
Ex
perimental
Client
.
RESTClient
,
data
,
"apis/"
,
version
,
c
.
cacheDir
)
return
getSchemaAndValidate
(
c
.
c
.
Ex
tensions
Client
.
RESTClient
,
data
,
"apis/"
,
version
,
c
.
cacheDir
)
}
}
return
getSchemaAndValidate
(
c
.
c
.
RESTClient
,
data
,
"api"
,
version
,
c
.
cacheDir
)
return
getSchemaAndValidate
(
c
.
c
.
RESTClient
,
data
,
"api"
,
version
,
c
.
cacheDir
)
}
}
...
...
pkg/kubectl/scale_test.go
View file @
9a812bd0
...
@@ -78,12 +78,12 @@ func (c *ErrorJobClient) Jobs(namespace string) client.JobInterface {
...
@@ -78,12 +78,12 @@ func (c *ErrorJobClient) Jobs(namespace string) client.JobInterface {
return
&
ErrorJobs
{
testclient
.
FakeJobs
{
Fake
:
&
c
.
FakeExperimental
,
Namespace
:
namespace
},
c
.
invalid
}
return
&
ErrorJobs
{
testclient
.
FakeJobs
{
Fake
:
&
c
.
FakeExperimental
,
Namespace
:
namespace
},
c
.
invalid
}
}
}
type
ErrorEx
perimental
Client
struct
{
type
ErrorEx
tensions
Client
struct
{
testclient
.
Fake
testclient
.
Fake
invalid
bool
invalid
bool
}
}
func
(
c
*
ErrorEx
perimental
Client
)
Experimental
()
client
.
ExtensionsInterface
{
func
(
c
*
ErrorEx
tensions
Client
)
Experimental
()
client
.
ExtensionsInterface
{
return
&
ErrorJobClient
{
testclient
.
FakeExperimental
{
&
c
.
Fake
},
c
.
invalid
}
return
&
ErrorJobClient
{
testclient
.
FakeExperimental
{
&
c
.
Fake
},
c
.
invalid
}
}
}
...
@@ -287,7 +287,7 @@ func TestValidateReplicationController(t *testing.T) {
...
@@ -287,7 +287,7 @@ func TestValidateReplicationController(t *testing.T) {
}
}
func
TestJobScaleRetry
(
t
*
testing
.
T
)
{
func
TestJobScaleRetry
(
t
*
testing
.
T
)
{
fake
:=
&
ErrorEx
perimental
Client
{
Fake
:
testclient
.
Fake
{},
invalid
:
false
}
fake
:=
&
ErrorEx
tensions
Client
{
Fake
:
testclient
.
Fake
{},
invalid
:
false
}
scaler
:=
JobScaler
{
fake
}
scaler
:=
JobScaler
{
fake
}
preconditions
:=
ScalePrecondition
{
-
1
,
""
}
preconditions
:=
ScalePrecondition
{
-
1
,
""
}
count
:=
uint
(
3
)
count
:=
uint
(
3
)
...
@@ -331,7 +331,7 @@ func TestJobScale(t *testing.T) {
...
@@ -331,7 +331,7 @@ func TestJobScale(t *testing.T) {
}
}
func
TestJobScaleInvalid
(
t
*
testing
.
T
)
{
func
TestJobScaleInvalid
(
t
*
testing
.
T
)
{
fake
:=
&
ErrorEx
perimental
Client
{
Fake
:
testclient
.
Fake
{},
invalid
:
true
}
fake
:=
&
ErrorEx
tensions
Client
{
Fake
:
testclient
.
Fake
{},
invalid
:
true
}
scaler
:=
JobScaler
{
fake
}
scaler
:=
JobScaler
{
fake
}
preconditions
:=
ScalePrecondition
{
-
1
,
""
}
preconditions
:=
ScalePrecondition
{
-
1
,
""
}
count
:=
uint
(
3
)
count
:=
uint
(
3
)
...
...
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