Use compose-go https://github.com/compose-spec/compose-go to make Katenary parsing compose file the official way. Add labels: - `volume-from` (with `same-pod`) to avoid volume repetition - `ignore` to ignore a service - `mapenv` (replaces the `env-to-service`) to map environment to helm variable (as a template string) - `secret-vars` declares variables as secret values More: - Now, environment (as secret vars) are set in values.yaml - Ingress has got annotations in values.yaml - Probes (liveness probe) are improved - fixed code to optimize - many others fixes about path, bad volume check, refactorisation, tests...
42 lines
801 B
Go
42 lines
801 B
Go
package helm
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
const K = "katenary.io"
|
|
|
|
var (
|
|
Appname = "" // set at runtime
|
|
Version = "1.0" // should be set from main.Version
|
|
)
|
|
|
|
// Kinded represent an object with a kind.
|
|
type Kinded interface {
|
|
// Get must resturn the kind name.
|
|
Get() string
|
|
}
|
|
|
|
// Signable represents an object with a signature.
|
|
type Signable interface {
|
|
// BuildSHA must return the signature.
|
|
BuildSHA(filename string)
|
|
}
|
|
|
|
// Named represents an object with a name.
|
|
type Named interface {
|
|
// Name must return the name of the object (from metadata).
|
|
Name() string
|
|
}
|
|
|
|
// GetProjectName returns the name of the project.
|
|
func GetProjectName() string {
|
|
if len(Appname) > 0 {
|
|
return Appname
|
|
}
|
|
p, _ := os.Getwd()
|
|
path := strings.Split(p, string(os.PathSeparator))
|
|
return path[len(path)-1]
|
|
}
|