diff --git a/pkg/drivers/sqlite/sqlite.go b/pkg/drivers/sqlite/sqlite.go index 6e3e26e5..f4d1127d 100644 --- a/pkg/drivers/sqlite/sqlite.go +++ b/pkg/drivers/sqlite/sqlite.go @@ -1,3 +1,5 @@ +// +build cgo + package sqlite import ( diff --git a/pkg/drivers/sqlite/sqlite_nocgo.go b/pkg/drivers/sqlite/sqlite_nocgo.go new file mode 100644 index 00000000..20778323 --- /dev/null +++ b/pkg/drivers/sqlite/sqlite_nocgo.go @@ -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 +}