Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-20346

[osm - vmware] Improve the performance and the size of the collection

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • None
    • Important

      Currently we are creating a lot of modules in Go, which result in too many single binaries where some of them could served the same purpose, example with create_server and delete_server which can be a single module such as openstack_server.go where the Ansible boolean style can be use:
      present: true or false

      Also we need to improve the code to use pointer receiver for the openstack/ package in order to share the provider/authentication instead of re-creating a client for each calls.

      For example, improve the DstCloud structure to share the provide and add pointer receiver to each functions which required an authentication:

      type DstCloud struct {
              Auth               `json:"auth"`
              RegionName         string `json:"region_name"`
              Interface          string `json:"interface"`
              IdentityAPIVersion int    `json:"identity_api_version"`        Provider *gophercloud.ProviderClient `json:"-"`
      }
      func (c *DstCloud) CreateVolume(opts VolOpts, setUEFI bool) (*volumes.Volume, error) {
              client, err := openstack.NewBlockStorageV3(c.Provider, gophercloud.EndpointOpts{
                      Region: c.RegionName,
              })
              if err != nil {
                      return nil, fmt.Errorf("failed to create block storage client: %w", err)
              } 

              Unassigned Unassigned
              rhn-engineering-mbultel mathieu bultel
              rhos-dfg-migrations
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: