本文整理汇总了Golang中github.com/openshift/origin/pkg/route/graph.AddAllRouteEdges函数的典型用法代码示例。如果您正苦于以下问题:Golang AddAllRouteEdges函数的具体用法?Golang AddAllRouteEdges怎么用?Golang AddAllRouteEdges使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddAllRouteEdges函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: TestMissingPortMapping
func TestMissingPortMapping(t *testing.T) {
// Multiple service ports - no route port specified
g, _, err := osgraphtest.BuildGraph("../../../api/graph/test/missing-route-port.yaml")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
routeedges.AddAllRouteEdges(g)
markers := FindMissingPortMapping(g)
if expected, got := 1, len(markers); expected != got {
t.Fatalf("expected %d markers, got %d", expected, got)
}
if expected, got := MissingRoutePortWarning, markers[0].Key; expected != got {
t.Fatalf("expected %s marker key, got %s", expected, got)
}
// Dangling route
g, _, err = osgraphtest.BuildGraph("../../../api/graph/test/lonely-route.yaml")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
routeedges.AddAllRouteEdges(g)
markers = FindMissingPortMapping(g)
if expected, got := 1, len(markers); expected != got {
t.Fatalf("expected %d markers, got %d", expected, got)
}
if expected, got := MissingServiceWarning, markers[0].Key; expected != got {
t.Fatalf("expected %s marker key, got %s", expected, got)
}
}
开发者ID:claytonspinner,项目名称:origin,代码行数:31,代码来源:analysis_test.go
示例2: MakeGraph
func (d *ProjectStatusDescriber) MakeGraph(namespace string) (osgraph.Graph, sets.String, error) {
g := osgraph.New()
loaders := []GraphLoader{
&serviceLoader{namespace: namespace, lister: d.K},
&serviceAccountLoader{namespace: namespace, lister: d.K},
&secretLoader{namespace: namespace, lister: d.K},
&rcLoader{namespace: namespace, lister: d.K},
&podLoader{namespace: namespace, lister: d.K},
// TODO check swagger for feature enablement and selectively add bcLoader and buildLoader
// then remove errors.TolerateNotFoundError method.
&bcLoader{namespace: namespace, lister: d.C},
&buildLoader{namespace: namespace, lister: d.C},
&isLoader{namespace: namespace, lister: d.C},
&dcLoader{namespace: namespace, lister: d.C},
&routeLoader{namespace: namespace, lister: d.C},
}
loadingFuncs := []func() error{}
for _, loader := range loaders {
loadingFuncs = append(loadingFuncs, loader.Load)
}
forbiddenResources := sets.String{}
if errs := parallel.Run(loadingFuncs...); len(errs) > 0 {
actualErrors := []error{}
for _, err := range errs {
if kapierrors.IsForbidden(err) {
forbiddenErr := err.(*kapierrors.StatusError)
if (forbiddenErr.Status().Details != nil) && (len(forbiddenErr.Status().Details.Kind) > 0) {
forbiddenResources.Insert(forbiddenErr.Status().Details.Kind)
}
continue
}
actualErrors = append(actualErrors, err)
}
if len(actualErrors) > 0 {
return g, forbiddenResources, utilerrors.NewAggregate(actualErrors)
}
}
for _, loader := range loaders {
loader.AddToGraph(g)
}
kubeedges.AddAllExposedPodTemplateSpecEdges(g)
kubeedges.AddAllExposedPodEdges(g)
kubeedges.AddAllManagedByRCPodEdges(g)
kubeedges.AddAllRequestedServiceAccountEdges(g)
kubeedges.AddAllMountableSecretEdges(g)
kubeedges.AddAllMountedSecretEdges(g)
buildedges.AddAllInputOutputEdges(g)
buildedges.AddAllBuildEdges(g)
deployedges.AddAllTriggerEdges(g)
deployedges.AddAllDeploymentEdges(g)
imageedges.AddAllImageStreamRefEdges(g)
routeedges.AddAllRouteEdges(g)
return g, forbiddenResources, nil
}
开发者ID:Vitogee,项目名称:origin,代码行数:60,代码来源:projectstatus.go
示例3: TestPathBasedPassthroughRoutes
func TestPathBasedPassthroughRoutes(t *testing.T) {
g, _, err := osgraphtest.BuildGraph("../../../api/graph/test/invalid-route.yaml")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
routeedges.AddAllRouteEdges(g)
markers := FindPathBasedPassthroughRoutes(g, osgraph.DefaultNamer)
if expected, got := 1, len(markers); expected != got {
t.Fatalf("expected %d markers, got %d", expected, got)
}
if expected, got := PathBasedPassthroughErr, markers[0].Key; expected != got {
t.Fatalf("expected %s marker key, got %s", expected, got)
}
}
开发者ID:richm,项目名称:origin,代码行数:15,代码来源:analysis_test.go
示例4: TestMissingTLSTerminationType
func TestMissingTLSTerminationType(t *testing.T) {
g, _, err := osgraphtest.BuildGraph("../../../api/graph/test/route-cruft.yaml")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
routeedges.AddAllRouteEdges(g)
markers := FindMissingTLSTerminationType(g)
if expected, got := 1, len(markers); expected != got {
t.Fatalf("expected %d markers, got %d", expected, got)
}
if expected, got := MissingTLSTerminationTypeErr, markers[0].Key; expected != got {
t.Fatalf("expected %s marker key, got %s", expected, got)
}
}
开发者ID:johnmccawley,项目名称:origin,代码行数:15,代码来源:analysis_test.go
示例5: TestMissingRouter
func TestMissingRouter(t *testing.T) {
g, _, err := osgraphtest.BuildGraph("../../../api/graph/test/lonely-route.yaml")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
routeedges.AddAllRouteEdges(g)
markers := FindMissingRouter(g, osgraph.DefaultNamer)
if expected, got := 1, len(markers); expected != got {
t.Fatalf("expected %d markers, got %d", expected, got)
}
if expected, got := MissingRequiredRouterErr, markers[0].Key; expected != got {
t.Fatalf("expected %s marker key, got %s", expected, got)
}
}
开发者ID:RomainVabre,项目名称:origin,代码行数:15,代码来源:analysis_test.go
注:本文中的github.com/openshift/origin/pkg/route/graph.AddAllRouteEdges函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论