Skip to content

Refine documentation for fetch.git.subpath #1061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
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
8 changes: 4 additions & 4 deletions cli/pkg/kctrl/cmd/package/available/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ func NewGetCmd(o *GetOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Command
RunE: func(_ *cobra.Command, args []string) error { return o.Run(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Get details about an available package",
[]string{"package", "available", "get", "-p", "cert-manager.community.tanzu.vmware.com"},
[]string{"package", "available", "get", "-p", "package.corp.com"},
},
cmdcore.Example{"Get the values schema for a particular version of the package",
[]string{"package", "available", "get", "-p", "cert-manager.community.tanzu.vmware.com/1.0.0", "--values-schema"}},
[]string{"package", "available", "get", "-p", "package.corp.com/1.0.0", "--values-schema"}},
}.Description("-p", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{"table": "",
Expand Down Expand Up @@ -101,7 +101,7 @@ func (o *GetOptions) Run(args []string) error {

if o.ValuesSchema {
if pkgVersion == "" {
return fmt.Errorf("Package version is required when --values-schema flag is declared (hint: to specify a particular version use the format: '-p <package-name>/<version>')")
return fmt.Errorf("Package version is required when --values-schema flag is declared (hint: to specify a particular version use the format: '<package-name>/<version>')")
}
return o.showValuesSchema(client, pkgName, pkgVersion)
}
Expand Down Expand Up @@ -181,7 +181,7 @@ func (o *GetOptions) show(client pkgclient.Interface, pkgName, pkgVersion string
}...)
} else {
if len(o.DefaultValuesFile) > 0 {
return fmt.Errorf("Package version is required when --default-values-file-output flag is declared (hint: to specify a particular version use the format: '-p <package-name>/<version>')")
return fmt.Errorf("Package version is required when --default-values-file-output flag is declared (hint: to specify a particular version use the format: '<package-name>/<version>')")
}
listOpts := metav1.ListOptions{}
if len(o.Name) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion cli/pkg/kctrl/cmd/package/available/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func NewListCmd(o *ListOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Comman
[]string{"package", "available", "list", "-A"},
},
cmdcore.Example{"List all available versions of a package",
[]string{"package", "available", "list", "-p", "cert-manager.community.tanzu.vmware.com"}},
[]string{"package", "available", "list", "-p", "package.corp.com"}},
}.Description("-p", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{"table": "",
Expand Down
18 changes: 9 additions & 9 deletions cli/pkg/kctrl/cmd/package/installed/create_or_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ func NewCreateCmd(o *CreateOrUpdateOptions, flagsFactory cmdcore.FlagsFactory) *
RunE: func(_ *cobra.Command, args []string) error { return o.RunCreate(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Install a package",
[]string{"package", "installed", "create", "-i", "cert-man", "-p", "cert-manager.community.tanzu.vmware.com", "--version", "1.6.1"},
[]string{"package", "installed", "create", "-i", "sample-pkg-install", "-p", "package.corp.com", "--version", "1.0.0"},
},
cmdcore.Example{"Install package with values file",
[]string{"package", "installed", "create", "-i", "cert-man", "-p", "cert-manager.community.tanzu.vmware.com", "--version", "1.6.1", "--values-file", "values.yml"},
[]string{"package", "installed", "create", "-i", "sample-pkg-install", "-p", "package.corp.com", "--version", "1.0.0", "--values-file", "values.yml"},
},
cmdcore.Example{"Install package and ask it to use an existing service account",
[]string{"package", "installed", "create", "-i", "cert-man", "-p", "cert-manager.community.tanzu.vmware.com", "--version", "1.6.1", "--service-account-name", "existing-sa"}},
[]string{"package", "installed", "create", "-i", "sample-pkg-install", "-p", "package.corp.com", "--version", "1.0.0", "--service-account-name", "existing-sa"}},
}.Description("-i", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{cmdapp.TTYByDefaultKey: "",
Expand Down Expand Up @@ -118,13 +118,13 @@ func NewInstallCmd(o *CreateOrUpdateOptions, flagsFactory cmdcore.FlagsFactory)
RunE: func(_ *cobra.Command, args []string) error { return o.RunCreate(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Install a package",
[]string{"package", "install", "-i", "cert-man", "-p", "cert-manager.community.tanzu.vmware.com", "--version", "1.6.1"},
[]string{"package", "install", "-i", "sample-pkg-install", "-p", "package.corp.com", "--version", "1.0.0"},
},
cmdcore.Example{"Install package with values file",
[]string{"package", "install", "-i", "cert-man", "-p", "cert-manager.community.tanzu.vmware.com", "--version", "1.6.1", "--values-file", "values.yml"},
[]string{"package", "install", "-i", "sample-pkg-install", "-p", "package.corp.com", "--version", "1.0.0", "--values-file", "values.yml"},
},
cmdcore.Example{"Install package and ask it to use an existing service account",
[]string{"package", "install", "-i", "cert-man", "-p", "cert-manager.community.tanzu.vmware.com", "--version", "1.6.1", "--service-account-name", "existing-sa"}},
[]string{"package", "install", "-i", "sample-pkg-install", "-p", "package.corp.com", "--version", "1.0.0", "--service-account-name", "existing-sa"}},
}.Description("-i", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{cmdapp.TTYByDefaultKey: "",
Expand Down Expand Up @@ -163,12 +163,12 @@ func NewUpdateCmd(o *CreateOrUpdateOptions, flagsFactory cmdcore.FlagsFactory) *
RunE: func(_ *cobra.Command, args []string) error { return o.RunUpdate(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Upgrade package install to a newer version",
[]string{"package", "installed", "update", "-i", "cert-man", "--version", "1.6.2"},
[]string{"package", "installed", "update", "-i", "sample-pkg-install", "--version", "1.0.0"},
},
cmdcore.Example{"Update package install with new values file",
[]string{"package", "installed", "update", "-i", "cert-man", "--values-file", "values.yml"}},
[]string{"package", "installed", "update", "-i", "sample-pkg-install", "--values-file", "values.yml"}},
cmdcore.Example{"Update package install to stop consuming supplied values",
[]string{"package", "installed", "update", "-i", "cert-man", "--values", "false"}},
[]string{"package", "installed", "update", "-i", "sample-pkg-install", "--values", "false"}},
}.Description("-i", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{cmdapp.TTYByDefaultKey: "",
Expand Down
2 changes: 1 addition & 1 deletion cli/pkg/kctrl/cmd/package/installed/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewDeleteCmd(o *DeleteOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Co
RunE: func(_ *cobra.Command, args []string) error { return o.Run(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Delete package install",
[]string{"package", "installed", "delete", "-i", "cert-man"}},
[]string{"package", "installed", "delete", "-i", "sample-pkg-install"}},
}.Description("-i", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{cmdapp.TTYByDefaultKey: "",
Expand Down
6 changes: 3 additions & 3 deletions cli/pkg/kctrl/cmd/package/installed/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ func NewGetCmd(o *GetOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Command
RunE: func(_ *cobra.Command, args []string) error { return o.Run(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Get details for a package install",
[]string{"package", "installed", "get", "-i", "cert-man"},
[]string{"package", "installed", "get", "-i", "sample-pkg-install"},
},
cmdcore.Example{"View values being used by package install",
[]string{"package", "installed", "get", "-i", "cert-man", "--values"},
[]string{"package", "installed", "get", "-i", "sample-pkg-install", "--values"},
},
cmdcore.Example{"Download values being used by package install",
[]string{"package", "installed", "get", "-i", "cert-man", "--values-file-output", "values.yml"}},
[]string{"package", "installed", "get", "-i", "sample-pkg-install", "--values-file-output", "values.yml"}},
}.Description("-i", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{"table": "",
Expand Down
4 changes: 2 additions & 2 deletions cli/pkg/kctrl/cmd/package/installed/pause_or_kick.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewPauseCmd(o *PauseOrKickOptions, flagsFactory cmdcore.FlagsFactory) *cobr
RunE: func(_ *cobra.Command, args []string) error { return o.Pause(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Pause reconciliation of package install",
[]string{"package", "installed", "pause", "-i", "cert-man"},
[]string{"package", "installed", "pause", "-i", "sample-pkg-install"},
},
}.Description("-i", o.pkgCmdTreeOpts),
SilenceUsage: true,
Expand All @@ -76,7 +76,7 @@ func NewKickCmd(o *PauseOrKickOptions, flagsFactory cmdcore.FlagsFactory) *cobra
RunE: func(_ *cobra.Command, args []string) error { return o.Kick(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Trigger reconciliation of package install",
[]string{"package", "installed", "kick", "-i", "cert-man"},
[]string{"package", "installed", "kick", "-i", "sample-pkg-install"},
},
}.Description("-i", o.pkgCmdTreeOpts),
SilenceUsage: true,
Expand Down
2 changes: 1 addition & 1 deletion cli/pkg/kctrl/cmd/package/installed/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewStatusCmd(o *StatusOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Co
RunE: func(_ *cobra.Command, args []string) error { return o.Run(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Check status of package install",
[]string{"package", "installed", "status", "-i", "cert-man"},
[]string{"package", "installed", "status", "-i", "sample-pkg-install"},
},
}.Description("-i", o.pkgCmdTreeOpts),
SilenceUsage: true,
Expand Down
4 changes: 2 additions & 2 deletions cli/pkg/kctrl/cmd/package/repository/add_or_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewAddCmd(o *AddOrUpdateOptions, flagsFactory cmdcore.FlagsFactory) *cobra.
RunE: func(_ *cobra.Command, args []string) error { return o.Run(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Add a package repository",
[]string{"package", "repository", "add", "-r", "tce", "--url", "projects.registry.vmware.com/tce/main:0.9.1"}},
[]string{"package", "repository", "add", "-r", "sample-repo", "--url", "projects.repo.com/example:1.0.0"}},
}.Description("-r", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{cmdapp.TTYByDefaultKey: "",
Expand Down Expand Up @@ -90,7 +90,7 @@ func NewUpdateCmd(o *AddOrUpdateOptions, flagsFactory cmdcore.FlagsFactory) *cob
RunE: func(_ *cobra.Command, args []string) error { return o.Run(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Update a package repository with a new URL",
[]string{"package", "repository", "update", "-r", "tce", "--url", "projects.registry.vmware.com/tce/main:0.9.2"}},
[]string{"package", "repository", "update", "-r", "sample-repo", "--url", "projects.repo.com/example:1.0.0"}},
}.Description("-r", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{cmdapp.TTYByDefaultKey: "",
Expand Down
2 changes: 1 addition & 1 deletion cli/pkg/kctrl/cmd/package/repository/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewDeleteCmd(o *DeleteOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Co
RunE: func(_ *cobra.Command, args []string) error { return o.Run(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Delete a package repository",
[]string{"package", "repository", "delete", "-r", "tce"}},
[]string{"package", "repository", "delete", "-r", "sample-repo"}},
}.Description("-r", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{cmdapp.TTYByDefaultKey: "",
Expand Down
2 changes: 1 addition & 1 deletion cli/pkg/kctrl/cmd/package/repository/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewGetCmd(o *GetOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Command
RunE: func(_ *cobra.Command, args []string) error { return o.Run(args) },
Example: cmdcore.Examples{
cmdcore.Example{"Get details for a package repository",
[]string{"package", "repository", "get", "-r", "tce"}},
[]string{"package", "repository", "get", "-r", "sample-repo"}},
}.Description("-r", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{"table": "",
Expand Down
2 changes: 1 addition & 1 deletion cli/pkg/kctrl/cmd/package/repository/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewListCmd(o *ListOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Comman
[]string{"package", "repository", "list"},
},
cmdcore.Example{"List package repositories in all namespaces",
[]string{"package", "repository", "list", "A"}},
[]string{"package", "repository", "list", "-A"}},
}.Description("", o.pkgCmdTreeOpts),
SilenceUsage: true,
Annotations: map[string]string{"table": "",
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/kappctrl/v1alpha1/types_fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type AppFetchGit struct {
// (if ssh-knownhosts is not specified, git will not perform strict host checking)
// +optional
SecretRef *AppFetchLocalRef `json:"secretRef,omitempty" protobuf:"bytes,3,opt,name=secretRef"`
// Grab only portion of repository (optional)
// Grab only portion of repository, subpath becomes new root (optional)
// +optional
SubPath string `json:"subPath,omitempty" protobuf:"bytes,4,opt,name=subPath"`
// Skip lfs download (optional)
Expand Down