juju / terraform-provider-juju

A Terraform provider for Juju
Apache License 2.0
19 stars 37 forks source link

Deploy charms using custom images #460

Closed gatici closed 1 month ago

gatici commented 5 months ago

Requirements

We are deploying SD-Core with Terraform modules and we need to test the images before uploading as a charm resource. We would like to use custom images directly from Canonical repository, DockerHub or from our local before linking with a charm revision for development purposes. The reason is the image needs to tested before we make sure that it does not break the things.

For example for our test suit, we could like to make an end-to-end test for each PR in our charms by building a fresh image. Then we would like to deploy the charms with that fresh image before merging the PR's.

resource "juju_application" "ausf" {
  name = "ausf"
  model = var.model_name

  charm {
    name = "sdcore-ausf-k8s"
    channel = var.channel
  }

  units = 1
  trust = true
}


### Urgency

Need this really badly for test suite

### Notes & References

_No response_
hmlanigan commented 3 months ago

@gatici Have you tried uploading the resource to charmhub without releasing it to a channel then trying to deploy with by the resource revision number?

@markberil is also aware of this potential work around.

kelkawi-a commented 3 months ago

This issue is relevant to our team's charm as well, but the mentioned workaround does not really work for our use case.

Our charm is meant to be a generic one that users can deploy with different images that they define. With this in mind, users cannot push their images to Charmhub. It would be useful if we can use Terraform to deploy charms with custom images.