Skip to content

Commit

Permalink
diagnostics: introduce AppCreate
Browse files Browse the repository at this point in the history
  • Loading branch information
sosiouxme committed Feb 13, 2018
1 parent 5b73b36 commit 6c78e37
Show file tree
Hide file tree
Showing 23 changed files with 1,303 additions and 38 deletions.
134 changes: 134 additions & 0 deletions contrib/completions/bash/oc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

134 changes: 134 additions & 0 deletions contrib/completions/zsh/oc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/man/man1/.files_generated_oc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/man/man1/oc-adm-diagnostics-appcreate.1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/man/man1/oc-ex-diagnostics-appcreate.1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions pkg/oc/admin/diagnostics/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
oauthclient "github.com/openshift/origin/pkg/oauth/generated/internalclientset"
clustdiags "github.com/openshift/origin/pkg/oc/admin/diagnostics/diagnostics/cluster"
agldiags "github.com/openshift/origin/pkg/oc/admin/diagnostics/diagnostics/cluster/aggregated_logging"
appcreate "github.com/openshift/origin/pkg/oc/admin/diagnostics/diagnostics/cluster/app_create"
"github.com/openshift/origin/pkg/oc/admin/diagnostics/diagnostics/types"
osclientcmd "github.com/openshift/origin/pkg/oc/cli/util/clientcmd"
projectclient "github.com/openshift/origin/pkg/project/generated/internalclientset"
Expand All @@ -30,6 +31,7 @@ import (
func availableClusterDiagnostics() types.DiagnosticList {
return types.DiagnosticList{
&agldiags.AggregatedLogging{},
appcreate.NewDefaultAppCreateDiagnostic(),
&clustdiags.ClusterRegistry{},
&clustdiags.ClusterRouter{},
&clustdiags.ClusterRoles{},
Expand Down Expand Up @@ -96,6 +98,16 @@ func (o DiagnosticsOptions) buildClusterDiagnostics(rawConfig *clientcmdapi.Conf
case agldiags.AggregatedLoggingName:
p := o.ParameterizedDiagnostics[agldiags.AggregatedLoggingName].(*agldiags.AggregatedLogging).Project
d = agldiags.NewAggregatedLogging(p, kclusterClient, oauthClient.Oauth(), projectClient.Project(), routeClient.Route(), oauthorizationClient.Authorization(), appsClient.Apps(), securityClient.Security())
case appcreate.AppCreateName:
ac := o.ParameterizedDiagnostics[diagnosticName].(*appcreate.AppCreate)
ac.KubeClient = kclusterClient
ac.ProjectClient = projectClient.Project()
ac.RouteClient = routeClient
ac.RoleBindingClient = oauthorizationClient.Authorization()
ac.SARClient = kclusterClient.Authorization()
ac.AppsClient = appsClient
ac.PreventModification = o.PreventModification
d = ac
case clustdiags.NodeDefinitionsName:
d = &clustdiags.NodeDefinitions{KubeClient: kclusterClient}
case clustdiags.MasterNodeName:
Expand Down
2 changes: 2 additions & 0 deletions pkg/oc/admin/diagnostics/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ func bindIndividualFlags(diag types.ParameterizedDiagnostic, prefix string, flag
flags.StringVar(target, name, param.Default.(string), param.Description)
case *int:
flags.IntVar(target, name, param.Default.(int), param.Description)
case *int64:
flags.Int64Var(target, name, param.Default.(int64), param.Description)
case *bool:
flags.BoolVar(target, name, param.Default.(bool), param.Description)
default:
Expand Down
Loading

0 comments on commit 6c78e37

Please sign in to comment.