compute

package
v7.0.0-...-be2983a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImageMap = map[string]string{
	"centos":      "centos-cloud",
	"coreos":      "coreos-cloud",
	"debian":      "debian-cloud",
	"opensuse":    "opensuse-cloud",
	"rhel":        "rhel-cloud",
	"rocky-linux": "rocky-linux-cloud",
	"sles":        "suse-cloud",
	"ubuntu":      "ubuntu-os-cloud",
	"windows":     "windows-cloud",
	"windows-sql": "windows-sql-cloud",
}

built-in projects to look for images/families containing the string on the left in

Functions

func BetaMetadataUpdate

func BetaMetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, serverMD *compute.Metadata)

Update the beta metadata (serverMD) according to the provided diff (oldMDMap v newMDMap).

func ComparePartnerMetadataDiff

func ComparePartnerMetadataDiff(_, old, new string, d *schema.ResourceData) bool

func FlattenMetadata

func FlattenMetadata(metadata *compute.Metadata) map[string]interface{}

This function differs from flattenMetadataBeta only in that it takes compute.metadata rather than compute.metadata as an argument. It should be removed in favour of flattenMetadataBeta if/when all resources using it get beta support.

func MetadataRetryWrapper

func MetadataRetryWrapper(update func() error) error

Since the google compute API uses optimistic locking, there is a chance we need to resubmit our updated metadata. To do this, you need to provide an update function that attempts to submit your metadata

func MetadataUpdate

func MetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, serverMD *compute.Metadata)

Update the metadata (serverMD) according to the provided diff (oldMDMap v newMDMap).

func ResolveImage

func ResolveImage(c *transport_tpg.Config, project, name, userAgent string) (string, error)

If the given name is a URL, return it. If it's in the form projects/{project}/global/images/{image}, return it If it's in the form projects/{project}/global/images/family/{family}, return it If it's in the form global/images/{image}, return it If it's in the form global/images/family/{family}, return it If it's in the form family/{family}, check if it's a family in the current project. If it is, return it as global/images/family/{family}.

If not, check if it could be a GCP-provided family, and if it exists. If it does, return it as projects/{project}/global/images/family/{family}.

If it's in the form {project}/{family-or-image}, check if it's an image in the named project. If it is, return it as projects/{project}/global/images/{image}.

If not, check if it's a family in the named project. If it is, return it as projects/{project}/global/images/family/{family}.

If it's in the form {family-or-image}, check if it's an image in the current project. If it is, return it as global/images/{image}.

If not, check if it could be a GCP-provided image, and if it exists. If it does, return it as projects/{project}/global/images/{image}.
If not, check if it's a family in the current project. If it is, return it as global/images/family/{family}.
If not, check if it could be a GCP-provided family, and if it exists. If it does, return it as projects/{project}/global/images/family/{family}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL