Skip to content

Commit

Permalink
Merge pull request #14 from carlosedp/nocgo
Browse files Browse the repository at this point in the history
Stub-out sqlite drivers to build Kine without CGO
  • Loading branch information
ibuildthecloud authored Dec 16, 2019
2 parents d9d5ac9 + 928bb1f commit 92fec78
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/drivers/sqlite/sqlite.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build cgo

package sqlite

import (
Expand Down
26 changes: 26 additions & 0 deletions pkg/drivers/sqlite/sqlite_nocgo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// +build !cgo

package sqlite

import (
"errors"
"database/sql"

"github.com/rancher/kine/pkg/drivers/generic"
"github.com/rancher/kine/pkg/server"

)

var errNoCgo = errors.New("this binary is built without CGO, sqlite is disabled")

func New(dataSourceName string) (server.Backend, error) {
return nil, errNoCgo
}

func NewVariant(driverName, dataSourceName string) (server.Backend, *generic.Generic, error) {
return nil, nil, errNoCgo
}

func setup(db *sql.DB) error {
return errNoCgo
}

0 comments on commit 92fec78

Please sign in to comment.