Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
78b2ff7
experimenting with k8s client
Jan 21, 2026
e248615
Fix go.mod
Jan 21, 2026
f06a0b7
Refactor actions, move utility functions to seperate scripts
Jan 23, 2026
a2c568d
add remove and scale to main, some cleanup/renaming
Jan 23, 2026
b75fddc
flag improvements, remove redundancy, make cli more robust
Jan 27, 2026
d0d9b87
Optimize kubernetes client use in apply.go via caching, remove fallba…
Jan 28, 2026
981f8bd
refactor health_check.go to add better UX for instance pod and deploy…
Jan 28, 2026
b0151b3
Fix deployment check
Jan 29, 2026
576f02c
add patch suggestion
Jan 29, 2026
269e9ce
refactor create.go for permission constants
Jan 29, 2026
94a1524
rename templating dir to instance and move create and remove actions …
Jan 29, 2026
a6bbf84
move bakendmanage actions and client to manage folder
Jan 29, 2026
e7f8d67
fix import in main
Jan 29, 2026
5227280
fix fmt
Jan 30, 2026
67f9427
Change constant type to fs.FileMode
Feb 2, 2026
5a62558
Add progress bar to waitForHealthy in health_check.go (pod check)
Feb 2, 2026
c24b9b2
change --force default to false, update description, secretsDirRoot c…
Feb 2, 2026
f8385bc
Refactor constants and file permissions to centralized internal/const…
Feb 2, 2026
a9ee0f3
improve marshalContent function in config.go
Feb 3, 2026
b8115d1
more constant consolidation and constants.go restructuring
Feb 3, 2026
788082c
centralizing constant, hardening flags and execution examples in back…
Feb 3, 2026
84b8663
add centralized constants use and robust flag handling
Feb 4, 2026
2bb3c02
streamline migration calls, add centralized constant use, robust flag…
Feb 4, 2026
68632ae
add the get.go and migrations.go constant fields to constants.go
Feb 4, 2026
cef18e3
small fixes
Feb 4, 2026
177eab9
update README.md for k8s actions integration and refactoring
Feb 4, 2026
2d33079
make golangci linter fix
Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,094 changes: 818 additions & 276 deletions README.md

Large diffs are not rendered by default.

41 changes: 32 additions & 9 deletions cmd/osmanage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ import (
"fmt"
"os"

"github.com/OpenSlides/openslides-cli/internal/actions/action"
"github.com/OpenSlides/openslides-cli/internal/actions/createuser"
"github.com/OpenSlides/openslides-cli/internal/actions/get"
"github.com/OpenSlides/openslides-cli/internal/actions/initialdata"
"github.com/OpenSlides/openslides-cli/internal/actions/migrations"
"github.com/OpenSlides/openslides-cli/internal/actions/set"
"github.com/OpenSlides/openslides-cli/internal/actions/setpassword"
"github.com/OpenSlides/openslides-cli/internal/instance/config"
"github.com/OpenSlides/openslides-cli/internal/instance/create"
"github.com/OpenSlides/openslides-cli/internal/instance/remove"
"github.com/OpenSlides/openslides-cli/internal/instance/setup"
k8sActions "github.com/OpenSlides/openslides-cli/internal/k8s/actions"
"github.com/OpenSlides/openslides-cli/internal/logger"
"github.com/OpenSlides/openslides-cli/internal/templating/config"
"github.com/OpenSlides/openslides-cli/internal/templating/setup"
"github.com/OpenSlides/openslides-cli/internal/manage/actions/action"
"github.com/OpenSlides/openslides-cli/internal/manage/actions/createuser"
"github.com/OpenSlides/openslides-cli/internal/manage/actions/get"
"github.com/OpenSlides/openslides-cli/internal/manage/actions/initialdata"
"github.com/OpenSlides/openslides-cli/internal/manage/actions/migrations"
"github.com/OpenSlides/openslides-cli/internal/manage/actions/set"
"github.com/OpenSlides/openslides-cli/internal/manage/actions/setpassword"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -62,16 +65,36 @@ func RootCmd() *cobra.Command {
return nil
}

// K8s command group
k8sCmd := &cobra.Command{
Use: "k8s",
Short: "Manage Kubernetes deployments",
Long: "Manage OpenSlides instances deployed on Kubernetes",
}

k8sCmd.AddCommand(
k8sActions.StartCmd(),
k8sActions.StopCmd(),
k8sActions.HealthCmd(),
k8sActions.ClusterStatusCmd(),
k8sActions.UpdateBackendmanageCmd(),
k8sActions.UpdateInstanceCmd(),
k8sActions.ScaleCmd(),
)

rootCmd.AddCommand(
setup.Cmd(),
config.Cmd(),
create.Cmd(),
remove.Cmd(),
createuser.Cmd(),
initialdata.Cmd(),
setpassword.Cmd(),
set.Cmd(),
get.Cmd(),
action.Cmd(),
migrations.Cmd(),
k8sCmd,
)

return rootCmd
Expand Down
1 change: 1 addition & 0 deletions cmd/osmanage/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestRootCmd(t *testing.T) {
logLevelFlag := cmd.PersistentFlags().Lookup("log-level")
if logLevelFlag == nil {
t.Fatal("Expected log-level flag to exist")
return
}
if logLevelFlag.DefValue != "warn" {
t.Errorf("Expected default log-level 'info', got %s", logLevelFlag.DefValue)
Expand Down
43 changes: 41 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,59 @@ go 1.25.1

require (
github.com/OpenSlides/openslides-go v0.0.0-20251104124242-d8e4b15bb11e
github.com/schollz/progressbar/v3 v3.19.0
github.com/shopspring/decimal v1.4.0
github.com/spf13/cobra v1.10.2
golang.org/x/text v0.33.0
k8s.io/api v0.35.0
k8s.io/apimachinery v0.35.0
k8s.io/client-go v0.35.0
sigs.k8s.io/yaml v1.6.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v5 v5.7.6 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
golang.org/x/crypto v0.42.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.44.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/term v0.37.0 // indirect
golang.org/x/time v0.9.0 // indirect
google.golang.org/protobuf v1.36.8 // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
)

require (
Expand Down
Loading