Skip to content

Commit

Permalink
Merge branch 'release/2.6.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Sep 11, 2023
2 parents c908030 + 11245cf commit 818c586
Show file tree
Hide file tree
Showing 33 changed files with 86 additions and 65 deletions.
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_cluster_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (p *ProjectInfo) NewAdminClusterCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (p *ProjectInfo) NewAdminCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_config_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (p *ProjectInfo) NewAdminConfigCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_platform_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (p *ProjectInfo) NewAdminPlatformCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_platform_config_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (p *ProjectInfo) NewAdminPlatformConfigCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
Expand Down
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_registry_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (p *ProjectInfo) NewAdminRegistryCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_resolver_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (p *ProjectInfo) NewAdminResolverCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_secrets_add_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (p *ProjectInfo) NewAdminSecretsAddCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
Expand Down
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_secrets_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (p *ProjectInfo) NewAdminSecretsCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
Expand Down
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_services_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (p *ProjectInfo) NewAdminServicesCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/admin_services_config_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (p *ProjectInfo) NewAdminServicesConfigCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
Expand Down
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/cluster_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (p *ProjectInfo) NewClusterCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/cluster_portal_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (p *ProjectInfo) NewClusterPortalCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/cluster_portal_list_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (p *ProjectInfo) NewClusterPortalListCmd() *cobra.Command {
var c = &cobra.Command{
Args: cobra.NoArgs,
Use: "list",
Short: "Output list of portals",
Short: "List portals deployed to Kubernetes",
RunE: func(_ *cobra.Command, _ []string) error { return o.Run() },
}

Expand Down
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/cluster_portal_open_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (p *ProjectInfo) NewClusterPortalOpenCmd() *cobra.Command {
var c = &cobra.Command{
Args: cobra.NoArgs,
Use: "open",
Short: "Open training portal in web browser",
Short: "Browse portal in Kubernetes",
RunE: func(_ *cobra.Command, _ []string) error { return o.Run() },
}

Expand Down
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/cluster_portal_password_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (p *ProjectInfo) NewClusterPortalPasswordCmd() *cobra.Command {
var c = &cobra.Command{
Args: cobra.NoArgs,
Use: "password",
Short: "View credentials for training portal",
Short: "View portal credentials in Kubernetes",
RunE: func(_ *cobra.Command, _ []string) error { return o.Run() },
}

Expand Down
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/cluster_session_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (p *ProjectInfo) NewClusterSessionCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
4 changes: 2 additions & 2 deletions client-programs/pkg/cmd/cluster_session_extend_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ func (p *ProjectInfo) NewClusterSessionExtendCmd() *cobra.Command {

var c = &cobra.Command{
Args: cobra.ExactArgs(1),
Use: "extend",
Short: "Extend duration of session",
Use: "extend NAME",
Short: "Extend duration of session in Kubernetes",
RunE: func(_ *cobra.Command, args []string) error { o.Name = args[0]; return o.Run() },
}

Expand Down
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/cluster_session_list_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (p *ProjectInfo) NewClusterSessionListCmd() *cobra.Command {
var c = &cobra.Command{
Args: cobra.NoArgs,
Use: "list",
Short: "Output list of sessions",
Short: "List active sessions in Kubernetes",
RunE: func(_ *cobra.Command, _ []string) error { return o.Run() },
}

Expand Down
4 changes: 2 additions & 2 deletions client-programs/pkg/cmd/cluster_session_status_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ func (p *ProjectInfo) NewClusterSessionStatusCmd() *cobra.Command {

var c = &cobra.Command{
Args: cobra.ExactArgs(1),
Use: "status",
Short: "Output status of session",
Use: "status NAME",
Short: "Output status of session in Kubernetes",
RunE: func(_ *cobra.Command, args []string) error { o.Name = args[0]; return o.Run() },
}

Expand Down
9 changes: 5 additions & 4 deletions client-programs/pkg/cmd/cluster_session_terminate_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,11 @@ func (p *ProjectInfo) NewClusterSessionTerminateCmd() *cobra.Command {
var o ClusterSessionTerminateOptions

var c = &cobra.Command{
Args: cobra.ExactArgs(1),
Use: "terminate",
Short: "Terminate running session",
RunE: func(_ *cobra.Command, args []string) error { o.Name = args[0]; return o.Run() },
Args: cobra.ExactArgs(1),
Use: "delete NAME",
Aliases: []string{"terminate"},
Short: "Terminate running session in Kubernetes",
RunE: func(_ *cobra.Command, args []string) error { o.Name = args[0]; return o.Run() },
}

c.Flags().StringVar(
Expand Down
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/cluster_workshop_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (p *ProjectInfo) NewClusterWorkshopCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/docker_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (p *ProjectInfo) NewDockerCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/docker_extension_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (p *ProjectInfo) NewDockerExtensionCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/docker_workshop_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (p *ProjectInfo) NewDockerWorkshopCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
32 changes: 14 additions & 18 deletions client-programs/pkg/cmd/docker_workshop_deploy_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/kind/pkg/cluster"
"sigs.k8s.io/kind/pkg/cmd"

"github.com/vmware-tanzu-labs/educates-training-platform/client-programs/pkg/registry"
)

type DockerWorkshopDeployOptions struct {
Expand Down Expand Up @@ -139,29 +137,25 @@ func (m *DockerWorkshopsManager) DeployWorkshop(o *DockerWorkshopDeployOptions,
}

if o.Repository == "localhost:5001" {
err = registry.DeployRegistry()

if err != nil {
return name, errors.Wrap(err, "failed to deploy registry")
}

o.Repository = "registry.docker.local:5000"
}

var registryIP string

registryInfo, err := cli.ContainerInspect(ctx, "educates-registry")

if err != nil {
return name, errors.Wrapf(err, "unable to inspect container for registry")
}
if err == nil {
educatesNetwork, exists := registryInfo.NetworkSettings.Networks["educates"]

educatesNetwork, exists := registryInfo.NetworkSettings.Networks["educates"]
if !exists {
return name, errors.New("registry is not attached to educates network")
}

if !exists {
return name, errors.New("registry is not attached to educates network")
registryIP = educatesNetwork.IPAddress
} else {
o.Repository = ""
}

registryIP := educatesNetwork.IPAddress

var kubeConfigData string

if o.KubeConfig != "" {
Expand Down Expand Up @@ -228,8 +222,10 @@ func (m *DockerWorkshopsManager) DeployWorkshop(o *DockerWorkshopDeployOptions,
return name, err
}

if workshopExtraHosts, err = generateWorkshopExtraHosts(workshop, registryIP); err != nil {
return name, err
if registryIP != "" {
if workshopExtraHosts, err = generateWorkshopExtraHosts(workshop, registryIP); err != nil {
return name, err
}
}

if workshopComposeProject, err = extractWorkshopComposeConfig(workshop); err != nil {
Expand Down
34 changes: 25 additions & 9 deletions client-programs/pkg/cmd/educates_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,42 @@ func (p *ProjectInfo) NewEducatesCmdGroup() *cobra.Command {
}

commandGroups := templates.CommandGroups{
{
Message: "Cluster Commands (Aliases):",
Commands: []*cobra.Command{
overrideCommandName(p.NewAdminClusterCreateCmd(), "create-cluster"),
overrideCommandName(p.NewAdminClusterDeleteCmd(), "delete-cluster"),
},
},
{
Message: "Workshop Commands (Aliases):",
Commands: []*cobra.Command{
overrideCommandName(p.NewWorkshopNewCmd(), "new-workshop"),
overrideCommandName(p.NewWorkshopPublishCmd(), "publish-workshop"),
overrideCommandName(p.NewWorkshopExportCmd(), "export-workshop"),
},
},
{
Message: "Cluster Commands (Aliases):",
Commands: []*cobra.Command{
overrideCommandName(p.NewClusterWorkshopDeployCmd(), "deploy-workshop"),
overrideCommandName(p.NewClusterWorkshopListCmd(), "list-workshops"),
overrideCommandName(p.NewClusterWorkshopRequestCmd(), "request-workshop"),
overrideCommandName(p.NewClusterWorkshopServeCmd(), "serve-workshop"),
overrideCommandName(p.NewClusterWorkshopRequestCmd(), "request-workshop"),
overrideCommandName(p.NewClusterWorkshopUpdateCmd(), "update-workshop"),
overrideCommandName(p.NewClusterWorkshopDeleteCmd(), "delete-workshop"),

overrideCommandName(p.NewClusterPortalOpenCmd(), "browse-workshops"),
overrideCommandName(p.NewClusterPortalPasswordCmd(), "view-credentials"),

overrideCommandName(p.NewClusterPortalCreateCmd(), "create-portal"),
overrideCommandName(p.NewClusterPortalListCmd(), "list-portals"),
overrideCommandName(p.NewClusterPortalDeleteCmd(), "delete-portal"),

overrideCommandName(p.NewClusterSessionListCmd(), "list-sessions"),
overrideCommandName(p.NewClusterSessionStatusCmd(), "session-status"),
overrideCommandName(p.NewClusterSessionExtendCmd(), "extend-session"),
overrideCommandName(p.NewClusterSessionTerminateCmd(), "delete-session"),
},
},
{
Message: "Management Commands (Aliases):",
Commands: []*cobra.Command{
overrideCommandName(p.NewAdminClusterCreateCmd(), "create-cluster"),
overrideCommandName(p.NewAdminClusterDeleteCmd(), "delete-cluster"),
},
},
{
Expand All @@ -66,7 +80,9 @@ func (p *ProjectInfo) NewEducatesCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

c.AddCommand(p.NewProjectVersionCmd())

return c
}
4 changes: 2 additions & 2 deletions client-programs/pkg/cmd/project_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ func (p *ProjectInfo) NewProjectCmdGroup() *cobra.Command {
{
Message: "Available Commands:",
Commands: []*cobra.Command{
p.NewProjectVersionCmd(),
// p.NewProjectVersionCmd(),
p.NewProjectDocsCmdGroup(),
},
},
}

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/project_docs_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (p *ProjectInfo) NewProjectDocsCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
2 changes: 1 addition & 1 deletion client-programs/pkg/cmd/template_cmd_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (p *ProjectInfo) NewTemplateCmdGroup() *cobra.Command {

commandGroups.Add(c)

templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...)
templates.ActsAsRootCommand(c, []string{"--help"}, commandGroups...)

return c
}
Loading

0 comments on commit 818c586

Please sign in to comment.