Skip to content

Commit b26e530

Browse files
Merge pull request #16658 from sosiouxme/20170928-app-loop-diagnostic
Automatic merge from submit-queue (batch tested with PRs 16658, 18643). AppCreate diagnostic Implements https://trello.com/c/Zv4hVlyQ/130-diagnostic-to-recreate-app-create-loop-script as a diagnostic. https://trello.com/c/Zv4hVlyQ/27-3-continue-appcreate-diagnostic-work https://trello.com/c/aNWlMtMk/61-demo-merge-appcreate-diagnostic https://trello.com/c/H0jsgQwu/63-3-complete-appcreate-diagnostic-functionality Status: - [x] Create and cleanup project - [x] Deploy and cleanup app - [x] Wait for app to start - [x] Test ability to connect to app via service - [x] Test that app responds correctly - [x] Test ability to connect via route - [x] Write stats/results to file as json Not yet addressed in this PR (depending on how reviews progress vs development): - [ ] Run a build to completion - [ ] Test ability to attach storage - [ ] Gather and write useful information (logs, status) on failure Builds on top of #17773 for handling parameters to the diagnostic as well as #17857 which is a refactor on top of that.
2 parents 908b1c8 + 6c78e37 commit b26e530

23 files changed

+1303
-38
lines changed

contrib/completions/bash/oc

+134
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/completions/zsh/oc

+134
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/man1/.files_generated_oc

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/man1/oc-adm-diagnostics-appcreate.1

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/man/man1/oc-ex-diagnostics-appcreate.1

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/oc/admin/diagnostics/cluster.go

+12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
oauthclient "github.com/openshift/origin/pkg/oauth/generated/internalclientset"
1818
clustdiags "github.com/openshift/origin/pkg/oc/admin/diagnostics/diagnostics/cluster"
1919
agldiags "github.com/openshift/origin/pkg/oc/admin/diagnostics/diagnostics/cluster/aggregated_logging"
20+
appcreate "github.com/openshift/origin/pkg/oc/admin/diagnostics/diagnostics/cluster/app_create"
2021
"github.com/openshift/origin/pkg/oc/admin/diagnostics/diagnostics/types"
2122
osclientcmd "github.com/openshift/origin/pkg/oc/cli/util/clientcmd"
2223
projectclient "github.com/openshift/origin/pkg/project/generated/internalclientset"
@@ -30,6 +31,7 @@ import (
3031
func availableClusterDiagnostics() types.DiagnosticList {
3132
return types.DiagnosticList{
3233
&agldiags.AggregatedLogging{},
34+
appcreate.NewDefaultAppCreateDiagnostic(),
3335
&clustdiags.ClusterRegistry{},
3436
&clustdiags.ClusterRouter{},
3537
&clustdiags.ClusterRoles{},
@@ -96,6 +98,16 @@ func (o DiagnosticsOptions) buildClusterDiagnostics(rawConfig *clientcmdapi.Conf
9698
case agldiags.AggregatedLoggingName:
9799
p := o.ParameterizedDiagnostics[agldiags.AggregatedLoggingName].(*agldiags.AggregatedLogging).Project
98100
d = agldiags.NewAggregatedLogging(p, kclusterClient, oauthClient.Oauth(), projectClient.Project(), routeClient.Route(), oauthorizationClient.Authorization(), appsClient.Apps(), securityClient.Security())
101+
case appcreate.AppCreateName:
102+
ac := o.ParameterizedDiagnostics[diagnosticName].(*appcreate.AppCreate)
103+
ac.KubeClient = kclusterClient
104+
ac.ProjectClient = projectClient.Project()
105+
ac.RouteClient = routeClient
106+
ac.RoleBindingClient = oauthorizationClient.Authorization()
107+
ac.SARClient = kclusterClient.Authorization()
108+
ac.AppsClient = appsClient
109+
ac.PreventModification = o.PreventModification
110+
d = ac
99111
case clustdiags.NodeDefinitionsName:
100112
d = &clustdiags.NodeDefinitions{KubeClient: kclusterClient}
101113
case clustdiags.MasterNodeName:

pkg/oc/admin/diagnostics/diagnostics.go

+2
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ func bindIndividualFlags(diag types.ParameterizedDiagnostic, prefix string, flag
276276
flags.StringVar(target, name, param.Default.(string), param.Description)
277277
case *int:
278278
flags.IntVar(target, name, param.Default.(int), param.Description)
279+
case *int64:
280+
flags.Int64Var(target, name, param.Default.(int64), param.Description)
279281
case *bool:
280282
flags.BoolVar(target, name, param.Default.(bool), param.Description)
281283
default:

0 commit comments

Comments
 (0)