mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #101107 from cmssczy/etcd_storage
fix hardcoding and format error log
This commit is contained in:
commit
2bda8ac3ec
@ -27,6 +27,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
StorageTypeUnset = ""
|
StorageTypeUnset = ""
|
||||||
|
StorageTypeETCD2 = "etcd2"
|
||||||
StorageTypeETCD3 = "etcd3"
|
StorageTypeETCD3 = "etcd3"
|
||||||
|
|
||||||
DefaultCompactInterval = 5 * time.Minute
|
DefaultCompactInterval = 5 * time.Minute
|
||||||
|
@ -30,8 +30,8 @@ type DestroyFunc func()
|
|||||||
// Create creates a storage backend based on given config.
|
// Create creates a storage backend based on given config.
|
||||||
func Create(c storagebackend.Config, newFunc func() runtime.Object) (storage.Interface, DestroyFunc, error) {
|
func Create(c storagebackend.Config, newFunc func() runtime.Object) (storage.Interface, DestroyFunc, error) {
|
||||||
switch c.Type {
|
switch c.Type {
|
||||||
case "etcd2":
|
case storagebackend.StorageTypeETCD2:
|
||||||
return nil, nil, fmt.Errorf("%v is no longer a supported storage backend", c.Type)
|
return nil, nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type)
|
||||||
case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3:
|
case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3:
|
||||||
return newETCD3Storage(c, newFunc)
|
return newETCD3Storage(c, newFunc)
|
||||||
default:
|
default:
|
||||||
@ -42,8 +42,8 @@ func Create(c storagebackend.Config, newFunc func() runtime.Object) (storage.Int
|
|||||||
// CreateHealthCheck creates a healthcheck function based on given config.
|
// CreateHealthCheck creates a healthcheck function based on given config.
|
||||||
func CreateHealthCheck(c storagebackend.Config) (func() error, error) {
|
func CreateHealthCheck(c storagebackend.Config) (func() error, error) {
|
||||||
switch c.Type {
|
switch c.Type {
|
||||||
case "etcd2":
|
case storagebackend.StorageTypeETCD2:
|
||||||
return nil, fmt.Errorf("%v is no longer a supported storage backend", c.Type)
|
return nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type)
|
||||||
case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3:
|
case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3:
|
||||||
return newETCD3HealthCheck(c)
|
return newETCD3HealthCheck(c)
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user