Skip to content

Commit

Permalink
Merge pull request #16658 from sosiouxme/20170928-app-loop-diagnostic
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
openshift-merge-robot authored Feb 17, 2018
2 parents 908b1c8 + 6c78e37 commit b26e530
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 b26e530

Please sign in to comment.