Skip to content
Open
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
24 changes: 12 additions & 12 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ License URL: https://github.com/googleapis/google-cloud-go/blob/auth/oauth2adapt

----------
Module: cloud.google.com/go/compute
Version: v1.58.0
Version: v1.59.0
License: Apache-2.0
License URL: https://github.com/googleapis/google-cloud-go/blob/compute/v1.58.0/compute/LICENSE
License URL: https://github.com/googleapis/google-cloud-go/blob/compute/v1.59.0/compute/LICENSE

----------
Module: cloud.google.com/go/compute/metadata
Expand Down Expand Up @@ -1115,9 +1115,9 @@ License URL: https://cs.opensource.google/go/x/crypto/+/v0.49.0:LICENSE

----------
Module: golang.org/x/mod/semver
Version: v0.34.0
Version: v0.35.0
License: BSD-3-Clause
License URL: https://cs.opensource.google/go/x/mod/+/v0.34.0:LICENSE
License URL: https://cs.opensource.google/go/x/mod/+/v0.35.0:LICENSE

----------
Module: golang.org/x/net
Expand All @@ -1139,15 +1139,15 @@ License URL: https://cs.opensource.google/go/x/sync/+/v0.20.0:LICENSE

----------
Module: golang.org/x/sys
Version: v0.42.0
Version: v0.43.0
License: BSD-3-Clause
License URL: https://cs.opensource.google/go/x/sys/+/v0.42.0:LICENSE
License URL: https://cs.opensource.google/go/x/sys/+/v0.43.0:LICENSE

----------
Module: golang.org/x/term
Version: v0.41.0
Version: v0.42.0
License: BSD-3-Clause
License URL: https://cs.opensource.google/go/x/term/+/v0.41.0:LICENSE
License URL: https://cs.opensource.google/go/x/term/+/v0.42.0:LICENSE

----------
Module: golang.org/x/text
Expand Down Expand Up @@ -1187,9 +1187,9 @@ License URL: https://github.com/googleapis/go-genproto/blob/d00831a3d3e7/LICENSE

----------
Module: google.golang.org/genproto/googleapis/api
Version: v0.0.0-20260401001100-f93e5f3e9f0f
Version: v0.0.0-20260401024825-9d38bb4040a9
License: Apache-2.0
License URL: https://github.com/googleapis/go-genproto/blob/f93e5f3e9f0f/googleapis/api/LICENSE
License URL: https://github.com/googleapis/go-genproto/blob/9d38bb4040a9/googleapis/api/LICENSE

----------
Module: google.golang.org/genproto/googleapis/rpc
Expand Down Expand Up @@ -1235,9 +1235,9 @@ License URL: https://github.com/go-yaml/yaml/blob/v3.0.1/LICENSE

----------
Module: helm.sh/helm/v4
Version: v4.1.3
Version: v4.1.4
License: Apache-2.0
License URL: https://github.com/helm/helm/blob/v4.1.3/LICENSE
License URL: https://github.com/helm/helm/blob/v4.1.4/LICENSE

