Skip to content

Commit

Permalink
GCP schema changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dustymabe committed May 21, 2020
1 parent 0c1213b commit aebe946
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion mantle/cmd/kola/kola.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ func writeProps() error {
}
type GCE struct {
Image string `json:"image"`
Project string `json:"project"`
MachineType string `json:"type"`
}
type OpenStack struct {
Expand Down Expand Up @@ -316,6 +317,7 @@ func writeProps() error {
},
GCE: GCE{
Image: kola.GCEOptions.Image,
Project: kola.GCEOptions.Project,
MachineType: kola.GCEOptions.MachineType,
},
OpenStack: OpenStack{
Expand Down Expand Up @@ -577,7 +579,8 @@ func syncFindParentImageOptions() error {
return err
}
case "gce":
kola.GCEOptions.Image, err = parentCosaBuild.FindGCPImage()
kola.GCEOptions.Image, kola.GCEOptions.Project, err =
parentCosaBuild.FindGCPImage()
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions mantle/cosa/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ func (build *Build) FindAMI(region string) (string, error) {
return "", fmt.Errorf("no AMI found for region %s", region)
}

func (build *Build) FindGCPImage() (string, error) {
func (build *Build) FindGCPImage() (string, string, error) {
if build.Gcp != nil {
return build.Gcp.Image, nil
return build.Gcp.Image, build.Gcp.Project, nil
}
return "", errors.New("no GCP image found")
return "", "", errors.New("no GCP image found")
}

func (build *Build) WriteMeta(path string, validate bool) error {
Expand Down
9 changes: 8 additions & 1 deletion mantle/cosa/cosa_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ type Amis struct {
Snapshot string `json:"snapshot"`
}

type Gcp struct {
Image string `json:"image"`
Project string `json:"project"`
URL string `json:"url"`
Family string `json:"family,omitempty"`
}

type Artifact struct {
Path string `json:"path"`
Sha256 string `json:"sha256"`
Expand Down Expand Up @@ -40,7 +47,7 @@ type Build struct {
CosaImageVersion int `json:"coreos-assembler.image-genver,omitempty"`
FedoraCoreOsParentCommit string `json:"fedora-coreos.parent-commit,omitempty"`
FedoraCoreOsParentVersion string `json:"fedora-coreos.parent-version,omitempty"`
Gcp *Cloudartifact `json:"gcp,omitempty"`
Gcp *Gcp `json:"gcp,omitempty"`
GitDirty string `json:"coreos-assembler.config-dirty,omitempty"`
ImageInputChecksum string `json:"coreos-assembler.image-input-checksum,omitempty"`
InputHasOfTheRpmOstree string `json:"rpm-ostree-inputhash"`
Expand Down

0 comments on commit aebe946

Please sign in to comment.