-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for connection to cluster manager (POC, pending spec) #630
base: main
Are you sure you want to change the base?
Conversation
|
||
// the server certificate is not signed by a CA, so we need to skip verification | ||
// we do validate it by checking the fingerprint with VerifyPeerCertificate | ||
tlsConfig.InsecureSkipVerify = true |
Check failure
Code scanning / CodeQL
Disabled TLS certificate check High
database/remotes.mapper.go
Outdated
"database/sql" | ||
"errors" | ||
"fmt" | ||
"github.com/canonical/microcluster/v2/cluster" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually fixed this one import. Any hints how to make update-schema
create the file with the right import directly?
database/remotes_table.go
Outdated
//go:generate mapper method -i -d github.com/canonical/microcluster/v2/cluster -e Remote Create table=remotes | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/v2/cluster -e Remote Update table=remotes | ||
//go:generate mapper method -i -d github.com/canonical/microcluster/v2/cluster -e Remote DeleteOne-by-Name table=remotes | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to also create queries for the RemoteConfigTable
, but adding
//go:generate mapper stmt -d github.com/canonical/microcluster/v2/cluster -e RemoteConfigTable objects table=remotes_config
here causes a segfaul in make update-schema
:
go generate ./...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x75a7d3]
goroutine 1 [running]:
github.com/canonical/lxd/lxd/db/generate/db.(*Field).IsScalar(...)
/home/edlerd/dev/open-source/lxd/lxd/db/generate/db/mapping.go:275
github.com/canonical/lxd/lxd/db/generate/db.(*Field).OrderBy(0x0, 0xc0000cf4a0, {0x7ffc38407a4e, 0xe})
/home/edlerd/dev/open-source/lxd/lxd/db/generate/db/mapping.go:363 +0x133
github.com/canonical/lxd/lxd/db/generate/db.(*Stmt).objects(0xc0002e7040, 0xc0000b29f0)
/home/edlerd/dev/open-source/lxd/lxd/db/generate/db/stmt.go:143 +0x530
github.com/canonical/lxd/lxd/db/generate/db.(*Stmt).Generate(0xc0002e7040, 0xc0000b29f0)
/home/edlerd/dev/open-source/lxd/lxd/db/generate/db/stmt.go:84 +0x165
github.com/canonical/lxd/lxd/db/generate/file.Append({0x7ffc38407a2e?, 0x2c?}, {0x7ffc384079e4, 0x11}, {0x9edfe8, 0xc0002e7040}, 0x40?)
/home/edlerd/dev/open-source/lxd/lxd/db/generate/file/write.go:85 +0xf4
main.newDbMapperStmt.func1(0xc000150400?, {0xc000142d80?, 0x4?, 0x90caea?})
/home/edlerd/dev/open-source/lxd/lxd/db/generate/db.go:110 +0x106
github.com/spf13/cobra.(*Command).execute(0xc00019ef08, {0xc000142d00, 0x8, 0x8})
/home/edlerd/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xc00019e008)
/home/edlerd/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
/home/edlerd/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
main.main()
/home/edlerd/dev/open-source/lxd/lxd/db/generate/main.go:9 +0x19
database/remotes_table.go:21: running "lxd-generate": exit status 2
make: *** [Makefile:91: update-schema] Error 1
cmd/microcloudd/main.go
Outdated
// todo: is this the right way to trigger the update? | ||
go func() { | ||
api.SendClusterManagerStatusMessageTask(s, state) | ||
time.Sleep(30 * time.Second) | ||
}() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be done with a different approach, or is this OK here?
d70c2b4
to
a613ccf
Compare
2aae33b
to
4b82a73
Compare
4b82a73
to
f79cfc2
Compare
Signed-off-by: David Edler <[email protected]>
f79cfc2
to
81719c4
Compare
Done
Draft status, as below items are still unclear: