From 8a7286eb6cea31b6ad9627004f5e9e51385afb5a Mon Sep 17 00:00:00 2001 From: Kevin Franklin Kim Date: Thu, 17 Oct 2024 13:28:04 +0200 Subject: [PATCH] docs(foomo/squadron): add README --- foomo/squadron/README.md | 77 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 foomo/squadron/README.md diff --git a/foomo/squadron/README.md b/foomo/squadron/README.md new file mode 100644 index 0000000..e7b2360 --- /dev/null +++ b/foomo/squadron/README.md @@ -0,0 +1,77 @@ +# POSH squadron provider + +## Usage + +### Plugin + +```go +package plugin + +type Plugin struct { + l log.Logger + cache cache.Cache + op *onepassword.OnePassword + kubectl *kubectl.Kubectl + commands command.Commands + squadron *squadron.Squadron +} + +func New(l log.Logger) (plugin.Plugin, error) { + var err error + inst := &Plugin{ + l: l, + cache: cache.MemoryCache{}, + commands: command.Commands{}, + } + + // ... + + inst.op, err = onepassword.New(l, inst.cache) + if err != nil { + return nil, errors.Wrap(err, "failed to create onepassword") + } + + inst.kubectl, err = kubectl.New(l, inst.cache) + if err != nil { + return nil, errors.Wrap(err, "failed to create kubectl") + } + + inst.squadron, err = squadron.New(l, inst.kubectl) + if err != nil { + return nil, errors.Wrap(err, "failed to create squadron") + } + + inst.commands.Add(squadron.NewCommand(l, inst.squadron, inst.kubectl, inst.op, inst.cache)) + + // ... + + return inst, nil +} +``` + +### Config + +To install binary locally, add: + +```yaml +squadron: + path: squadrons + clusters: + - name: prod + fleets: ["default"] + - name: dev + fleets: ["default"] +``` + +### Ownbrew + +To install binary locally, add: + +```yaml +ownbrew: + packages: + # https://github.com/foomo/squadron/releases + - name: squadron + tap: foomo/tap/foomo/squadron + version: 2.1.5 +```