github.com/helmwave/helmwave@v0.36.4-0.20240509190856-b35563eba4c6/pkg/version/version.go (about)

     1  package version
     2  
     3  import (
     4  	log "github.com/sirupsen/logrus"
     5  )
     6  
     7  // Version is a helmwave binary version.
     8  // It should be a var not const.
     9  // It will override by goreleaser during release.
    10  // -X github.com/helmwave/helmwave/pkg/version.Version={{ .Version }}.
    11  var Version = "dev"
    12  
    13  // validate compares helmwave versions.
    14  func validate(a, b string) bool {
    15  	if a != b {
    16  		log.Warnf("⚠️ yaml version is %s but binary version is %s", a, b)
    17  
    18  		return false
    19  	}
    20  
    21  	log.Debug("✅ yaml version is equal to binary version")
    22  
    23  	return true
    24  }
    25  
    26  // Validate compare version.
    27  func Validate(a string) bool {
    28  	return validate(a, Version)
    29  }