Skip to content

Commit

Permalink
lxd/db: Add a notlinux.go and a compiler directive to satisfy depende…
Browse files Browse the repository at this point in the history
…ncies

Signed-off-by: Ghadi Elie Rahme <[email protected]>
  • Loading branch information
ghadi-rahme committed Feb 25, 2025
1 parent 662de18 commit ce0e829
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lxd/db/errors.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build cgo && !agent

package db

import (
Expand Down
30 changes: 30 additions & 0 deletions lxd/db/notlinux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//go:build !linux || !cgo || agent

package db

import (
"context"
"database/sql"
"fmt"
)

const DefaultOfflineThreshold = 20

type ClusterTx struct {
tx *sql.Tx
nodeID int64
}

func (c *ClusterTx) Config(ctx context.Context) (map[string]string, error) {
if ctx != nil {
return nil, fmt.Errorf("Config not supported on this platform")
}
return nil, nil
}

func (c *ClusterTx) UpdateClusterConfig(values map[string]string) error {
if values != nil {
return fmt.Errorf("UpdateClusterConfig not supported on this platform")
}
return nil
}

0 comments on commit ce0e829

Please sign in to comment.