From 25e49cc1dcfec5e49c0307414bd991cca2962a1f Mon Sep 17 00:00:00 2001 From: Jim Minter Date: Wed, 16 Oct 2019 18:43:45 -0500 Subject: [PATCH] code commenting --- pkg/deploy/0-deploystorage.go | 11 ++++++++++- pkg/frontend/putorpatch.go | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/deploy/0-deploystorage.go b/pkg/deploy/0-deploystorage.go index b87bf228a..6c2a6515a 100644 --- a/pkg/deploy/0-deploystorage.go +++ b/pkg/deploy/0-deploystorage.go @@ -51,6 +51,9 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD ContentVersion: "1.0.0.0", Resources: []Resource{ { + // deploy the Identity now to give AAD a chance to update + // itself before we apply the RBAC rule in the next + // deployment Resource: &msi.Identity{ Name: to.StringPtr(clusterID.InfraID + "-identity"), Location: &installConfig.Config.Azure.Region, @@ -70,6 +73,7 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD APIVersion: apiVersions["storage"], }, { + // should go away when we use a cloud partner image Resource: &storage.BlobContainer{ Name: to.StringPtr("cluster" + doc.OpenShiftCluster.Properties.StorageSuffix + "/default/vhd"), Type: to.StringPtr("Microsoft.Storage/storageAccounts/blobServices/containers"), @@ -126,6 +130,7 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD return err } + // blob copying should go away when we use a cloud partner image d.log.Print("copying rhcos blob") rhcosVhd := blobService.GetContainerReference("vhd").GetBlobReference("rhcos" + doc.OpenShiftCluster.Properties.StorageSuffix + ".vhd") err = rhcosVhd.Copy(string(*rhcosImage), nil) @@ -134,7 +139,7 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD } rhcosVhd.Metadata = azstorage.BlobMetadata{ - "source_uri": "var.azure_image_url", + "source_uri": "var.azure_image_url", // https://github.com/openshift/installer/pull/2468 } err = rhcosVhd.SetMetadata(nil) @@ -148,6 +153,8 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD return err } + // the graph is quite big so we store it in a storage account instead of + // in cosmosdb graph := blobService.GetContainerReference("aro").GetBlobReference("graph") b, err := json.MarshalIndent(g, "", " ") if err != nil { @@ -161,6 +168,8 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD } doc, err = d.db.Patch(doc.OpenShiftCluster.ID, func(doc *api.OpenShiftClusterDocument) (err error) { + // used for the SAS token with which the bootstrap node retrieves its + // ignition payload doc.OpenShiftCluster.Properties.Installation.Now = time.Now().UTC() return nil }) diff --git a/pkg/frontend/putorpatch.go b/pkg/frontend/putorpatch.go index db203c14c..29ff81725 100644 --- a/pkg/frontend/putorpatch.go +++ b/pkg/frontend/putorpatch.go @@ -84,7 +84,7 @@ func (f *frontend) _putOrPatchOpenShiftCluster(r *request) ([]byte, error) { Type: r.resourceType, Properties: api.Properties{ ProvisioningState: api.ProvisioningStateSucceeded, - NetworkProfile: api.NetworkProfile{ + NetworkProfile: api.NetworkProfile{ // TODO: is defaulting on create a good idea? VNetCIDR: "10.0.0.0/16", PodCIDR: "10.128.0.0/14", ServiceCIDR: "172.30.0.0/16",