shoebill/pkg/config/repository.go

41 lines
596 B
Go
Raw Normal View History

2024-07-25 13:23:28 +00:00
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
}