mirror of https://github.com/k3s-io/k3s
grep sed ExperimentalClient
parent
9aa163aa88
commit
9a812bd0c5
|
@ -136,7 +136,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
|
|||
|
||||
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
|
||||
// We will fix this by supporting multiple group versions in Config
|
||||
cl.ExperimentalClient = client.NewExperimentalOrDie(&client.Config{Host: apiServer.URL, Version: testapi.Extensions.GroupAndVersion()})
|
||||
cl.ExtensionsClient = client.NewExperimentalOrDie(&client.Config{Host: apiServer.URL, Version: testapi.Extensions.GroupAndVersion()})
|
||||
|
||||
storageVersions := make(map[string]string)
|
||||
etcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("").InterfacesFor, testapi.Default.GroupAndVersion(), etcdtest.PathPrefix())
|
||||
|
@ -986,7 +986,7 @@ func main() {
|
|||
kubeClient := client.NewOrDie(&client.Config{Host: apiServerURL, Version: testapi.Default.GroupAndVersion()})
|
||||
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
|
||||
// We will fix this by supporting multiple group versions in Config
|
||||
kubeClient.ExperimentalClient = client.NewExperimentalOrDie(&client.Config{Host: apiServerURL, Version: testapi.Extensions.GroupAndVersion()})
|
||||
kubeClient.ExtensionsClient = client.NewExperimentalOrDie(&client.Config{Host: apiServerURL, Version: testapi.Extensions.GroupAndVersion()})
|
||||
|
||||
// Run tests in parallel
|
||||
testFuncs := []testFunc{
|
||||
|
|
|
@ -128,7 +128,7 @@ type APIStatus interface {
|
|||
// Client is the implementation of a Kubernetes client.
|
||||
type Client struct {
|
||||
*RESTClient
|
||||
*ExperimentalClient
|
||||
*ExtensionsClient
|
||||
}
|
||||
|
||||
// ServerVersion retrieves and parses the server's version.
|
||||
|
@ -244,5 +244,5 @@ func IsTimeout(err error) bool {
|
|||
}
|
||||
|
||||
func (c *Client) Experimental() ExtensionsInterface {
|
||||
return c.ExperimentalClient
|
||||
return c.ExtensionsClient
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ func (c *testClient) Setup(t *testing.T) *testClient {
|
|||
if len(version) == 0 {
|
||||
version = testapi.Extensions.Version()
|
||||
}
|
||||
c.ExperimentalClient = NewExperimentalOrDie(&Config{
|
||||
c.ExtensionsClient = NewExperimentalOrDie(&Config{
|
||||
Host: c.server.URL,
|
||||
Version: version,
|
||||
})
|
||||
|
|
|
@ -40,11 +40,11 @@ type DaemonSetInterface interface {
|
|||
|
||||
// daemonSets implements DaemonsSetsNamespacer interface
|
||||
type daemonSets struct {
|
||||
r *ExperimentalClient
|
||||
r *ExtensionsClient
|
||||
ns string
|
||||
}
|
||||
|
||||
func newDaemonSets(c *ExperimentalClient, namespace string) *daemonSets {
|
||||
func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
|
||||
return &daemonSets{c, namespace}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,12 +41,12 @@ type DeploymentInterface interface {
|
|||
|
||||
// deployments implements DeploymentInterface
|
||||
type deployments struct {
|
||||
client *ExperimentalClient
|
||||
client *ExtensionsClient
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDeployments returns a Deployments
|
||||
func newDeployments(c *ExperimentalClient, namespace string) *deployments {
|
||||
func newDeployments(c *ExtensionsClient, namespace string) *deployments {
|
||||
return &deployments{
|
||||
client: c,
|
||||
ns: namespace,
|
||||
|
|
|
@ -147,14 +147,14 @@ func New(c *Config) (*Client, error) {
|
|||
}
|
||||
|
||||
if _, err := latest.Group("extensions"); err != nil {
|
||||
return &Client{RESTClient: client, ExperimentalClient: nil}, nil
|
||||
return &Client{RESTClient: client, ExtensionsClient: nil}, nil
|
||||
}
|
||||
experimentalConfig := *c
|
||||
experimentalClient, err := NewExperimental(&experimentalConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Client{RESTClient: client, ExperimentalClient: experimentalClient}, nil
|
||||
return &Client{RESTClient: client, ExtensionsClient: experimentalClient}, nil
|
||||
}
|
||||
|
||||
// MatchesServerVersion queries the server to compares the build version
|
||||
|
|
|
@ -42,12 +42,12 @@ type HorizontalPodAutoscalerInterface interface {
|
|||
|
||||
// horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface
|
||||
type horizontalPodAutoscalers struct {
|
||||
client *ExperimentalClient
|
||||
client *ExtensionsClient
|
||||
ns string
|
||||
}
|
||||
|
||||
// newHorizontalPodAutoscalers returns a horizontalPodAutoscalers
|
||||
func newHorizontalPodAutoscalers(c *ExperimentalClient, namespace string) *horizontalPodAutoscalers {
|
||||
func newHorizontalPodAutoscalers(c *ExtensionsClient, namespace string) *horizontalPodAutoscalers {
|
||||
return &horizontalPodAutoscalers{
|
||||
client: c,
|
||||
ns: namespace,
|
||||
|
|
|
@ -42,12 +42,12 @@ type IngressInterface interface {
|
|||
|
||||
// ingress implements IngressNamespacer interface
|
||||
type ingress struct {
|
||||
r *ExperimentalClient
|
||||
r *ExtensionsClient
|
||||
ns string
|
||||
}
|
||||
|
||||
// newIngress returns a ingress
|
||||
func newIngress(c *ExperimentalClient, namespace string) *ingress {
|
||||
func newIngress(c *ExtensionsClient, namespace string) *ingress {
|
||||
return &ingress{c, namespace}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,12 +43,12 @@ type JobInterface interface {
|
|||
|
||||
// jobs implements JobsNamespacer interface
|
||||
type jobs struct {
|
||||
r *ExperimentalClient
|
||||
r *ExtensionsClient
|
||||
ns string
|
||||
}
|
||||
|
||||
// newJobs returns a jobs
|
||||
func newJobs(c *ExperimentalClient, namespace string) *jobs {
|
||||
func newJobs(c *ExtensionsClient, namespace string) *jobs {
|
||||
return &jobs{c, namespace}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@ type ScaleInterface interface {
|
|||
|
||||
// horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface
|
||||
type scales struct {
|
||||
client *ExperimentalClient
|
||||
client *ExtensionsClient
|
||||
ns string
|
||||
}
|
||||
|
||||
// newHorizontalPodAutoscalers returns a horizontalPodAutoscalers
|
||||
func newScales(c *ExperimentalClient, namespace string) *scales {
|
||||
func newScales(c *ExtensionsClient, namespace string) *scales {
|
||||
return &scales{
|
||||
client: c,
|
||||
ns: namespace,
|
||||
|
|
|
@ -143,7 +143,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
|
|||
case "":
|
||||
return client.RESTClient, nil
|
||||
case "extensions":
|
||||
return client.ExperimentalClient.RESTClient, nil
|
||||
return client.ExtensionsClient.RESTClient, nil
|
||||
}
|
||||
return nil, fmt.Errorf("unable to get RESTClient for resource '%s'", mapping.Resource)
|
||||
},
|
||||
|
@ -407,10 +407,10 @@ func (c *clientSwaggerSchema) ValidateBytes(data []byte) error {
|
|||
return fmt.Errorf("could not find api group for %s: %v", kind, err)
|
||||
}
|
||||
if group == "extensions" {
|
||||
if c.c.ExperimentalClient == nil {
|
||||
if c.c.ExtensionsClient == nil {
|
||||
return errors.New("unable to validate: no experimental client")
|
||||
}
|
||||
return getSchemaAndValidate(c.c.ExperimentalClient.RESTClient, data, "apis/", version, c.cacheDir)
|
||||
return getSchemaAndValidate(c.c.ExtensionsClient.RESTClient, data, "apis/", version, c.cacheDir)
|
||||
}
|
||||
return getSchemaAndValidate(c.c.RESTClient, data, "api", version, c.cacheDir)
|
||||
}
|
||||
|
|
|
@ -78,12 +78,12 @@ func (c *ErrorJobClient) Jobs(namespace string) client.JobInterface {
|
|||
return &ErrorJobs{testclient.FakeJobs{Fake: &c.FakeExperimental, Namespace: namespace}, c.invalid}
|
||||
}
|
||||
|
||||
type ErrorExperimentalClient struct {
|
||||
type ErrorExtensionsClient struct {
|
||||
testclient.Fake
|
||||
invalid bool
|
||||
}
|
||||
|
||||
func (c *ErrorExperimentalClient) Experimental() client.ExtensionsInterface {
|
||||
func (c *ErrorExtensionsClient) Experimental() client.ExtensionsInterface {
|
||||
return &ErrorJobClient{testclient.FakeExperimental{&c.Fake}, c.invalid}
|
||||
}
|
||||
|
||||
|
@ -287,7 +287,7 @@ func TestValidateReplicationController(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestJobScaleRetry(t *testing.T) {
|
||||
fake := &ErrorExperimentalClient{Fake: testclient.Fake{}, invalid: false}
|
||||
fake := &ErrorExtensionsClient{Fake: testclient.Fake{}, invalid: false}
|
||||
scaler := JobScaler{fake}
|
||||
preconditions := ScalePrecondition{-1, ""}
|
||||
count := uint(3)
|
||||
|
@ -331,7 +331,7 @@ func TestJobScale(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestJobScaleInvalid(t *testing.T) {
|
||||
fake := &ErrorExperimentalClient{Fake: testclient.Fake{}, invalid: true}
|
||||
fake := &ErrorExtensionsClient{Fake: testclient.Fake{}, invalid: true}
|
||||
scaler := JobScaler{fake}
|
||||
preconditions := ScalePrecondition{-1, ""}
|
||||
count := uint(3)
|
||||
|
|
Loading…
Reference in New Issue