GalleyBytes / terraform-operator

A Kubernetes CRD to handle terraform operations
http://tf.galleybytes.com
Apache License 2.0
364 stars 47 forks source link

Failure with new github repos that don't have a master branch #1

Closed rmakram-ims closed 3 years ago

rmakram-ims commented 3 years ago

Since GitHub is is the process of moving away from the master branch and having all new repos created with the "main" branch instead. Any github repo that doesn't have a master branch will fail, regardless of where it is being used. It would be nice if the Terraform-Operator detected the default branch or accepted the branch as an input.

isaaguilar commented 3 years ago

I haven't updated docs for branch support yet 😓 .

If you wanted to use a different branch, you can use ?ref query options to your github address. Here's an example:

  terraformModule:
    address: https://github.com/isaaguilar/non-main-default-test.git?ref=branch1
  terraformVersion: 0.12.23

Should also works for the ssh method too:

  terraformModule:
    # ?ref accepts a branch or sha-hash
    address: git@github.com:isaaguilar/non-main-default-test.git?ref=63b5bb4ddb1cf77f6bec8f02dbd04baefe768ffd
  terraformVersion: 0.12.23
rmakram-ims commented 3 years ago

Thanks for the info and the quick response.