Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,15 @@ License URL: https://cs.opensource.google/go/x/time/+/v0.14.0:LICENSE

----------
Module: google.golang.org/api
Version: v0.266.0
Version: v0.267.0
License: BSD-3-Clause
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.266.0/LICENSE
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.267.0/LICENSE

----------
Module: google.golang.org/api/internal/third_party/uritemplates
Version: v0.266.0
Version: v0.267.0
License: BSD-3-Clause
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.266.0/internal/third_party/uritemplates/LICENSE
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.267.0/internal/third_party/uritemplates/LICENSE

----------
Module: google.golang.org/genproto/googleapis
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/build_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ func AddBuildImageCmd(parentCmd *cobra.Command, opts *GlobalOptions) {
Use: "image",
Short: "Build and push Docker image using Dockerfile and Codesphere package version",
Long: `Build a Docker image from a Dockerfile and push it to a registry, tagged with the Codesphere version from the package.`,
Example: formatExamplesWithBinary("build image", []io.Example{
Example: formatExamples("build image", []io.Example{
{Cmd: "--dockerfile baseimage/Dockerfile --package codesphere-v1.68.0.tar.gz --registry my-registry.com/my-image", Desc: "Build image for Codesphere version 1.68.0 and push to specified registry"},
}, "oms-cli"),
}),
Args: cobra.ExactArgs(0),
},
Opts: BuildImageOpts{GlobalOptions: opts},
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/download_k0s.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ func AddDownloadK0sCmd(download *cobra.Command, opts *GlobalOptions) {
Short: "Download k0s Kubernetes distribution",
Long: packageio.Long(`Download a k0s binary directly to the OMS workdir.
Will download the latest version if no version is specified.`),
Example: formatExamplesWithBinary("download k0s", []packageio.Example{
Example: formatExamples("download k0s", []packageio.Example{
{Cmd: "", Desc: "Download k0s using the Go-native implementation"},
{Cmd: "--version 1.22.0", Desc: "Download a specific version of k0s"},
{Cmd: "--quiet", Desc: "Download k0s with minimal output"},
{Cmd: "--force", Desc: "Force download even if k0s binary exists"},
}, "oms-cli"),
}),
},
Opts: DownloadK0sOpts{GlobalOptions: opts},
Env: env.NewEnv(),
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/download_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ func AddDownloadPackageCmd(download *cobra.Command, opts *GlobalOptions) {
Short: "Download a codesphere package",
Long: io.Long(`Download a specific version of a Codesphere package
To list available packages, run oms list packages.`),
Example: formatExamplesWithBinary("download package", []io.Example{
Example: formatExamples("download package", []io.Example{
{Cmd: "codesphere-v1.55.0", Desc: "Download Codesphere version 1.55.0"},
{Cmd: "--version codesphere-v1.55.0", Desc: "Download Codesphere version 1.55.0"},
{Cmd: "--version codesphere-v1.55.0 --file installer-lite.tar.gz", Desc: "Download lite package of Codesphere version 1.55.0"},
}, "oms-cli"),
}),
PreRunE: func(cmd *cobra.Command, args []string) error {
// if version flag is not set, expect version as argument
cmd.Args = cobra.NoArgs
Expand Down
8 changes: 5 additions & 3 deletions cli/cmd/example_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import (
"strings"

"github.com/codesphere-cloud/cs-go/pkg/io"
"github.com/codesphere-cloud/oms/internal/version"
)

// formatExamplesWithBinary builds an Example string similar to io.FormatExampleCommands
// but prefixes commands with a stable binary name (e.g. "oms-cli") instead of temporary go-build paths
func formatExamplesWithBinary(cmdName string, examples []io.Example, binaryName string) string {
// formatExamples builds an Example string similar to io.FormatExampleCommands
// but prefixes commands with a stable binary name from version.BinName() instead of temporary go-build paths
func formatExamples(cmdName string, examples []io.Example) string {
binaryName := (&version.Build{}).BinName()
var b strings.Builder
for i, ex := range examples {
if ex.Desc != "" {
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/init_install_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ func AddInitInstallConfigCmd(init *cobra.Command, opts *GlobalOptions) {
- dev: Single-node development setup
- production: HA multi-node setup
- minimal: Minimal testing setup`),
Example: formatExamplesWithBinary("init install-config", []csio.Example{
Example: formatExamples("init install-config", []csio.Example{
{Cmd: "-c config.yaml --vault prod.vault.yaml", Desc: "Create config files interactively"},
{Cmd: "--profile dev -c config.yaml --vault prod.vault.yaml", Desc: "Use dev profile with defaults"},
{Cmd: "--profile production -c config.yaml --vault prod.vault.yaml", Desc: "Use production profile"},
{Cmd: "--validate -c config.yaml --vault prod.vault.yaml", Desc: "Validate existing configuration files"},
}, "oms-cli"),
}),
},
Opts: &InitInstallConfigOpts{GlobalOptions: opts},
FileWriter: util.NewFilesystemWriter(),
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/install_k0s.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ func AddInstallK0sCmd(install *cobra.Command, opts *GlobalOptions) {
or load the k0s binary from the provided package file and install it.
If no version is specified, the latest version will be downloaded.
If no install config is provided, k0s will be installed with the '--single' flag.`),
Example: formatExamplesWithBinary("install k0s", []packageio.Example{
Example: formatExamples("install k0s", []packageio.Example{
{Cmd: "", Desc: "Install k0s using the Go-native implementation"},
{Cmd: "--version <version>", Desc: "Version of k0s to install"},
{Cmd: "--package <file>", Desc: "Package file (e.g. codesphere-v1.2.3-installer.tar.gz) to load k0s from"},
{Cmd: "--k0s-config <path>", Desc: "Path to k0s configuration file, if not set k0s will be installed with the '--single' flag"},
{Cmd: "--force", Desc: "Force new download and installation even if k0s binary exists or is already installed"},
}, "oms-cli"),
}),
},
Opts: InstallK0sOpts{GlobalOptions: opts},
Env: env.NewEnv(),
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/smoketest_codesphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func AddSmoketestCodesphereCmd(parent *cobra.Command, opts *GlobalOptions) {
Long: io.Long(`Run automated smoke tests for a Codesphere installation by creating a workspace,
setting environment variables, executing commands, syncing landscape, and running a pipeline stage.
The workspace is automatically deleted after the test completes.`),
Example: formatExamplesWithBinary("smoketest codesphere", []io.Example{
Example: formatExamples("smoketest codesphere", []io.Example{
{
Cmd: "--baseurl https://codesphere.example.com/api --token YOUR_TOKEN --team-id TEAM_ID --plan-id PLAN_ID",
Desc: "Run smoke tests against a Codesphere installation",
Expand All @@ -84,7 +84,7 @@ func AddSmoketestCodesphereCmd(parent *cobra.Command, opts *GlobalOptions) {
Cmd: "--baseurl https://codesphere.example.com/api --token YOUR_TOKEN --team-id TEAM_ID --plan-id PLAN_ID --steps createWorkspace,syncLandscape,deleteWorkspace",
Desc: "Run specific steps and delete the workspace afterwards",
},
}, "oms-cli"),
}),
},
Opts: &teststeps.SmoketestCodesphereOpts{},
}
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/update_dockerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ func AddUpdateDockerfileCmd(parentCmd *cobra.Command, opts *GlobalOptions) {

This command extracts the base image from a Codesphere package and updates the FROM statement
in the specified Dockerfile to use that base image. The base image is loaded into the local Docker daemon so it can be used for building.`,
Example: formatExamplesWithBinary("update dockerfile", []io.Example{
Example: formatExamples("update dockerfile", []io.Example{
{Cmd: "--dockerfile baseimage/Dockerfile --package codesphere-v1.68.0.tar.gz", Desc: "Update Dockerfile to use the default base image from the package (workspace-agent-24.04)"},
{Cmd: "--dockerfile baseimage/Dockerfile --package codesphere-v1.68.0.tar.gz --baseimage workspace-agent-20.04.tar", Desc: "Update Dockerfile to use the workspace-agent-20.04 base image from the package"},
}, "oms-cli"),
}),
Args: cobra.ExactArgs(0),
},
Opts: UpdateDockerfileOpts{GlobalOptions: opts},
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/update_install_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ func AddUpdateInstallConfigCmd(update *cobra.Command, opts *GlobalOptions) {

For example, updating the PostgreSQL primary IP will trigger regeneration
of the PostgreSQL server certificates that include that IP address.`),
Example: formatExamplesWithBinary("update install-config", []csio.Example{
Example: formatExamples("update install-config", []csio.Example{
{Cmd: "--postgres-primary-ip 10.10.0.4 --config config.yaml --vault prod.vault.yaml", Desc: "Update PostgreSQL primary IP and regenerate certificates"},
{Cmd: "--domain new.example.com --config config.yaml --vault prod.vault.yaml", Desc: "Update Codesphere domain"},
{Cmd: "--k8s-api-server 10.0.0.10 --config config.yaml --vault prod.vault.yaml", Desc: "Update Kubernetes API server host"},
}, "oms-cli"),
}),
},
Opts: &UpdateInstallConfigOpts{GlobalOptions: opts},
FileWriter: util.NewFilesystemWriter(),
Expand Down
8 changes: 4 additions & 4 deletions internal/tmpl/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,15 @@ License URL: https://cs.opensource.google/go/x/time/+/v0.14.0:LICENSE

----------
Module: google.golang.org/api
Version: v0.266.0
Version: v0.267.0
License: BSD-3-Clause
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.266.0/LICENSE
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.267.0/LICENSE

----------
Module: google.golang.org/api/internal/third_party/uritemplates
Version: v0.266.0
Version: v0.267.0
License: BSD-3-Clause
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.266.0/internal/third_party/uritemplates/LICENSE
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.267.0/internal/third_party/uritemplates/LICENSE

----------
Module: google.golang.org/genproto/googleapis
Expand Down