Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #855 from rbradford/cnci-ephemeral-storage
Browse files Browse the repository at this point in the history
ciao-controller: Make CNCI storage ephemeral
  • Loading branch information
markdryan authored Nov 25, 2016
2 parents 4b668bf + ef58c10 commit e7e35eb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ciao-controller/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ func newInstance(ctl *controller, tenantID string, workload *types.Workload) (*i
}

func (i *instance) Add() error {
ds := i.ctl.ds
if i.CNCI == false {
ds := i.ctl.ds
ds.AddInstance(&i.Instance)
storage := i.newConfig.sc.Start.Storage
if (storage != payloads.StorageResources{}) {
_, err := ds.CreateStorageAttachment(i.Instance.ID, storage.ID, storage.Ephemeral)
if err != nil {
glog.Error(err)
}
}
} else {
i.ctl.ds.AddTenantCNCI(i.TenantID, i.ID, i.MACAddress)
ds.AddTenantCNCI(i.TenantID, i.ID, i.MACAddress)
}
storage := i.newConfig.sc.Start.Storage
if (storage != payloads.StorageResources{}) {
_, err := ds.CreateStorageAttachment(i.Instance.ID, storage.ID, storage.Ephemeral)
if err != nil {
glog.Error(err)
}
}

return nil
Expand Down

0 comments on commit e7e35eb

Please sign in to comment.