-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from carlosedp/nocgo
Stub-out sqlite drivers to build Kine without CGO
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build cgo | ||
|
||
package sqlite | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |