gcp

package module
v0.0.0-...-401481c Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package gcp implements GCP repository importer.

Index

Constants

View Source
const (
	// RepoName contains the repository name.
	RepoName = "GCP"
)

Variables

This section is empty.

Functions

func RunImageExportBuild

func RunImageExportBuild(cloudBuildClient *cloudbuild.Service, sourceProjectName, sourceImageName, buildProjectName, targetGCSbucket string) error

RunImageExportBuild runs Cloud build to create a .tar.gz file containing disk image from a cloud image.

Types

type Image

type Image struct {
	// contains filtered or unexported fields
}

Image holds data related to GCP image.

func (*Image) ID

func (i *Image) ID() string

ID returns non-unique GCP image ID.

func (*Image) LocalPath

func (i *Image) LocalPath() string

LocalPath returns local path to a GCP image .tar.gz raw disk file.

func (*Image) Preprocess

func (i *Image) Preprocess() (string, error)

Preprocess creates tar.gz file from an image, copies to local storage and extracts it.

func (*Image) QuickSHA256Hash

func (i *Image) QuickSHA256Hash() (string, error)

QuickSHA256Hash returns sha256 of custom properties of a GCP image.

func (*Image) RemotePath

func (i *Image) RemotePath() string

RemotePath returns remote path to a GCP image .tar.gz raw disk file.

func (*Image) RepoName

func (i *Image) RepoName() string

RepoName returns repository name.

func (*Image) RepoPath

func (i *Image) RepoPath() string

RepoPath returns repository path.

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

Repo holds data related to a GCP repository.

func NewRepo

func NewRepo(ctx context.Context, computeService *compute.Service, storageService *storage.Service, cloudBuildService *cloudbuild.Service, projectName, hashrGCPProject, hashrGCSBucket string) (*Repo, error)

NewRepo returns new instance of GCP repository.

func (*Repo) DiscoverRepo

func (r *Repo) DiscoverRepo() ([]hashr.Source, error)

DiscoverRepo traverses GCP project and looks for images.

func (*Repo) RepoName

func (r *Repo) RepoName() string

RepoName returns repository name.

func (*Repo) RepoPath

func (r *Repo) RepoPath() string

RepoPath returns repository path.

Jump to

Keyboard shortcuts

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