Files
warewulf/internal/pkg/version/version.go
Christian Goll 377702a179 make the configuration to be based in warewulf.conf
defaults will be se by the Makefile

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-03 16:02:41 +01:00

28 lines
585 B
Go

package version
import (
"fmt"
"github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
)
/*
Return the version of wwctl
*/
func GetVersion() string {
conf := warewulfconf.New()
return fmt.Sprintf("%s-%s", conf.VERSION(), conf.RELEASE())
}
/*
Returns the version of the api via grpc
*/
func Version() (versionResponse *wwapiv1.VersionResponse) {
versionResponse = &wwapiv1.VersionResponse{}
versionResponse.ApiPrefix = "rc1"
versionResponse.ApiVersion = "1"
versionResponse.WarewulfVersion = GetVersion()
return
}