41 lines
596 B
Go
41 lines
596 B
Go
|
package config
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
/*
|
||
|
* Helm repo kinds: default/oci
|
||
|
*/
|
||
|
const (
|
||
|
HELM_REPO_OCI = "oci"
|
||
|
HELM_REPO_DEFAULT = "default"
|
||
|
)
|
||
|
|
||
|
type Repository struct {
|
||
|
Name string
|
||
|
Helm *RepositoryHelm
|
||
|
Git *RepositoryGit
|
||
|
}
|
||
|
|
||
|
type RepositoryHelm struct {
|
||
|
URL string
|
||
|
}
|
||
|
|
||
|
type RepositoryGit struct {
|
||
|
URL string
|
||
|
// Git ref
|
||
|
Ref string
|
||
|
// Path inside a git repo
|
||
|
Path string
|
||
|
}
|
||
|
|
||
|
type Repositories []*Repository
|
||
|
|
||
|
func (r *Repository) ValidateConfig() error {
|
||
|
if r.Helm != nil && r.Git != nil {
|
||
|
return fmt.Errorf("repo %s is invalid, only one repo kind can be specified", r.Name)
|
||
|
}
|
||
|
return nil
|
||
|
}
|