mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 06:01:50 +00:00
Delete deprecated API versions
pkg/service: There were a couple of references here just as a reminder to change the behavior of findPort. As of v1beta3, TargetPort was always defaulted, so we could remove findDefaultPort and related tests. pkg/apiserver: The tests were using versioned API codecs for some of their encoding tests. Necessary API types had to be written and registered with the fake versioned codecs. pkg/kubectl: Some tests were converted to current versions where it made sense.
This commit is contained in:
@@ -23,8 +23,6 @@ import (
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta1"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta2"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3"
|
||||
pkg_runtime "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
||||
|
||||
|
@@ -24,8 +24,6 @@ import (
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta1"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta2"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3"
|
||||
pkg_runtime "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
||||
|
||||
|
@@ -605,23 +605,6 @@ func runPatchTest(c *client.Client) {
|
||||
RemoveLabelBody []byte
|
||||
RemoveAllLabelsBody []byte
|
||||
}{
|
||||
"v1beta1": {
|
||||
api.JSONPatchType: {
|
||||
[]byte(`[{"op":"add","path":"/labels","value":{"foo":"bar","baz":"qux"}}]`),
|
||||
[]byte(`[{"op":"remove","path":"/labels/foo"}]`),
|
||||
[]byte(`[{"op":"remove","path":"/labels"}]`),
|
||||
},
|
||||
api.MergePatchType: {
|
||||
[]byte(`{"labels":{"foo":"bar","baz":"qux"}}`),
|
||||
[]byte(`{"labels":{"foo":null}}`),
|
||||
[]byte(`{"labels":null}`),
|
||||
},
|
||||
api.StrategicMergePatchType: {
|
||||
[]byte(`{"labels":{"foo":"bar","baz":"qux"}}`),
|
||||
[]byte(`{"labels":{"foo":null}}`),
|
||||
[]byte(`{"labels":{"$patch":"replace"}}`),
|
||||
},
|
||||
},
|
||||
"v1beta3": {
|
||||
api.JSONPatchType: {
|
||||
[]byte(`[{"op":"add","path":"/metadata/labels","value":{"foo":"bar","baz":"qux"}}]`),
|
||||
@@ -938,7 +921,7 @@ func main() {
|
||||
glog.Infof("Running tests for APIVersion: %s", apiVersion)
|
||||
|
||||
firstManifestURL := ServeCachedManifestFile(testPodSpecFile)
|
||||
secondManifestURL := ServeCachedManifestFile(testManifestFile)
|
||||
secondManifestURL := ServeCachedManifestFile(testPodSpecFile)
|
||||
apiServerURL, _ := startComponents(firstManifestURL, secondManifestURL, apiVersion)
|
||||
|
||||
// Ok. we're good to go.
|
||||
@@ -1059,27 +1042,3 @@ const (
|
||||
}
|
||||
}`
|
||||
)
|
||||
|
||||
const (
|
||||
// This is copied from, and should be kept in sync with:
|
||||
// https://raw.githubusercontent.com/GoogleCloudPlatform/container-vm-guestbook-redis-python/master/manifest.yaml
|
||||
// Note that kubelet complains about these containers not having a self link.
|
||||
testManifestFile = `version: v1beta2
|
||||
id: container-vm-guestbook-manifest
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis
|
||||
volumeMounts:
|
||||
- name: redis-data
|
||||
mountPath: /data
|
||||
|
||||
- name: guestbook
|
||||
image: google/guestbook-python-redis
|
||||
ports:
|
||||
- name: www
|
||||
hostPort: 80
|
||||
containerPort: 80
|
||||
|
||||
volumes:
|
||||
- name: redis-data`
|
||||
)
|
||||
|
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": "nginx-controller",
|
||||
"apiVersion": "v1beta1",
|
||||
"kind": "ReplicationController",
|
||||
"desiredState": {
|
||||
"replicas": 2,
|
||||
"replicaSelector": {"name": "nginx"},
|
||||
"podTemplate": {
|
||||
"desiredState": {
|
||||
"manifest": {
|
||||
"version": "v1beta1",
|
||||
"id": "nginx-controller",
|
||||
"containers": [{
|
||||
"name": "nginx",
|
||||
"image": "nginx",
|
||||
"ports": [{"containerPort": 80}]
|
||||
}]
|
||||
}
|
||||
},
|
||||
"labels": {"name": "nginx"}
|
||||
}},
|
||||
"labels": {"name": "nginx"}
|
||||
}
|
@@ -264,16 +264,7 @@ func (s *APIServer) Run(_ []string) error {
|
||||
if ok && legacyAPIFlagValue == "false" {
|
||||
disableLegacyAPIs = true
|
||||
}
|
||||
|
||||
// "api/v1beta1={true|false} allows users to enable/disable v1beta1 API.
|
||||
// This takes preference over api/all and api/legacy, if specified.
|
||||
disableV1beta1 := disableAllAPIs || disableLegacyAPIs
|
||||
disableV1beta1 = !s.getRuntimeConfigValue("api/v1beta1", !disableV1beta1)
|
||||
|
||||
// "api/v1beta2={true|false} allows users to enable/disable v1beta2 API.
|
||||
// This takes preference over api/all and api/legacy, if specified.
|
||||
disableV1beta2 := disableAllAPIs || disableLegacyAPIs
|
||||
disableV1beta2 = !s.getRuntimeConfigValue("api/v1beta2", !disableV1beta2)
|
||||
_ = disableLegacyAPIs // hush the compiler while we don't have legacy APIs to disable.
|
||||
|
||||
// "api/v1beta3={true|false} allows users to enable/disable v1beta3 API.
|
||||
// This takes preference over api/all and api/legacy, if specified.
|
||||
@@ -369,8 +360,6 @@ func (s *APIServer) Run(_ []string) error {
|
||||
SupportsBasicAuth: len(s.BasicAuthFile) > 0,
|
||||
Authorizer: authorizer,
|
||||
AdmissionControl: admissionController,
|
||||
DisableV1Beta1: disableV1beta1,
|
||||
DisableV1Beta2: disableV1beta2,
|
||||
DisableV1Beta3: disableV1beta3,
|
||||
EnableV1: enableV1,
|
||||
MasterServiceNamespace: s.MasterServiceNamespace,
|
||||
|
@@ -28,8 +28,6 @@ import (
|
||||
"runtime"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta1"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta2"
|
||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||
|
||||
|
Reference in New Issue
Block a user