Files
warewulf/internal/pkg/version/version.go
Christian Goll 5e94766895 do not export version and rc
create also a new warewulf.conf so that the compiled
in paths are in sync with the configuration

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-02-16 17:38:34 -07:00

28 lines
610 B
Go

package version
import (
"fmt"
"github.com/warewulf/warewulf/internal/pkg/api/routes/wwapiv1"
warewulfconf "github.com/warewulf/warewulf/internal/pkg/config"
)
/*
Return the version of wwctl
*/
func GetVersion() string {
conf := warewulfconf.Get()
return fmt.Sprintf("%s-%s", conf.Paths.Version(), conf.Paths.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
}