----------
Module: k8s.io/api
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/argocd.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ func AddArgoCDCmd(parentCmd *cobra.Command, opts *GlobalOptions) {
argocd.cmd.Flags().BoolVar(&argocd.Opts.FullInstall, "deploy-dc-config", false, "Install Codesphere-managed resources (AppProjects, Repo Creds, ...) after installing the chart")
argocd.cmd.RunE = argocd.RunE

parentCmd.AddCommand(argocd.cmd)
AddCmd(parentCmd, argocd.cmd)
}
2 changes: 1 addition & 1 deletion cli/cmd/beta.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func AddBetaCmd(rootCmd *cobra.Command, opts *GlobalOptions) {
Be aware that that usage and behavior may change as the features are developed.`),
},
}
rootCmd.AddCommand(beta.cmd)
AddCmd(rootCmd, beta.cmd)

AddExtendCmd(beta.cmd, opts)
AddBootstrapGcpCmd(beta.cmd, opts)
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/beta_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ func AddBetaInstallCmd(rootCmd *cobra.Command, opts *GlobalOptions) {
Short: "Install beta components",
},
}
rootCmd.AddCommand(install.cmd)
AddCmd(rootCmd, install.cmd)
AddArgoCDCmd(install.cmd, opts)
}
2 changes: 1 addition & 1 deletion cli/cmd/bootstrap_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func AddBootstrapGcpCmd(parent *cobra.Command, opts *GlobalOptions) {
util.MarkFlagRequired(bootstrapGcpCmd.cmd, "billing-account")
util.MarkFlagRequired(bootstrapGcpCmd.cmd, "base-domain")

parent.AddCommand(bootstrapGcpCmd.cmd)
AddCmd(parent, bootstrapGcpCmd.cmd)
AddBootstrapGcpPostconfigCmd(bootstrapGcpCmd.cmd, opts)
AddBootstrapGcpCleanupCmd(bootstrapGcpCmd.cmd, opts)
AddBootstrapGcpRestartVMsCmd(bootstrapGcpCmd.cmd, opts)
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/bootstrap_gcp_cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@ func AddBootstrapGcpCleanupCmd(bootstrapGcp *cobra.Command, opts *GlobalOptions)
flags.StringVar(&cleanup.Opts.DNSProjectID, "dns-project-id", "", "GCP Project ID for DNS zone (optional, will use infra file if not provided)")

cleanup.cmd.RunE = cleanup.RunE
bootstrapGcp.AddCommand(cleanup.cmd)
AddCmd(bootstrapGcp, cleanup.cmd)
}
2 changes: 1 addition & 1 deletion cli/cmd/bootstrap_gcp_postconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ func AddBootstrapGcpPostconfigCmd(bootstrapGcp *cobra.Command, opts *GlobalOptio
flags.StringVar(&postconfig.Opts.InstallConfigPath, "install-config-path", "config.yaml", "Path to the installation configuration file")
flags.StringVar(&postconfig.Opts.PrivateKeyPath, "private-key-path", "", "Path to the GCP service account private key file (optional)")

bootstrapGcp.AddCommand(postconfig.cmd)
AddCmd(bootstrapGcp, postconfig.cmd)
postconfig.cmd.RunE = postconfig.RunE
}
2 changes: 1 addition & 1 deletion cli/cmd/bootstrap_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func AddBootstrapLocalCmd(parent *cobra.Command) {

util.MarkFlagRequired(bootstrapLocalCmd.cmd, "registry-user")

parent.AddCommand(bootstrapLocalCmd.cmd)
AddCmd(parent, bootstrapLocalCmd.cmd)
}

func (c *BootstrapLocalCmd) BootstrapLocal() error {
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ func AddBuildCmd(rootCmd *cobra.Command, opts *GlobalOptions) {
AddBuildImagesCmd(build.cmd, opts)
AddBuildImageCmd(build.cmd, opts)

rootCmd.AddCommand(build.cmd)
AddCmd(rootCmd, build.cmd)
}
2 changes: 1 addition & 1 deletion cli/cmd/build_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func AddBuildImageCmd(parentCmd *cobra.Command, opts *GlobalOptions) {
util.MarkFlagRequired(imageCmd.cmd, "package")
util.MarkFlagRequired(imageCmd.cmd, "registry")

parentCmd.AddCommand(imageCmd.cmd)
AddCmd(parentCmd, imageCmd.cmd)

imageCmd.cmd.RunE = imageCmd.RunE
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/build_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func AddBuildImagesCmd(build *cobra.Command, opts *GlobalOptions) {

util.MarkFlagRequired(buildImages.cmd, "config")

build.AddCommand(buildImages.cmd)
AddCmd(build, buildImages.cmd)

buildImages.cmd.RunE = buildImages.RunE
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func AddDownloadCmd(rootCmd *cobra.Command, opts *GlobalOptions) {
e.g. available Codesphere packages`),
},
}
rootCmd.AddCommand(download.cmd)
AddCmd(rootCmd, download.cmd)

