Skip to content

support sourceImage outside the existing project#101

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
abhinavdahiya:fix_image
Jul 10, 2020
Merged

support sourceImage outside the existing project#101
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
abhinavdahiya:fix_image

Conversation

@abhinavdahiya
Copy link
Copy Markdown
Contributor

Based on the api reference for compute.instance.insert

disks[].initializeParams.sourceImage:

The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD.
To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image:

projects/debian-cloud/global/images/family/debian-9

Alternatively, use a specific version of a public operating system image:

projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD

To create a disk with a custom image that you created, specify the image name in the following format:

global/images/my-custom-image

You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:

global/images/family/my-image-family

Currently the provider always assumes that the image will be in the same project as the machine and it massages the input to match that.

To allow users to provide source image based on examples mentioned above, we pass it as-is unless we know that input is just image-name.

Based on the api reference for compute.instance.insert [0]

```
disks[].initializeParams.sourceImage:

The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD.
To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image:

projects/debian-cloud/global/images/family/debian-9

Alternatively, use a specific version of a public operating system image:

projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD

To create a disk with a custom image that you created, specify the image name in the following format:

global/images/my-custom-image

You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:

global/images/family/my-image-family
```

Currently the provider always assumes that the image will be in the same project as the machine and it massages the input to match that.

To allow users to provide source image based on examples mentioned above, we pass it as-is unless we know that input is just image-name.

[0]: https://cloud.google.com/compute/docs/reference/rest/v1/instances/insert
@abhinavdahiya
Copy link
Copy Markdown
Contributor Author

we would need to use pre existing images for RHCOS openshift/installer#3808

Copy link
Copy Markdown
Contributor

@michaelgugino michaelgugino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2020
Copy link
Copy Markdown
Contributor

@elmiko elmiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks reasonable to me, i'd like to have someone more familiar with the gcp provider add the approved label though.
/lgtm

@michaelgugino
Copy link
Copy Markdown
Contributor

/approve

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michaelgugino

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 9, 2020
@abhinavdahiya
Copy link
Copy Markdown
Contributor Author

/retest

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 245b581 into openshift:master Jul 10, 2020
@abhinavdahiya abhinavdahiya deleted the fix_image branch July 10, 2020 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants