зеркало из https://github.com/Azure/ARO-RP.git
code commenting
This commit is contained in:
Родитель
912b296010
Коммит
25e49cc1dc
|
@ -51,6 +51,9 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD
|
||||||
ContentVersion: "1.0.0.0",
|
ContentVersion: "1.0.0.0",
|
||||||
Resources: []Resource{
|
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{
|
Resource: &msi.Identity{
|
||||||
Name: to.StringPtr(clusterID.InfraID + "-identity"),
|
Name: to.StringPtr(clusterID.InfraID + "-identity"),
|
||||||
Location: &installConfig.Config.Azure.Region,
|
Location: &installConfig.Config.Azure.Region,
|
||||||
|
@ -70,6 +73,7 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD
|
||||||
APIVersion: apiVersions["storage"],
|
APIVersion: apiVersions["storage"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// should go away when we use a cloud partner image
|
||||||
Resource: &storage.BlobContainer{
|
Resource: &storage.BlobContainer{
|
||||||
Name: to.StringPtr("cluster" + doc.OpenShiftCluster.Properties.StorageSuffix + "/default/vhd"),
|
Name: to.StringPtr("cluster" + doc.OpenShiftCluster.Properties.StorageSuffix + "/default/vhd"),
|
||||||
Type: to.StringPtr("Microsoft.Storage/storageAccounts/blobServices/containers"),
|
Type: to.StringPtr("Microsoft.Storage/storageAccounts/blobServices/containers"),
|
||||||
|
@ -126,6 +130,7 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// blob copying should go away when we use a cloud partner image
|
||||||
d.log.Print("copying rhcos blob")
|
d.log.Print("copying rhcos blob")
|
||||||
rhcosVhd := blobService.GetContainerReference("vhd").GetBlobReference("rhcos" + doc.OpenShiftCluster.Properties.StorageSuffix + ".vhd")
|
rhcosVhd := blobService.GetContainerReference("vhd").GetBlobReference("rhcos" + doc.OpenShiftCluster.Properties.StorageSuffix + ".vhd")
|
||||||
err = rhcosVhd.Copy(string(*rhcosImage), nil)
|
err = rhcosVhd.Copy(string(*rhcosImage), nil)
|
||||||
|
@ -134,7 +139,7 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD
|
||||||
}
|
}
|
||||||
|
|
||||||
rhcosVhd.Metadata = azstorage.BlobMetadata{
|
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)
|
err = rhcosVhd.SetMetadata(nil)
|
||||||
|
@ -148,6 +153,8 @@ func (d *Deployer) deployStorage(ctx context.Context, doc *api.OpenShiftClusterD
|
||||||
return err
|
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")
|
graph := blobService.GetContainerReference("aro").GetBlobReference("graph")
|
||||||
b, err := json.MarshalIndent(g, "", " ")
|
b, err := json.MarshalIndent(g, "", " ")
|
||||||
if err != nil {
|
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) {
|
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()
|
doc.OpenShiftCluster.Properties.Installation.Now = time.Now().UTC()
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
|
@ -84,7 +84,7 @@ func (f *frontend) _putOrPatchOpenShiftCluster(r *request) ([]byte, error) {
|
||||||
Type: r.resourceType,
|
Type: r.resourceType,
|
||||||
Properties: api.Properties{
|
Properties: api.Properties{
|
||||||
ProvisioningState: api.ProvisioningStateSucceeded,
|
ProvisioningState: api.ProvisioningStateSucceeded,
|
||||||
NetworkProfile: api.NetworkProfile{
|
NetworkProfile: api.NetworkProfile{ // TODO: is defaulting on create a good idea?
|
||||||
VNetCIDR: "10.0.0.0/16",
|
VNetCIDR: "10.0.0.0/16",
|
||||||
PodCIDR: "10.128.0.0/14",
|
PodCIDR: "10.128.0.0/14",
|
||||||
ServiceCIDR: "172.30.0.0/16",
|
ServiceCIDR: "172.30.0.0/16",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче