Skip to content

Commit

Permalink
More work on additional ports
Browse files Browse the repository at this point in the history
  • Loading branch information
marccampbell committed Oct 7, 2019
1 parent 060e59a commit 9f56de8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmd/kots/cli/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func InstallCmd() *cobra.Command {
namespace = enteredNamespace
}

kotsadm.OverrideVersion = v.GetString("kotsadm-tag")
kotsadm.OverrideRegistry = v.GetString("kotsadm-registry")
kotsadm.OverrideNamespace = v.GetString("kotsadm-namespace")

pullOptions := pull.PullOptions{
HelmRepoURI: v.GetString("repo"),
RootDir: rootDir,
Expand Down Expand Up @@ -121,11 +125,11 @@ func InstallCmd() *cobra.Command {
if err != nil {
return err
}
defer close(stopCh)

if err := upload.Upload(rootDir, uploadOptions); err != nil {
return err
}
close(stopCh)
}

// port forward
Expand Down Expand Up @@ -174,6 +178,13 @@ func InstallCmd() *cobra.Command {
cmd.Flags().String("repo", "", "repo uri to use when installing a helm chart")
cmd.Flags().StringSlice("set", []string{}, "values to pass to helm when running helm template")

cmd.Flags().String("kotsadm-tag", "", "set to override the tag of kotsadm. this may create an incompatible deployment because the version of kots and kotsadm are designed to work together")
cmd.Flags().String("kotsadm-registry", "", "set to override the registry of kotsadm image. this may create an incompatible deployment because the version of kots and kotsadm are designed to work together")
cmd.Flags().String("kotsadm-namespace", "", "set to override the namespace of kotsadm image. this may create an incompatible deployment because the version of kots and kotsadm are designed to work together")
cmd.Flags().MarkHidden("kotsadm-tag")
cmd.Flags().MarkHidden("kotsadm-registry")
cmd.Flags().MarkHidden("kotsadm-namespace")

return cmd
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/k8sutil/portforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

"github.com/pkg/errors"
"github.com/replicatedhq/kots/pkg/logger"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
Expand Down Expand Up @@ -168,6 +169,8 @@ func PortForward(kubeContext string, localPort int, remotePort int, namespace st
}

forwardedAdditionalPorts[desiredAdditionalPort] = serviceStopCh
log := logger.NewLogger()
log.Info("Go to http://localhost:%d to access the application", desiredAdditionalPort.LocalPort)
}
time.Sleep(time.Second * 5)
}
Expand Down

0 comments on commit 9f56de8

Please sign in to comment.