Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
8a0718a6
Commit
8a0718a6
authored
Oct 23, 2018
by
Darren Shepherd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for SQL driver
parent
9eb6d525
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
config.go
...src/k8s.io/apiserver/pkg/storage/storagebackend/config.go
+1
-0
factory.go
...o/apiserver/pkg/storage/storagebackend/factory/factory.go
+7
-2
No files found.
staging/src/k8s.io/apiserver/pkg/storage/storagebackend/config.go
View file @
8a0718a6
...
@@ -25,6 +25,7 @@ import (
...
@@ -25,6 +25,7 @@ import (
const
(
const
(
StorageTypeUnset
=
""
StorageTypeUnset
=
""
StorageTypeKVSQL
=
"kvsql"
StorageTypeETCD2
=
"etcd2"
StorageTypeETCD2
=
"etcd2"
StorageTypeETCD3
=
"etcd3"
StorageTypeETCD3
=
"etcd3"
...
...
staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go
View file @
8a0718a6
...
@@ -19,6 +19,7 @@ package factory
...
@@ -19,6 +19,7 @@ package factory
import
(
import
(
"fmt"
"fmt"
"github.com/ibuildthecloud/kvsql"
"k8s.io/apiserver/pkg/storage"
"k8s.io/apiserver/pkg/storage"
"k8s.io/apiserver/pkg/storage/storagebackend"
"k8s.io/apiserver/pkg/storage/storagebackend"
)
)
...
@@ -29,7 +30,9 @@ type DestroyFunc func()
...
@@ -29,7 +30,9 @@ 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
)
(
storage
.
Interface
,
DestroyFunc
,
error
)
{
func
Create
(
c
storagebackend
.
Config
)
(
storage
.
Interface
,
DestroyFunc
,
error
)
{
switch
c
.
Type
{
switch
c
.
Type
{
case
storagebackend
.
StorageTypeUnset
,
storagebackend
.
StorageTypeETCD3
:
case
storagebackend
.
StorageTypeUnset
,
storagebackend
.
StorageTypeKVSQL
:
return
factory
.
NewKVSQLStorage
(
c
)
case
storagebackend
.
StorageTypeETCD3
:
// TODO: We have the following features to implement:
// TODO: We have the following features to implement:
// - Support secure connection by using key, cert, and CA files.
// - Support secure connection by using key, cert, and CA files.
// - Honor "https" scheme to support secure connection in gRPC.
// - Honor "https" scheme to support secure connection in gRPC.
...
@@ -43,7 +46,9 @@ func Create(c storagebackend.Config) (storage.Interface, DestroyFunc, error) {
...
@@ -43,7 +46,9 @@ func Create(c storagebackend.Config) (storage.Interface, DestroyFunc, error) {
// 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
storagebackend
.
StorageTypeUnset
,
storagebackend
.
StorageTypeETCD3
:
case
storagebackend
.
StorageTypeUnset
,
storagebackend
.
StorageTypeKVSQL
:
return
factory
.
NewKVSQLHealthCheck
(
c
)
case
storagebackend
.
StorageTypeETCD3
:
return
newETCD3HealthCheck
(
c
)
return
newETCD3HealthCheck
(
c
)
default
:
default
:
return
nil
,
fmt
.
Errorf
(
"unknown storage type: %s"
,
c
.
Type
)
return
nil
,
fmt
.
Errorf
(
"unknown storage type: %s"
,
c
.
Type
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment