Skip to content

Commit

Permalink
Merge pull request #1635 from kargakis/comment-fix
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Apr 16, 2015
2 parents 8c99516 + 13eb76e commit 7d93a44
Show file tree
Hide file tree
Showing 28 changed files with 97 additions and 21 deletions.
1 change: 1 addition & 0 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func (c *Client) SubjectAccessReviews(namespace string) SubjectAccessReviewInter
return newSubjectAccessReviews(c, namespace)
}

// RootSubjectAccessReviews provides a REST client for RootSubjectAccessReviews
func (c *Client) RootSubjectAccessReviews() SubjectAccessReviewInterface {
return newRootSubjectAccessReviews(c)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/cli/cmd/buildlogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Examples:
$ %[1]s build-logs 566bed879d2d
`

// NewCmdBuildLogs implements the OpenShift cli build-logs command
func NewCmdBuildLogs(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "build-logs <build>",
Expand All @@ -34,6 +35,7 @@ func NewCmdBuildLogs(fullName string, f *clientcmd.Factory, out io.Writer) *cobr
return cmd
}

// RunBuildLogs contains all the necessary functionality for the OpenShift cli build-logs command
func RunBuildLogs(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
if len(args) != 1 {
return cmdutil.UsageError(cmd, "<build> is a required argument")
Expand Down
5 changes: 2 additions & 3 deletions pkg/cmd/cli/cmd/cancelbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ Examples:
$ %[1]s cancel-build 1da32cvq --restart
`

// NewCmdCancelBuild manages a build cancelling event.
// To cancel a build its name has to be specified, and two options
// are available: displaying logs and restarting.
// NewCmdCancelBuild implements the OpenShift cli cancel-build command
func NewCmdCancelBuild(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "cancel-build <build>",
Expand All @@ -48,6 +46,7 @@ func NewCmdCancelBuild(fullName string, f *clientcmd.Factory, out io.Writer) *co
return cmd
}

// RunCancelBuild contains all the necessary functionality for the OpenShift cli cancel-build command
func RunCancelBuild(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
if len(args) == 0 || len(args[0]) == 0 {
return cmdutil.UsageError(cmd, "You must specify the name of a build to cancel.")
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/cli/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ the server details, can be provided through flags. If not provided, the command
prompt for user input as needed.
`

// NewCmdLogin implements the OpenShift cli login command
func NewCmdLogin(f *osclientcmd.Factory, reader io.Reader, out io.Writer) *cobra.Command {
options := &LoginOptions{
Reader: reader,
Expand Down Expand Up @@ -74,6 +75,7 @@ func NewCmdLogin(f *osclientcmd.Factory, reader io.Reader, out io.Writer) *cobra
return cmds
}

// RunLogin contains all the necessary functionality for the OpenShift cli login command
func RunLogin(cmd *cobra.Command, options *LoginOptions) error {
if certFile := cmdutil.GetFlagString(cmd, "client-certificate"); len(certFile) > 0 {
options.CertFile = certFile
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/cli/cmd/newapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ application is created.
ALPHA: This command is under active development - feedback is appreciated.
`

// NewCmdNewApplication implements the OpenShift cli new-app command
func NewCmdNewApplication(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
_, typer := f.Object()
config := newcmd.NewAppConfig(typer)
Expand Down Expand Up @@ -89,6 +90,7 @@ func NewCmdNewApplication(fullName string, f *clientcmd.Factory, out io.Writer)
return cmd
}

// RunNewApplication contains all the necessary functionality for the OpenShift cli new-app command
func RunNewApplication(f *clientcmd.Factory, out io.Writer, c *cobra.Command, args []string, config *newcmd.AppConfig, helper *dockerutil.Helper) error {
namespace, err := f.DefaultNamespace()

Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/cli/cmd/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/openshift/origin/pkg/cmd/util/clientcmd"
)

// NewCmdOptions implements the OpenShift cli options command
func NewCmdOptions(f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "options",
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/cli/cmd/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Examples:
$ cat template.json | %[1]s process -f -
`

// NewCmdProcess returns a 'process' command
// NewCmdProcess implements the OpenShift cli process command
func NewCmdProcess(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "process -f filename",
Expand All @@ -81,6 +81,7 @@ func NewCmdProcess(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.
return cmd
}

// RunProject contains all the necessary functionality for the OpenShift cli process command
func RunProcess(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
storedTemplate := ""
if len(args) > 0 {
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/cli/cmd/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/spf13/cobra"
)

// NewCmdProject implements the OpenShift cli rollback command
func NewCmdProject(f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "project <project-name>",
Expand All @@ -41,6 +42,7 @@ func NewCmdProject(f *clientcmd.Factory, out io.Writer) *cobra.Command {
return cmd
}

// RunProject contains all the necessary functionality for the OpenShift cli project command
func RunProject(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
argsLength := len(args)

Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/cli/cmd/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Examples:
$ %[1]s rollback deployment-1 --output=json | %[1]s update deploymentConfigs deployment -f -
`

// NewCmdRollback implements the OpenShift cli rollback command
func NewCmdRollback(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
rollback := &deployapi.DeploymentConfigRollback{
Spec: deployapi.DeploymentConfigRollbackSpec{
Expand Down Expand Up @@ -69,6 +70,7 @@ func NewCmdRollback(fullName string, f *clientcmd.Factory, out io.Writer) *cobra
return cmd
}

// RunRollback contains all the necessary functionality for OpenShift cli rollback command
func RunRollback(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string, rollback *deployapi.DeploymentConfigRollback) error {
if len(args) == 0 || len(args[0]) == 0 {
return cmdutil.UsageError(cmd, "A deployment name is required.")
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/cli/cmd/startbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Examples:
$ %[1]s start-build 3bd2ug53b --follow
`

// NewCmdStartBuild implements the OpenShift cli start-build command
func NewCmdStartBuild(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "start-build (<buildConfig>|--from-build=<build>)",
Expand All @@ -46,6 +47,7 @@ func NewCmdStartBuild(fullName string, f *clientcmd.Factory, out io.Writer) *cob
return cmd
}

// RunStartBuild contains all the necessary functionality for the OpenShift cli start-build command
func RunStartBuild(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
buildName := cmdutil.GetFlagString(cmd, "from-build")
follow := cmdutil.GetFlagBool(cmd, "follow")
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/cli/cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ For more information about individual items, use the describe command (e.g. osc
osc describe deploymentConfig, osc describe service).
`

// NewCmdStatus implements the OpenShift cli status command
func NewCmdStatus(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "status",
Expand All @@ -31,6 +32,7 @@ func NewCmdStatus(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.C
return cmd
}

// RunStatus contains all the necessary functionality for the OpenShift cli status command
func RunStatus(f *clientcmd.Factory, out io.Writer) error {
client, kclient, err := f.Clients()
if err != nil {
Expand Down
9 changes: 9 additions & 0 deletions pkg/cmd/cli/cmd/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/openshift/origin/pkg/cmd/util/clientcmd"
)

// NewCmdGet is a wrapper for the Kubernetes cli get command
func NewCmdGet(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := cmd.NewCmdGet(f.Factory, out)
longDesc := `Display one or many resources.
Expand All @@ -35,6 +36,7 @@ Examples:
return cmd
}

// NewCmdUpdate is a wrapper for the Kubernetes cli update command
func NewCmdUpdate(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := cmd.NewCmdUpdate(f.Factory, out)
longDesc := `Update a resource by filename or stdin.
Expand All @@ -56,6 +58,7 @@ Examples:
return cmd
}

// NewCmdDelete is a wrapper for the Kubernetes cli delete command
func NewCmdDelete(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := cmd.NewCmdDelete(f.Factory, out)
longDesc := `Delete a resource by filename, stdin, resource and ID, or by resources and label selector.
Expand Down Expand Up @@ -90,6 +93,7 @@ Examples:
return cmd
}

// NewCmdLog is a wrapper for the Kubernetes cli log command
func NewCmdLog(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := cmd.NewCmdLog(f.Factory, out)
longDesc := `Print the logs for a container in a pod. If the pod has only one container, the container name is optional.
Expand All @@ -106,6 +110,7 @@ Examples:
return cmd
}

// NewCmdCreate is a wrapper for the Kubernetes cli create command
func NewCmdCreate(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := cmd.NewCmdCreate(f.Factory, out)
longDesc := `Create a resource by filename or stdin.
Expand All @@ -124,6 +129,7 @@ Examples:
return cmd
}

// NewCmdExec is a wrapper for the Kubernetes cli exec command
func NewCmdExec(fullName string, f *clientcmd.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command {
cmd := cmd.NewCmdExec(f.Factory, cmdIn, cmdOut, cmdErr)
longDesc := `Execute a command in a container.
Expand All @@ -140,6 +146,7 @@ Examples:
return cmd
}

// NewCmdPortForward is a wrapper for the Kubernetes cli port-forward command
func NewCmdPortForward(fullName string, f *clientcmd.Factory) *cobra.Command {
cmd := cmd.NewCmdPortForward(f.Factory)
longDesc := `Forward 1 or more local ports to a pod.
Expand All @@ -162,6 +169,7 @@ Examples:
return cmd
}

// NewCmdDescribe is a wrapper for the Kubernetes cli describe command
func NewCmdDescribe(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := cmd.NewCmdDescribe(f.Factory, out)
longDesc := `Show details of a specific resource.
Expand All @@ -181,6 +189,7 @@ Examples:
return cmd
}

// NewCmdProxy is a wrapper for the Kubernetes cli proxy command
func NewCmdProxy(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := cmd.NewCmdProxy(f.Factory, out)
longDesc := `Run a proxy to the Kubernetes API server.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/cli/config/smart_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func getUniqueName(basename string, existingNames *util.StringSet) string {
return string(util.NewUUID())
}

// Generates the best context identifier possible based on the information it gets.
// GenerateContextIdentifier generates the best context identifier possible based on the information it gets.
func GenerateContextIdentifier(namespace string, cluster string, authInfo string, existingContextIdentifiers *util.StringSet) string {
ctx := ""

Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/cli/describe/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func (c *genericDeploymentDescriberClient) listPods(namespace string, selector l
return c.listPodsFunc(namespace, selector)
}

// NewDeploymentConfigDescriberForConfig returns a new DeploymentConfigDescriber
// for a DeploymentConfig
func NewDeploymentConfigDescriberForConfig(config *deployapi.DeploymentConfig) *DeploymentConfigDescriber {
return &DeploymentConfigDescriber{
client: &genericDeploymentDescriberClient{
Expand All @@ -62,6 +64,7 @@ func NewDeploymentConfigDescriberForConfig(config *deployapi.DeploymentConfig) *
}
}

// NewDeploymentConfigDescriber returns a new DeploymentConfigDescriber
func NewDeploymentConfigDescriber(client client.Interface, kclient kclient.Interface) *DeploymentConfigDescriber {
return &DeploymentConfigDescriber{
client: &genericDeploymentDescriberClient{
Expand All @@ -78,6 +81,7 @@ func NewDeploymentConfigDescriber(client client.Interface, kclient kclient.Inter
}
}

// Describe returns a description of a DeploymentConfigDescriber
func (d *DeploymentConfigDescriber) Describe(namespace, name string) (string, error) {
deploymentConfig, err := d.client.getDeploymentConfig(namespace, name)
if err != nil {
Expand Down Expand Up @@ -235,6 +239,7 @@ type DeploymentDescriber struct {
client.Interface
}

// Describe returns a description of a DeploymentDescriber
func (d *DeploymentDescriber) Describe(namespace, name string) (string, error) {
c := d.Deployments(namespace)
deployment, err := c.Get(name)
Expand Down
Loading

0 comments on commit 7d93a44

Please sign in to comment.