mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Move etcd/util to etcd3/
This commit is contained in:
parent
6d8dd21111
commit
23d9d6b1d0
@ -455,7 +455,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
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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",
|
||||
|
@ -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"],
|
||||
)
|
@ -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
|
@ -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"
|
@ -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"],
|
||||
)
|
@ -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"
|
@ -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",
|
||||
|
@ -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 {
|
@ -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
1
vendor/modules.txt
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user