From 54bdbff9d26d3149af6cc976c860bbc788bea42a Mon Sep 17 00:00:00 2001 From: Jim Minter Date: Wed, 16 Oct 2019 18:44:52 -0500 Subject: [PATCH] unexport graph type --- pkg/deploy/0-deploystorage.go | 2 +- pkg/deploy/deploy.go | 4 ++-- pkg/deploy/graph.go | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/deploy/0-deploystorage.go b/pkg/deploy/0-deploystorage.go index 6c2a6515a..fd8b3360a 100644 --- a/pkg/deploy/0-deploystorage.go +++ b/pkg/deploy/0-deploystorage.go @@ -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, } diff --git a/pkg/deploy/deploy.go b/pkg/deploy/deploy.go index 038d8003c..7c6cc321c 100644 --- a/pkg/deploy/deploy.go +++ b/pkg/deploy/deploy.go @@ -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 diff --git a/pkg/deploy/graph.go b/pkg/deploy/graph.go index 7bec923c5..e2f0a156a 100644 --- a/pkg/deploy/graph.go +++ b/pkg/deploy/graph.go @@ -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