AddDownloadPackageCmd(download.cmd, opts)
AddDownloadK0sCmd(download.cmd, opts)
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/download_k0s.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func AddDownloadK0sCmd(download *cobra.Command, opts *GlobalOptions) {
k0s.cmd.Flags().BoolVarP(&k0s.Opts.Force, "force", "f", false, "Force download even if k0s binary exists")
k0s.cmd.Flags().BoolVarP(&k0s.Opts.Quiet, "quiet", "q", false, "Suppress progress output during download")

download.AddCommand(k0s.cmd)
AddCmd(download, k0s.cmd)

k0s.cmd.RunE = k0s.RunE
}
Expand Down
3 changes: 2 additions & 1 deletion cli/cmd/download_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ 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.`),
Args: cobra.ArbitraryArgs,
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"},
Expand Down Expand Up @@ -88,7 +89,7 @@ func AddDownloadPackageCmd(download *cobra.Command, opts *GlobalOptions) {
pkg.cmd.Flags().StringVarP(&pkg.Opts.Hash, "hash", "H", "", "Hash of the version to download if multiple builds exist for the same version")
pkg.cmd.Flags().StringVarP(&pkg.Opts.Filename, "file", "f", "installer.tar.gz", "Specify artifact to download")
pkg.cmd.Flags().BoolVarP(&pkg.Opts.Quiet, "quiet", "q", false, "Suppress progress output during download")
download.AddCommand(pkg.cmd)
AddCmd(download, pkg.cmd)

pkg.cmd.RunE = pkg.RunE
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/extend.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func AddExtendCmd(rootCmd *cobra.Command, opts *GlobalOptions) {
Long: io.Long(`Extend Codesphere ressources such as base images to customize them for your needs.`),
},
}
rootCmd.AddCommand(extend.cmd)
AddCmd(rootCmd, extend.cmd)

AddExtendBaseimageCmd(extend.cmd, opts)
}
2 changes: 1 addition & 1 deletion cli/cmd/extend_baseimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func AddExtendBaseimageCmd(extend *cobra.Command, opts *GlobalOptions) {
baseimage.cmd.Flags().StringVarP(&baseimage.Opts.Baseimage, "baseimage", "b", "workspace-agent-24.04", "Base image file name inside the package to extend (default: 'workspace-agent-24.04')")
baseimage.cmd.Flags().BoolVarP(&baseimage.Opts.Force, "force", "f", false, "Enforce package extraction")

extend.AddCommand(baseimage.cmd)
AddCmd(extend, baseimage.cmd)

baseimage.cmd.RunE = baseimage.RunE
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ func AddInitCmd(rootCmd *cobra.Command, opts *GlobalOptions) {
Long: io.Long(`Initialize configuration files for Codesphere installation and other components.`),
},
}
rootCmd.AddCommand(init.cmd)
AddCmd(rootCmd, init.cmd)
AddInitInstallConfigCmd(init.cmd, opts)
}
2 changes: 1 addition & 1 deletion cli/cmd/init_install_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func AddInitInstallConfigCmd(init *cobra.Command, opts *GlobalOptions) {
util.MarkFlagRequired(c.cmd, "vault")

c.cmd.RunE = c.RunE
init.AddCommand(c.cmd)
AddCmd(init, c.cmd)
}

func (c *InitInstallConfigCmd) InitInstallConfig(icg installer.InstallConfigManager) error {
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func AddInstallCmd(rootCmd *cobra.Command, opts *GlobalOptions) {
Long: io.Long(`Install Codesphere and other components like Ceph and PostgreSQL.`),
},
}
rootCmd.AddCommand(install.cmd)
AddCmd(rootCmd, install.cmd)

AddInstallCodesphereCmd(install.cmd, opts)
AddInstallK0sCmd(install.cmd, opts)
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/install_ceph.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ func AddInstallCephCmd(install *cobra.Command) {
Long: io.Long(`Coming soon: Install a Ceph cluster`),
},
}
install.AddCommand(ceph.cmd)
AddCmd(install, ceph.cmd)
}
2 changes: 1 addition & 1 deletion cli/cmd/install_codesphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func AddInstallCodesphereCmd(install *cobra.Command, opts *GlobalOptions) {
util.MarkFlagRequired(codesphere.cmd, "config")
util.MarkFlagRequired(codesphere.cmd, "priv-key")

install.AddCommand(codesphere.cmd)
AddCmd(install, codesphere.cmd)

codesphere.cmd.RunE = codesphere.RunE
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/install_k0s.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func AddInstallK0sCmd(install *cobra.Command, opts *GlobalOptions) {

_ = k0s.cmd.MarkFlagRequired("install-config")

install.AddCommand(k0s.cmd)
AddCmd(install, k0s.cmd)

k0s.cmd.RunE = k0s.RunE
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/licenses.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ func AddLicensesCmd(rootCmd *cobra.Command) {
Long: `Print information about the OMS license and open source licenses of dependencies.`,
},
}
rootCmd.AddCommand(licenses.cmd)
AddCmd(rootCmd, licenses.cmd)
licenses.cmd.RunE = licenses.RunE
}
2 changes: 1 addition & 1 deletion cli/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func AddListCmd(rootCmd *cobra.Command, opts *GlobalOptions) {
eg. available Codesphere packages`),
},
}
rootCmd.AddCommand(list.cmd)
AddCmd(rootCmd, list.cmd)
AddListPackagesCmd(list.cmd, opts)
AddListAPIKeysCmd(list.cmd, opts)
}
2 changes: 1 addition & 1 deletion cli/cmd/list_api_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func AddListAPIKeysCmd(list *cobra.Command, opts *GlobalOptions) {

c.cmd.RunE = c.RunE

list.AddCommand(c.cmd)
AddCmd(list, c.cmd)
}

