github.com/openshift/installer@v1.4.17/pkg/rhcos/openstack.go (about)

     1  package rhcos
     2  
     3  import (
     4  	"net/url"
     5  )
     6  
     7  // GenerateOpenStackImageName returns Glance image name for instances.
     8  func GenerateOpenStackImageName(rhcosImage, infraID string) (imageName string, isURL bool) {
     9  	// Here we check whether rhcosImage is a URL or not. If this is the first case, it means that Glance image
    10  	// should be created by the installer with the universal name "<infraID>-rhcos". Otherwise, it means
    11  	// that we are given the name of the pre-created Glance image, which the installer should use for node
    12  	// provisioning.
    13  	_, err := url.ParseRequestURI(rhcosImage)
    14  	if err != nil {
    15  		return rhcosImage, false
    16  	}
    17  
    18  	return infraID + "-rhcos", true
    19  }