Merge pull request #79645 from wojtek-t/cleanup_etcd_dir_3

Move etcd/util to etcd3/
This commit is contained in:
Kubernetes Prow Robot 2019-07-12 22:39:04 -07:00 committed by GitHub
commit 25ab6d82ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 9 additions and 133 deletions

View File

@ -456,7 +456,6 @@ staging/src/k8s.io/apiserver/pkg/server/httplog
staging/src/k8s.io/apiserver/pkg/server/options
staging/src/k8s.io/apiserver/pkg/server/storage
staging/src/k8s.io/apiserver/pkg/storage
staging/src/k8s.io/apiserver/pkg/storage/etcd/util
staging/src/k8s.io/apiserver/pkg/storage/etcd3/testing/testingcert
staging/src/k8s.io/apiserver/pkg/storage/storagebackend
staging/src/k8s.io/apiserver/pkg/storage/testing

View File

@ -56,7 +56,7 @@ go_library(
"//staging/src/k8s.io/apiserver/pkg/registry/rest:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/server:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/server/storage:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/storage/etcd/util:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/storage/etcd3:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/rest:go_default_library",

View File

@ -34,7 +34,7 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
genericapiserver "k8s.io/apiserver/pkg/server"
serverstorage "k8s.io/apiserver/pkg/server/storage"
etcdutil "k8s.io/apiserver/pkg/storage/etcd/util"
"k8s.io/apiserver/pkg/storage/etcd3"
utilfeature "k8s.io/apiserver/pkg/util/feature"
policyclient "k8s.io/client-go/kubernetes/typed/policy/v1beta1"
restclient "k8s.io/client-go/rest"
@ -284,7 +284,7 @@ func (s componentStatusStorage) serversToValidate() map[string]*componentstatus.
TLSConfig: machine.TLSConfig,
Port: port,
Path: "/health",
Validate: etcdutil.EtcdHealthCheck,
Validate: etcd3.EtcdHealthCheck,
}
}
return serversToValidate

View File

@ -57,7 +57,6 @@ filegroup(
":package-srcs",
"//staging/src/k8s.io/apiserver/pkg/storage/cacher:all-srcs",
"//staging/src/k8s.io/apiserver/pkg/storage/errors:all-srcs",
"//staging/src/k8s.io/apiserver/pkg/storage/etcd:all-srcs",
"//staging/src/k8s.io/apiserver/pkg/storage/etcd3:all-srcs",
"//staging/src/k8s.io/apiserver/pkg/storage/names:all-srcs",
"//staging/src/k8s.io/apiserver/pkg/storage/storagebackend:all-srcs",

View File

@ -1,26 +0,0 @@
package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["doc.go"],
importmap = "k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd",
importpath = "k8s.io/apiserver/pkg/storage/etcd",
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/apiserver/pkg/storage/etcd/util:all-srcs",
],
tags = ["automanaged"],
)

View File

@ -1,27 +0,0 @@
# See the OWNERS docs at https://go.k8s.io/owners
reviewers:
- lavalamp
- smarterclayton
- wojtek-t
- deads2k
- derekwaynecarr
- caesarxuchao
- mikedanese
- liggitt
- davidopp
- pmorie
- luxas
- janetkuo
- roberthbailey
- tallclair
- timothysc
- dims
- hongchaodeng
- krousey
- fgrzadkowski
- resouer
- pweil-
- mqliang
- feihujiang
- enj

View File

@ -1,17 +0,0 @@
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package etcd // import "k8s.io/apiserver/pkg/storage/etcd"

View File

@ -1,36 +0,0 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_test(
name = "go_default_test",
srcs = ["etcd_util_test.go"],
embed = [":go_default_library"],
)
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"etcd_util.go",
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd/util",
importpath = "k8s.io/apiserver/pkg/storage/etcd/util",
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)

View File

@ -1,19 +0,0 @@
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package util holds generic etcd-related utility functions that any user of ectd might want to
// use, without pulling in kubernetes-specific code.
package util // import "k8s.io/apiserver/pkg/storage/etcd/util"

View File

@ -12,6 +12,7 @@ go_test(
"api_object_versioner_test.go",
"compact_test.go",
"event_test.go",
"healthcheck_test.go",
"lease_manager_test.go",
"store_test.go",
"watcher_test.go",
@ -56,6 +57,7 @@ go_library(
"compact.go",
"errors.go",
"event.go",
"healthcheck.go",
"lease_manager.go",
"logger.go",
"store.go",

View File

@ -14,18 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package util
package etcd3
import (
"encoding/json"
"fmt"
)
// etcdHealth encodes data returned from etcd /healthz handler.
type etcdHealth struct {
// Note this has to be public so the json library can modify it.
Health string `json:"health"`
}
// EtcdHealthCheck decodes data returned from etcd /healthz handler.
func EtcdHealthCheck(data []byte) error {
obj := etcdHealth{}
if err := json.Unmarshal(data, &obj); err != nil {

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package util
package etcd3
import (
"testing"

1
vendor/modules.txt vendored
View File

@ -1260,7 +1260,6 @@ k8s.io/apiserver/pkg/server/storage
k8s.io/apiserver/pkg/storage
k8s.io/apiserver/pkg/storage/cacher
k8s.io/apiserver/pkg/storage/errors
k8s.io/apiserver/pkg/storage/etcd/util
k8s.io/apiserver/pkg/storage/etcd3
k8s.io/apiserver/pkg/storage/etcd3/metrics
k8s.io/apiserver/pkg/storage/etcd3/preflight