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
10917084
Commit
10917084
authored
Oct 12, 2015
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
experimental.go
parent
307fbeec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
extensions.go
pkg/client/unversioned/extensions.go
+24
-24
No files found.
pkg/client/unversioned/ex
perimental
.go
→
pkg/client/unversioned/ex
tensions
.go
View file @
10917084
...
@@ -28,9 +28,9 @@ import (
...
@@ -28,9 +28,9 @@ import (
// Interface holds the experimental methods for clients of Kubernetes
// Interface holds the experimental methods for clients of Kubernetes
// to allow mock testing.
// to allow mock testing.
//
Experimental features
are not supported and may be changed or removed in
//
Features of Extensions group
are not supported and may be changed or removed in
// incompatible ways at any time.
// incompatible ways at any time.
type
Ex
perimental
Interface
interface
{
type
Ex
tensions
Interface
interface
{
VersionInterface
VersionInterface
HorizontalPodAutoscalersNamespacer
HorizontalPodAutoscalersNamespacer
ScaleNamespacer
ScaleNamespacer
...
@@ -40,15 +40,15 @@ type ExperimentalInterface interface {
...
@@ -40,15 +40,15 @@ type ExperimentalInterface interface {
IngressNamespacer
IngressNamespacer
}
}
// Ex
perimental
Client is used to interact with experimental Kubernetes features.
// Ex
tensions
Client is used to interact with experimental Kubernetes features.
//
Experimental features
are not supported and may be changed or removed in
//
Features of Extensions group
are not supported and may be changed or removed in
// incompatible ways at any time.
// incompatible ways at any time.
type
Ex
perimental
Client
struct
{
type
Ex
tensions
Client
struct
{
*
RESTClient
*
RESTClient
}
}
// ServerVersion retrieves and parses the server's version.
// ServerVersion retrieves and parses the server's version.
func
(
c
*
Ex
perimental
Client
)
ServerVersion
()
(
*
version
.
Info
,
error
)
{
func
(
c
*
Ex
tensions
Client
)
ServerVersion
()
(
*
version
.
Info
,
error
)
{
body
,
err
:=
c
.
Get
()
.
AbsPath
(
"/version"
)
.
Do
()
.
Raw
()
body
,
err
:=
c
.
Get
()
.
AbsPath
(
"/version"
)
.
Do
()
.
Raw
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -63,7 +63,7 @@ func (c *ExperimentalClient) ServerVersion() (*version.Info, error) {
...
@@ -63,7 +63,7 @@ func (c *ExperimentalClient) ServerVersion() (*version.Info, error) {
// ServerAPIVersions retrieves and parses the list of experimental API versions the
// ServerAPIVersions retrieves and parses the list of experimental API versions the
// server supports.
// server supports.
func
(
c
*
Ex
perimental
Client
)
ServerAPIVersions
()
(
*
unversioned
.
APIVersions
,
error
)
{
func
(
c
*
Ex
tensions
Client
)
ServerAPIVersions
()
(
*
unversioned
.
APIVersions
,
error
)
{
body
,
err
:=
c
.
Get
()
.
UnversionedPath
(
""
)
.
Do
()
.
Raw
()
body
,
err
:=
c
.
Get
()
.
UnversionedPath
(
""
)
.
Do
()
.
Raw
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -76,59 +76,59 @@ func (c *ExperimentalClient) ServerAPIVersions() (*unversioned.APIVersions, erro
...
@@ -76,59 +76,59 @@ func (c *ExperimentalClient) ServerAPIVersions() (*unversioned.APIVersions, erro
return
&
v
,
nil
return
&
v
,
nil
}
}
func
(
c
*
Ex
perimental
Client
)
HorizontalPodAutoscalers
(
namespace
string
)
HorizontalPodAutoscalerInterface
{
func
(
c
*
Ex
tensions
Client
)
HorizontalPodAutoscalers
(
namespace
string
)
HorizontalPodAutoscalerInterface
{
return
newHorizontalPodAutoscalers
(
c
,
namespace
)
return
newHorizontalPodAutoscalers
(
c
,
namespace
)
}
}
func
(
c
*
Ex
perimental
Client
)
Scales
(
namespace
string
)
ScaleInterface
{
func
(
c
*
Ex
tensions
Client
)
Scales
(
namespace
string
)
ScaleInterface
{
return
newScales
(
c
,
namespace
)
return
newScales
(
c
,
namespace
)
}
}
func
(
c
*
Ex
perimental
Client
)
DaemonSets
(
namespace
string
)
DaemonSetInterface
{
func
(
c
*
Ex
tensions
Client
)
DaemonSets
(
namespace
string
)
DaemonSetInterface
{
return
newDaemonSets
(
c
,
namespace
)
return
newDaemonSets
(
c
,
namespace
)
}
}
func
(
c
*
Ex
perimental
Client
)
Deployments
(
namespace
string
)
DeploymentInterface
{
func
(
c
*
Ex
tensions
Client
)
Deployments
(
namespace
string
)
DeploymentInterface
{
return
newDeployments
(
c
,
namespace
)
return
newDeployments
(
c
,
namespace
)
}
}
func
(
c
*
Ex
perimental
Client
)
Jobs
(
namespace
string
)
JobInterface
{
func
(
c
*
Ex
tensions
Client
)
Jobs
(
namespace
string
)
JobInterface
{
return
newJobs
(
c
,
namespace
)
return
newJobs
(
c
,
namespace
)
}
}
func
(
c
*
Ex
perimental
Client
)
Ingress
(
namespace
string
)
IngressInterface
{
func
(
c
*
Ex
tensions
Client
)
Ingress
(
namespace
string
)
IngressInterface
{
return
newIngress
(
c
,
namespace
)
return
newIngress
(
c
,
namespace
)
}
}
// NewEx
perimental creates a new Experimental
Client for the given config. This client
// NewEx
tensions creates a new Extensions
Client for the given config. This client
// provides access to experimental Kubernetes features.
// provides access to experimental Kubernetes features.
//
Experimental features
are not supported and may be changed or removed in
//
Features of Extensions group
are not supported and may be changed or removed in
// incompatible ways at any time.
// incompatible ways at any time.
func
NewEx
perimental
(
c
*
Config
)
(
*
Experimental
Client
,
error
)
{
func
NewEx
tensions
(
c
*
Config
)
(
*
Extensions
Client
,
error
)
{
config
:=
*
c
config
:=
*
c
if
err
:=
setEx
perimental
Defaults
(
&
config
);
err
!=
nil
{
if
err
:=
setEx
tensions
Defaults
(
&
config
);
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
client
,
err
:=
RESTClientFor
(
&
config
)
client
,
err
:=
RESTClientFor
(
&
config
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
return
&
Ex
perimental
Client
{
client
},
nil
return
&
Ex
tensions
Client
{
client
},
nil
}
}
// NewEx
perimentalOrDie creates a new Experimental
Client for the given config and
// NewEx
tensionsOrDie creates a new Extensions
Client for the given config and
// panics if there is an error in the config.
// panics if there is an error in the config.
//
Experimental features
are not supported and may be changed or removed in
//
Features of Extensions group
are not supported and may be changed or removed in
// incompatible ways at any time.
// incompatible ways at any time.
func
NewEx
perimentalOrDie
(
c
*
Config
)
*
Experimental
Client
{
func
NewEx
tensionsOrDie
(
c
*
Config
)
*
Extensions
Client
{
client
,
err
:=
NewEx
perimental
(
c
)
client
,
err
:=
NewEx
tensions
(
c
)
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
return
client
return
client
}
}
func
setEx
perimental
Defaults
(
config
*
Config
)
error
{
func
setEx
tensions
Defaults
(
config
*
Config
)
error
{
// if experimental group is not registered, return an error
// if experimental group is not registered, return an error
g
,
err
:=
latest
.
Group
(
"extensions"
)
g
,
err
:=
latest
.
Group
(
"extensions"
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -145,7 +145,7 @@ func setExperimentalDefaults(config *Config) error {
...
@@ -145,7 +145,7 @@ func setExperimentalDefaults(config *Config) error {
versionInterfaces
,
err
:=
g
.
InterfacesFor
(
config
.
Version
)
versionInterfaces
,
err
:=
g
.
InterfacesFor
(
config
.
Version
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Ex
perimental
API version '%s' is not recognized (valid values: %s)"
,
return
fmt
.
Errorf
(
"Ex
tensions
API version '%s' is not recognized (valid values: %s)"
,
config
.
Version
,
strings
.
Join
(
latest
.
GroupOrDie
(
"extensions"
)
.
Versions
,
", "
))
config
.
Version
,
strings
.
Join
(
latest
.
GroupOrDie
(
"extensions"
)
.
Versions
,
", "
))
}
}
config
.
Codec
=
versionInterfaces
.
Codec
config
.
Codec
=
versionInterfaces
.
Codec
...
...
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