func (c *ListAPIKeysCmd) PrintKeysTable(keys []portal.ApiKey) {
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/list_packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func AddListPackagesCmd(list *cobra.Command, opts *GlobalOptions) {
_ = builds.cmd.Flags().MarkHidden("list-internal")
builds.cmd.Flags().StringVarP(&builds.Opts.Sort, "sort", "s", portal.SortSemver, "Sort order: 'semver' (by semantic version) or 'date' (by build date)")

list.AddCommand(builds.cmd)
AddCmd(list, builds.cmd)
}

func (c *ListBuildsCmd) PrintPackagesTable(packages portal.Builds) {
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func AddRegisterCmd(list *cobra.Command, opts *GlobalOptions) {

c.cmd.RunE = c.RunE

list.AddCommand(c.cmd)
AddCmd(list, c.cmd)
}

func (c *RegisterCmd) Register(p portal.Portal) (*portal.ApiKey, error) {
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/revoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ func AddRevokeCmd(rootCmd *cobra.Command, opts *GlobalOptions) {
eg. api keys.`),
},
}
rootCmd.AddCommand(revoke.cmd)
AddCmd(rootCmd, revoke.cmd)
AddRevokeAPIKeyCmd(revoke.cmd, opts)
}
2 changes: 1 addition & 1 deletion cli/cmd/revoke_api_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ func AddRevokeAPIKeyCmd(list *cobra.Command, opts *GlobalOptions) {

c.cmd.RunE = c.RunE

list.AddCommand(c.cmd)
AddCmd(list, c.cmd)
}
10 changes: 10 additions & 0 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ type GlobalOptions struct {
OmsPortalApiKey string
}

// AddCmd adds a command, inheriting the parent's Args validator if not explicitly set.
// Individual commands that need different argument rules can override this by setting their own Args validator.
func AddCmd(parent *cobra.Command, cmd *cobra.Command) {
if cmd.Args == nil {
cmd.Args = parent.Args
}
parent.AddCommand(cmd)
}

// GetRootCmd adds all child commands to the root command and sets flags appropriately.
func GetRootCmd() *cobra.Command {
opts := &GlobalOptions{}
Expand All @@ -26,6 +35,7 @@ func GetRootCmd() *cobra.Command {

This command can be used to run common tasks related to managing codesphere installations,
like downloading new versions.`),
Args: cobra.NoArgs,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
apiKey := os.Getenv("OMS_PORTAL_API_KEY")

Expand Down
Loading
Loading