mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-06-03 01:44:53 +00:00
Merge pull request #55 from c3os-io/feature/cluster-provider
Abstract Cluster Provisioning with Cluster Plugins
This commit is contained in:
parent
7ac3c30747
commit
b19a93e984
@ -6,9 +6,10 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
events "github.com/c3os-io/c3os/sdk/bus"
|
||||
|
||||
"github.com/c3os-io/c3os/internal/bus"
|
||||
machine "github.com/c3os-io/c3os/internal/machine"
|
||||
events "github.com/c3os-io/c3os/pkg/bus"
|
||||
config "github.com/c3os-io/c3os/pkg/config"
|
||||
"github.com/nxadm/tail"
|
||||
)
|
||||
|
@ -10,7 +10,8 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
events "github.com/c3os-io/c3os/pkg/bus"
|
||||
events "github.com/c3os-io/c3os/sdk/bus"
|
||||
|
||||
config "github.com/c3os-io/c3os/pkg/config"
|
||||
|
||||
"github.com/c3os-io/c3os/internal/bus"
|
||||
|
23
internal/agent/notify.go
Normal file
23
internal/agent/notify.go
Normal file
@ -0,0 +1,23 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"github.com/c3os-io/c3os/internal/bus"
|
||||
"github.com/c3os-io/c3os/pkg/config"
|
||||
events "github.com/c3os-io/c3os/sdk/bus"
|
||||
"github.com/mudler/go-pluggable"
|
||||
)
|
||||
|
||||
func Notify(event string, dirs []string) error {
|
||||
bus.Manager.Initialize()
|
||||
|
||||
c, err := config.Scan(config.Directories(dirs...))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = bus.Manager.Publish(pluggable.EventType(event), events.EventPayload{
|
||||
Config: c.String(),
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
@ -5,7 +5,8 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/c3os-io/c3os/pkg/bus"
|
||||
"github.com/c3os-io/c3os/sdk/bus"
|
||||
|
||||
"github.com/mudler/go-pluggable"
|
||||
)
|
||||
|
||||
@ -15,6 +16,7 @@ var Manager = &Bus{
|
||||
[]pluggable.EventType{
|
||||
bus.EventBootstrap,
|
||||
bus.EventChallenge,
|
||||
bus.EventBoot,
|
||||
bus.EventInstall,
|
||||
},
|
||||
),
|
||||
|
@ -6,6 +6,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/c3os-io/c3os/sdk/bus"
|
||||
|
||||
logging "github.com/ipfs/go-log"
|
||||
edgeVPNClient "github.com/mudler/edgevpn/api/client"
|
||||
"go.uber.org/zap"
|
||||
@ -18,7 +20,6 @@ import (
|
||||
"github.com/c3os-io/c3os/internal/role"
|
||||
"github.com/c3os-io/c3os/internal/utils"
|
||||
|
||||
"github.com/c3os-io/c3os/pkg/bus"
|
||||
"github.com/c3os-io/c3os/pkg/config"
|
||||
"github.com/mudler/edgevpn/api/client/service"
|
||||
"github.com/mudler/go-pluggable"
|
||||
|
@ -5,9 +5,10 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/c3os-io/c3os/sdk/bus"
|
||||
|
||||
. "github.com/c3os-io/c3os/internal/provider"
|
||||
providerConfig "github.com/c3os-io/c3os/internal/provider/config"
|
||||
"github.com/c3os-io/c3os/pkg/bus"
|
||||
"github.com/mudler/go-pluggable"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
|
@ -3,8 +3,9 @@ package provider
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/c3os-io/c3os/sdk/bus"
|
||||
|
||||
providerConfig "github.com/c3os-io/c3os/internal/provider/config"
|
||||
"github.com/c3os-io/c3os/pkg/bus"
|
||||
"github.com/c3os-io/c3os/pkg/config"
|
||||
|
||||
"github.com/mudler/go-nodepair"
|
||||
|
@ -5,10 +5,11 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/c3os-io/c3os/sdk/bus"
|
||||
|
||||
providerConfig "github.com/c3os-io/c3os/internal/provider/config"
|
||||
|
||||
. "github.com/c3os-io/c3os/internal/provider"
|
||||
"github.com/c3os-io/c3os/pkg/bus"
|
||||
"github.com/mudler/go-pluggable"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
|
@ -4,7 +4,8 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/c3os-io/c3os/pkg/bus"
|
||||
"github.com/c3os-io/c3os/sdk/bus"
|
||||
|
||||
"github.com/mudler/go-nodepair"
|
||||
"github.com/mudler/go-pluggable"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user