failed to create state file when provided
I'm getting the following error when trying to use a porter bundle that has "state" provided in the manifest when running in the operator: could not create a new gzip reader for the statefile: unexpected EOF This is when using "state" to store off terraform tfstate files ex:
state:
- name: tfstate
path: terraform/terraform.tfstate
- name: tfvars
path: terraform/terraform.tfvars.json
This works when setting the tfstate file as a bundle output and using it that way. Running this on beta.2 in the operator
originally reported by @sgettys
Looks like how k8s mounts the /porter/state.tgz file there needs to be a check for the unexpected EOF. The state file will exist but be empty. Adding in fix and testing this now
After some investigation from @sgettys , the problem is related to https://github.com/cnabio/cnab-go/issues/266. the k8s driver writes "null" file onto the volume that's used by invocation image which causes unexpectedEOF error. https://github.com/cnabio/cnab-go/blob/main/driver/kubernetes/kubernetes.go#L426 The reason why this is working with porter CLI is because docker-driver treats all files as tars. https://github.com/cnabio/cnab-go/blob/main/driver/docker/docker.go#L440
The workaround fix in porter is completes: https://github.com/getporter/porter/issues/2307
Can we close this issue or is there still something else that needs to happen?
This should be complete