Commit f938b5e2 authored by Darren Shepherd's avatar Darren Shepherd

Add support for SQL driver

parent 6b923beb
......@@ -8,6 +8,8 @@ import (
"github.com/sirupsen/logrus"
"k8s.io/kubernetes/pkg/wrapper/agent"
"k8s.io/kubernetes/pkg/wrapper/server"
_ "github.com/mattn/go-sqlite3"
)
func runAgent() {
......
......@@ -25,6 +25,7 @@ import (
const (
StorageTypeUnset = ""
StorageTypeKVSQL = "kvsql"
StorageTypeETCD2 = "etcd2"
StorageTypeETCD3 = "etcd3"
......
......@@ -19,6 +19,7 @@ package factory
import (
"fmt"
"github.com/ibuildthecloud/kvsql"
"k8s.io/apiserver/pkg/storage"
"k8s.io/apiserver/pkg/storage/storagebackend"
)
......@@ -29,7 +30,9 @@ type DestroyFunc func()
// Create creates a storage backend based on given config.
func Create(c storagebackend.Config) (storage.Interface, DestroyFunc, error) {
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:
// - Support secure connection by using key, cert, and CA files.
// - Honor "https" scheme to support secure connection in gRPC.
......@@ -43,7 +46,9 @@ func Create(c storagebackend.Config) (storage.Interface, DestroyFunc, error) {
// CreateHealthCheck creates a healthcheck function based on given config.
func CreateHealthCheck(c storagebackend.Config) (func() error, error) {
switch c.Type {
case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3:
case storagebackend.StorageTypeUnset, storagebackend.StorageTypeKVSQL:
return factory.NewKVSQLHealthCheck(c)
case storagebackend.StorageTypeETCD3:
return newETCD3HealthCheck(c)
default:
return nil, fmt.Errorf("unknown storage type: %s", c.Type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment