Support uploading to IBM Cloud#1924
Conversation
mvo5
left a comment
There was a problem hiding this comment.
Thanks! This looks good, a few nitpicks/suggestions inline.
| } | ||
|
|
||
| func (iu *ibmcloudUploader) Check(status io.Writer) error { | ||
| return nil |
There was a problem hiding this comment.
ideally we would do parts of the checks from UploadAndRegister() here too, like checking for the environment. Maybe via a common helper that is then used here and in UploadAndRegister() ?
There was a problem hiding this comment.
As per discussion in #1921 (comment) , I am skipping the check for now
There was a problem hiding this comment.
Looks like the check only gets called when uploading as part of a build: https://github.com/osbuild/image-builder-cli/blob/392736dac329a3f6ccc6dccd4170b4f20a8f4c1b/cmd/image-builder/main.go#L405
But not called with image-builder upload.
|
A previous version of this PR changed the images API or behaviour causing integration issues with osbuild-composer. |
achilleas-k
left a comment
There was a problem hiding this comment.
Thanks. LGTM.
We can handle the Check() function separately.
Did you mean to approve? |
thozza
left a comment
There was a problem hiding this comment.
Thanks. My comments can be a follow-up.
pkg/cloud/ibmcloud/ibmcloud.go
Outdated
| authEndpoint string | ||
| apiKey string | ||
| crn string | ||
| filename string | ||
| profilename string | ||
| trustedProfileID string | ||
| crTokenFilePath string | ||
| serviceInstanceID string |
There was a problem hiding this comment.
Nitpick: Why not use a pointer to credentials.Credentials type and initialize it in NewUploader()?
There was a problem hiding this comment.
That's what I would do but for some reason, the AWS uploader does it this
images/pkg/cloud/awscloud/uploader.go
Lines 69 to 71 in 9ff35eb
so I tried to stay consistent with it.
There was a problem hiding this comment.
Thanks for providing more context. The values that you've pointed out from AWS uploader are IMO more like the region, bucketName or imageName, but are optional and not required to be able to upload an image to AWS. Therefore, they are made "optional" by being passed via the UploaderOptions struct.
I still think that my suggestion would make sense in this case and does not go against the consistency in this regard.
There was a problem hiding this comment.
Okay, in that case I will try to refactor in the way you are suggesting :-)
| fmt.Fprintf(status, "Uploading to IBM Cloud...\n") | ||
|
|
||
| endpoint := fmt.Sprintf("s3.%s.cloud-object-storage.appdomain.cloud", iu.region) | ||
| credentials, err := iu.getCredentials() |
There was a problem hiding this comment.
I think that it would be better to call this in NewUploader() to get an error earlier.
There was a problem hiding this comment.
IMHO, it would be a good candidate for the Check method once it gets "fixed"
achilleas-k
left a comment
There was a problem hiding this comment.
LGTM.
I think this is good to merge and we can do a more general fix-up of the way Check() is handled in uploaders as a follow-up.
I think we should generally add a call to Check() in all UploadAndRegister() implementations, but also keep it separate so that callers can validate the uploader configuration before starting a long-running process (like a build).
The CI failed with so I guess restarting the tests should help. |
I'll click it again, but with the ongoing AWS outage, I think we might have trouble getting this to go through. |
Then again, this is already up to date with main, so we don't need the merge queue. I'll admin merge. |
Changes with 0.205.0 ---------------- - Convert the test config map to a config list (osbuild/images#1900) - Author: Achilleas Koutsou, Reviewers: Sanne Raymaekers, Simon de Vlieger - Repos: Add definitions for AlmaLinux 9.7, 9.8, 10.1 and 10.2 (osbuild/images#1926) - Author: Eduard Abdullin, Reviewers: Achilleas Koutsou, Brian C. Lane, Simon de Vlieger - Support uploading to OpenStack (osbuild/images#1921) - Author: Jakub Kadlčík, Reviewers: Michael Vogt, Simon de Vlieger - disk: make addPartitionsForBootMode() arch specific (osbuild/images#1928) - Author: Michael Vogt, Reviewers: Brian C. Lane, Simon de Vlieger - distro: add ova image type for bootc [HMS-9503] (osbuild/images#1938) - Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger - fedora/minimal: drop uuids in partition tables (osbuild/images#1932) - Author: Simon de Vlieger, Reviewers: Brian C. Lane, Michael Vogt Changes with 0.206.0 ---------------- - Update osbuild dependency commit ID to latest (osbuild/images#1945) - Author: SchutzBot, Reviewers: Achilleas Koutsou, Simon de Vlieger - deps: bump blueprint to 1.16.0 (osbuild/images#1952) - Author: Simon de Vlieger, Reviewers: Achilleas Koutsou, Sanne Raymaekers - fedora: Drop tigervnc on F42 and later (osbuild/images#1942) - Author: Brian C. Lane, Reviewers: Simon de Vlieger, Tomáš Hozza - fedora: document root kickstart (osbuild/images#1936) - Author: Simon de Vlieger, Reviewers: Brian C. Lane, Michael Vogt - fedora: rawhide is 44 (osbuild/images#1943) - Author: Simon de Vlieger, Reviewers: Achilleas Koutsou, Tomáš Hozza - many: lorax template split (HMS-9524) (osbuild/images#1949) - Author: Simon de Vlieger, Reviewers: Brian C. Lane, Tomáš Hozza Changes with 0.207.0 ---------------- - Enable fedora 43 unit testing (osbuild/images#1954) - Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza - fedora: update cloud_kernel_options (osbuild/images#1953) - Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Simon de Vlieger - test/data/repos/rhel-10.2: fix copy & paste error (osbuild/images#1956) - Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Simon de Vlieger Changes with 0.208.0 ---------------- - Schutzfile: switch CI runner to Fedora 42 (osbuild/images#1955) - Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza - Support uploading to IBM Cloud (osbuild/images#1924) - Author: Jakub Kadlčík, Reviewers: Achilleas Koutsou, Simon de Vlieger - pkg/osbuild: generate osbuild result from status scanner entries (osbuild/images#1941) - Author: Sanne Raymaekers, Reviewers: Nobody
Changes with 0.205.0 ---------------- - Convert the test config map to a config list (osbuild/images#1900) - Author: Achilleas Koutsou, Reviewers: Sanne Raymaekers, Simon de Vlieger - Repos: Add definitions for AlmaLinux 9.7, 9.8, 10.1 and 10.2 (osbuild/images#1926) - Author: Eduard Abdullin, Reviewers: Achilleas Koutsou, Brian C. Lane, Simon de Vlieger - Support uploading to OpenStack (osbuild/images#1921) - Author: Jakub Kadlčík, Reviewers: Michael Vogt, Simon de Vlieger - disk: make addPartitionsForBootMode() arch specific (osbuild/images#1928) - Author: Michael Vogt, Reviewers: Brian C. Lane, Simon de Vlieger - distro: add ova image type for bootc [HMS-9503] (osbuild/images#1938) - Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger - fedora/minimal: drop uuids in partition tables (osbuild/images#1932) - Author: Simon de Vlieger, Reviewers: Brian C. Lane, Michael Vogt Changes with 0.206.0 ---------------- - Update osbuild dependency commit ID to latest (osbuild/images#1945) - Author: SchutzBot, Reviewers: Achilleas Koutsou, Simon de Vlieger - deps: bump blueprint to 1.16.0 (osbuild/images#1952) - Author: Simon de Vlieger, Reviewers: Achilleas Koutsou, Sanne Raymaekers - fedora: Drop tigervnc on F42 and later (osbuild/images#1942) - Author: Brian C. Lane, Reviewers: Simon de Vlieger, Tomáš Hozza - fedora: document root kickstart (osbuild/images#1936) - Author: Simon de Vlieger, Reviewers: Brian C. Lane, Michael Vogt - fedora: rawhide is 44 (osbuild/images#1943) - Author: Simon de Vlieger, Reviewers: Achilleas Koutsou, Tomáš Hozza - many: lorax template split (HMS-9524) (osbuild/images#1949) - Author: Simon de Vlieger, Reviewers: Brian C. Lane, Tomáš Hozza Changes with 0.207.0 ---------------- - Enable fedora 43 unit testing (osbuild/images#1954) - Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza - fedora: update cloud_kernel_options (osbuild/images#1953) - Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Simon de Vlieger - test/data/repos/rhel-10.2: fix copy & paste error (osbuild/images#1956) - Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Simon de Vlieger Changes with 0.208.0 ---------------- - Schutzfile: switch CI runner to Fedora 42 (osbuild/images#1955) - Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza - Support uploading to IBM Cloud (osbuild/images#1924) - Author: Jakub Kadlčík, Reviewers: Achilleas Koutsou, Simon de Vlieger - pkg/osbuild: generate osbuild result from status scanner entries (osbuild/images#1941) - Author: Sanne Raymaekers, Reviewers: Nobody
Changes with 0.205.0 ---------------- - Convert the test config map to a config list (osbuild/images#1900) - Author: Achilleas Koutsou, Reviewers: Sanne Raymaekers, Simon de Vlieger - Repos: Add definitions for AlmaLinux 9.7, 9.8, 10.1 and 10.2 (osbuild/images#1926) - Author: Eduard Abdullin, Reviewers: Achilleas Koutsou, Brian C. Lane, Simon de Vlieger - Support uploading to OpenStack (osbuild/images#1921) - Author: Jakub Kadlčík, Reviewers: Michael Vogt, Simon de Vlieger - disk: make addPartitionsForBootMode() arch specific (osbuild/images#1928) - Author: Michael Vogt, Reviewers: Brian C. Lane, Simon de Vlieger - distro: add ova image type for bootc [HMS-9503] (osbuild/images#1938) - Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger - fedora/minimal: drop uuids in partition tables (osbuild/images#1932) - Author: Simon de Vlieger, Reviewers: Brian C. Lane, Michael Vogt Changes with 0.206.0 ---------------- - Update osbuild dependency commit ID to latest (osbuild/images#1945) - Author: SchutzBot, Reviewers: Achilleas Koutsou, Simon de Vlieger - deps: bump blueprint to 1.16.0 (osbuild/images#1952) - Author: Simon de Vlieger, Reviewers: Achilleas Koutsou, Sanne Raymaekers - fedora: Drop tigervnc on F42 and later (osbuild/images#1942) - Author: Brian C. Lane, Reviewers: Simon de Vlieger, Tomáš Hozza - fedora: document root kickstart (osbuild/images#1936) - Author: Simon de Vlieger, Reviewers: Brian C. Lane, Michael Vogt - fedora: rawhide is 44 (osbuild/images#1943) - Author: Simon de Vlieger, Reviewers: Achilleas Koutsou, Tomáš Hozza - many: lorax template split (HMS-9524) (osbuild/images#1949) - Author: Simon de Vlieger, Reviewers: Brian C. Lane, Tomáš Hozza Changes with 0.207.0 ---------------- - Enable fedora 43 unit testing (osbuild/images#1954) - Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza - fedora: update cloud_kernel_options (osbuild/images#1953) - Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Simon de Vlieger - test/data/repos/rhel-10.2: fix copy & paste error (osbuild/images#1956) - Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Simon de Vlieger Changes with 0.208.0 ---------------- - Schutzfile: switch CI runner to Fedora 42 (osbuild/images#1955) - Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza - Support uploading to IBM Cloud (osbuild/images#1924) - Author: Jakub Kadlčík, Reviewers: Achilleas Koutsou, Simon de Vlieger - pkg/osbuild: generate osbuild result from status scanner entries (osbuild/images#1941) - Author: Sanne Raymaekers, Reviewers: Nobody
Changes with 0.207.0 ---------------- - Enable fedora 43 unit testing (osbuild/images#1954) - Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza - fedora: update cloud_kernel_options (osbuild/images#1953) - Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Simon de Vlieger - test/data/repos/rhel-10.2: fix copy & paste error (osbuild/images#1956) - Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Simon de Vlieger Changes with 0.208.0 ---------------- - Schutzfile: switch CI runner to Fedora 42 (osbuild/images#1955) - Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza - Support uploading to IBM Cloud (osbuild/images#1924) - Author: Jakub Kadlčík, Reviewers: Achilleas Koutsou, Simon de Vlieger - pkg/osbuild: generate osbuild result from status scanner entries (osbuild/images#1941) - Author: Sanne Raymaekers, Reviewers: Nobody Changes with 0.209.0 ---------------- - gitlab: run ostree manifest generation and builds only when needed (osbuild/images#1961) - Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza - osbuild/osbuild-exec: extract building the osbuild cmd to helper (osbuild/images#1963) - Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Simon de Vlieger - rhel10: add ism secret & top secret oscap profiles (HMS-9507) (osbuild/images#1962) - Author: Gianluca Zuccarelli, Reviewers: Lukáš Zapletal, Sanne Raymaekers
See osbuild/image-builder-cli#238