зеркало из https://github.com/Azure/ARO-RP.git
unexport graph type
This commit is contained in:
Родитель
25e49cc1dc
Коммит
54bdbff9d2
|
@ -21,7 +21,7 @@ import (
|
|||
)
|
||||
|
||||
func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterDocument, installConfig *installconfig.InstallConfig, platformCreds *installconfig.PlatformCreds) error {
|
||||
g := Graph{
|
||||
g := graph{
|
||||
reflect.TypeOf(installConfig): installConfig,
|
||||
reflect.TypeOf(platformCreds): platformCreds,
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ func (d *Deployer) getBlobService(ctx context.Context, doc *api.OpenShiftCluster
|
|||
return storage.GetBlobService(), nil
|
||||
}
|
||||
|
||||
func (d *Deployer) getGraph(ctx context.Context, doc *api.OpenShiftClusterDocument) (Graph, error) {
|
||||
func (d *Deployer) getGraph(ctx context.Context, doc *api.OpenShiftClusterDocument) (graph, error) {
|
||||
d.log.Print("retrieving graph")
|
||||
|
||||
blobService, err := d.getBlobService(ctx, doc)
|
||||
|
@ -139,7 +139,7 @@ func (d *Deployer) getGraph(ctx context.Context, doc *api.OpenShiftClusterDocume
|
|||
}
|
||||
defer rc.Close()
|
||||
|
||||
var g Graph
|
||||
var g graph
|
||||
err = json.NewDecoder(rc).Decode(&g)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -118,9 +118,9 @@ var registeredTypes = map[string]asset.Asset{
|
|||
"*tls.ServiceAccountKeyPair": &tls.ServiceAccountKeyPair{},
|
||||
}
|
||||
|
||||
type Graph map[reflect.Type]asset.Asset
|
||||
type graph map[reflect.Type]asset.Asset
|
||||
|
||||
func (g Graph) resolve(a asset.Asset) (asset.Asset, error) {
|
||||
func (g graph) resolve(a asset.Asset) (asset.Asset, error) {
|
||||
if _, found := g[reflect.TypeOf(a)]; !found {
|
||||
for _, dep := range a.Dependencies() {
|
||||
_, err := g.resolve(dep)
|
||||
|
@ -140,7 +140,7 @@ func (g Graph) resolve(a asset.Asset) (asset.Asset, error) {
|
|||
return g[reflect.TypeOf(a)], nil
|
||||
}
|
||||
|
||||
func (g Graph) MarshalJSON() ([]byte, error) {
|
||||
func (g graph) MarshalJSON() ([]byte, error) {
|
||||
m := map[string]asset.Asset{}
|
||||
for t, a := range g {
|
||||
m[t.String()] = a
|
||||
|
@ -148,9 +148,9 @@ func (g Graph) MarshalJSON() ([]byte, error) {
|
|||
return json.Marshal(m)
|
||||
}
|
||||
|
||||
func (g *Graph) UnmarshalJSON(b []byte) error {
|
||||
func (g *graph) UnmarshalJSON(b []byte) error {
|
||||
if *g == nil {
|
||||
*g = Graph{}
|
||||
*g = graph{}
|
||||
}
|
||||
|
||||
var m map[string]json.RawMessage
|
||||
|
|
Загрузка…
Ссылка в новой задаче