cli: use pre-uploaded image on OpenStack

Before, the terraform infrastructure code would upload an image on the fly.
Now, we upload images in advance and specify the image ID instead.
This commit is contained in:
Malte Poll 2024-02-19 13:33:47 +01:00
parent 3b2da12781
commit 6f9020d527
8 changed files with 22 additions and 56 deletions

View file

@ -282,10 +282,8 @@ type OpenStackClusterVariables struct {
Cloud *string `hcl:"cloud" cty:"cloud"`
// FloatingIPPoolID is the ID of the OpenStack floating IP pool to use for public IPs.
FloatingIPPoolID string `hcl:"floating_ip_pool_id" cty:"floating_ip_pool_id"`
// ImageURL is the URL of the OpenStack image to use.
ImageURL string `hcl:"image_id" cty:"image_id"`
// DirectDownload decides whether to download the image directly from the URL to OpenStack or to upload it from the local machine.
DirectDownload bool `hcl:"direct_download" cty:"direct_download"`
// ImageID is the ID of the OpenStack image to use.
ImageID string `hcl:"image_id" cty:"image_id"`
// OpenstackUserDomainName is the OpenStack user domain name to use.
OpenstackUserDomainName string `hcl:"openstack_user_domain_name" cty:"openstack_user_domain_name"`
// OpenstackUsername is the OpenStack user name to use.

View file

@ -255,8 +255,7 @@ func TestOpenStackClusterVariables(t *testing.T) {
Name: "cluster-name",
Cloud: toPtr("my-cloud"),
FloatingIPPoolID: "fip-pool-0123456789abcdef",
ImageURL: "https://example.com/image.raw",
DirectDownload: true,
ImageID: "8e10b92d-8f7a-458c-91c6-59b42f82ef81",
OpenstackUserDomainName: "my-user-domain",
OpenstackUsername: "my-username",
OpenstackPassword: "my-password",
@ -288,8 +287,7 @@ node_groups = {
}
cloud = "my-cloud"
floating_ip_pool_id = "fip-pool-0123456789abcdef"
image_id = "https://example.com/image.raw"
direct_download = true
image_id = "8e10b92d-8f7a-458c-91c6-59b42f82ef81"
openstack_user_domain_name = "my-user-domain"
openstack_username = "my-username"
openstack_password = "my-password"