mirror of https://github.com/grafana/loki
parent
d4a5e60445
commit
77d01566da
@ -1,19 +0,0 @@ |
||||
package manifests |
||||
|
||||
import ( |
||||
apps "k8s.io/api/apps/v1" |
||||
) |
||||
|
||||
type Options struct { |
||||
} |
||||
|
||||
// DefaultOptions needs no comment
|
||||
func DefaultOptions() Options { |
||||
return Options{} |
||||
} |
||||
|
||||
// Build creates a list of manifests that should be deployed
|
||||
func Build(_ Options) ([]apps.Deployment, error) { |
||||
dep, err := DistributorDeployment() |
||||
return []apps.Deployment{dep}, err |
||||
} |
@ -1,36 +0,0 @@ |
||||
package manifests |
||||
|
||||
import ( |
||||
"embed" |
||||
"io/fs" |
||||
|
||||
"github.com/ViaQ/logerr/kverrors" |
||||
apps "k8s.io/api/apps/v1" |
||||
core "k8s.io/api/core/v1" |
||||
"sigs.k8s.io/kustomize/kyaml/yaml" |
||||
) |
||||
|
||||
//go:embed 0.0.1/*
|
||||
var embededFS embed.FS |
||||
|
||||
func DistributorDeployment() (res apps.Deployment, err error) { |
||||
err = readFile(&res, "0.0.1/base/distributor-deploy.yaml") |
||||
return |
||||
} |
||||
|
||||
func DistributorGrpcService() (res core.Service, err error) { |
||||
err = readFile(&res, "0.0.1/base/distributor-grpc-service.yaml") |
||||
return |
||||
} |
||||
|
||||
func readFile(to interface{}, path string) error { |
||||
b, err := fs.ReadFile(embededFS, path) |
||||
if err != nil { |
||||
return kverrors.Wrap(err, "failed to read file", "path", path) |
||||
} |
||||
|
||||
if err := yaml.Unmarshal(b, to); err != nil { |
||||
return kverrors.Wrap(err, "file was in the incorrect format", "path", path) |
||||
} |
||||
return nil |
||||
} |
Loading…
Reference in new issue