Skip to content

Commit 5680ad5

Browse files
authored
Output Terraform lib version in version string (camptocamp#75)
* Add compatibility matrix to README * Output Terraform compatibility in logs and version string
1 parent 61d3469 commit 5680ad5

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,16 @@ sign out of the proxy.
171171
$ go get github.com/camptocamp/terraboard
172172
```
173173

174+
## Compatibility Matrix
175+
176+
|Terraboard|Max Terraform version|
177+
|----------|---------------------|
178+
| 0.15.0 | 0.12.7 |
179+
| 0.16.0 | 0.12.7 |
180+
| 0.17.0 | 0.12.18 |
181+
| 0.18.0 | 0.12.18 |
182+
183+
174184
## Development
175185

176186
### Architecture

config/config.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"io/ioutil"
77
"os"
88

9+
tfversion "github.com/hashicorp/terraform/version"
910
"github.com/jessevdk/go-flags"
1011
log "github.com/sirupsen/logrus"
1112
"gopkg.in/yaml.v2"
@@ -107,7 +108,7 @@ func LoadConfig(version string) *Config {
107108
}
108109

109110
if c.Version {
110-
fmt.Printf("Terraboard v%v\n", version)
111+
fmt.Printf("Terraboard v%v (built for Terraform v%v)\n", version, tfversion.Version)
111112
os.Exit(0)
112113
}
113114

main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/camptocamp/terraboard/db"
1515
"github.com/camptocamp/terraboard/state"
1616
"github.com/camptocamp/terraboard/util"
17+
tfversion "github.com/hashicorp/terraform/version"
1718
log "github.com/sirupsen/logrus"
1819
)
1920

@@ -139,7 +140,7 @@ func main() {
139140

140141
util.SetBasePath(c.Web.BaseURL)
141142

142-
log.Infof("Terraboard v%s is starting...", version)
143+
log.Infof("Terraboard v%s (built for Terraform v%s) is starting...", version, tfversion.Version)
143144

144145
err := c.SetupLogging()
145146
if err != nil {

0 commit comments

Comments
 (0)