Cluster creation fails if detaching HEAD
Created by: NotTheEvilOne
The following error occurs if git checkout tags/<something>
has been used (as an example):
openstack_compute_instance_v2.mgmtcluster_server (remote-exec): /tmp/terraform_1721514282.sh: 2: Syntax error: "(" unexpected
╷
│ Error: remote-exec provisioner error
│
│ with openstack_compute_instance_v2.mgmtcluster_server,
│ on mgmtcluster.tf line 157, in resource "openstack_compute_instance_v2" "mgmtcluster_server":
│ 157: provisioner "remote-exec" {
│
│ error executing "/tmp/terraform_1721514282.sh": Process exited with status 2
╵
The file mentioned has the following content:
#!/bin/sh
/tmp/get_k8s_git.sh https://github.com/SovereignCloudStack/k8s-cluster-api-provider.git (HEAD detached at v4.0.0)
/home/ubuntu/bin/bootstrap.sh
Issue is caused by terraform/Makefile
:
GITBRANCH=$(shell git branch | grep '^*' | $(SED) 's/^* //')