<@UB89GSWCF> I guess we need to define the struct ...
# atmos-dev
v
@Andriy Knysh (Cloud Posse) I guess we need to define the struct of this vendor yaml before hand? if yes can you give a sample please? https://linear.app/cloudposse/issue/DEV-2378/vendor-path-setting-in-atmosyaml-to-specify-vendoryaml-path
a
currently, Atmos searches for
vendor.yaml
file in the root of the repo
we can add a separate section to
atmos.yaml
Copy code
vendor:
  vendor_config_path: <path to vendor.yaml>
and add a new struct to pkg/schema/schema.go
v
aham I was think about that
a
to
Copy code
// CliConfiguration structure represents schema for `atmos.yaml` CLI config
type CliConfiguration struct {
Copy code
// CliConfiguration structure represents schema for `atmos.yaml` CLI config
type CliConfiguration struct {
   Vendor ...
then, Atmos should check the path to
vendor.yaml
from the
atmos.yaml
first, and use it if it exists
if the path is defined in
atmos.yaml
, but
vendor.yaml
file is not there, print an error
✅ 1
if the path is not defined in
atmos.yaml
, go back to the existing logic - search for
vendor.yaml
in the root of the repo
✅ 1
v
ok so dont need to define in pkg/config/utils.go the vendor struct ? before we load the vendorconfig?
a
just need this
Copy code
// CliConfiguration structure represents schema for `atmos.yaml` CLI config
type CliConfiguration struct {
   Vendor ...
we already have the vendor structure in
pkg/schema/schema.go
v
ok thanks for detailed explanation, def makes things faster to me
a
Copy code
// Atmos vendoring (`vendor.yaml` file)

type AtmosVendorSource struct {
	Component     string   `yaml:"component" json:"component" mapstructure:"component"`
	Source        string   `yaml:"source" json:"source" mapstructure:"source"`
	Version       string   `yaml:"version" json:"version" mapstructure:"version"`
	File          string   `yaml:"file" json:"file" mapstructure:"file"`
	Targets       []string `yaml:"targets" json:"targets" mapstructure:"targets"`
	IncludedPaths []string `yaml:"included_paths,omitempty" json:"included_paths,omitempty" mapstructure:"included_paths"`
	ExcludedPaths []string `yaml:"excluded_paths,omitempty" json:"excluded_paths,omitempty" mapstructure:"excluded_paths"`
	Tags          []string `yaml:"tags" json:"tags" mapstructure:"tags"`
}
✅ 1
Copy code
type AtmosVendorConfig struct {
	ApiVersion string `yaml:"apiVersion" json:"apiVersion" mapstructure:"apiVersion"`
	Kind       string `yaml:"kind" json:"kind" mapstructure:"kind"`
	Metadata   AtmosVendorMetadata
	Spec       AtmosVendorSpec `yaml:"spec" json:"spec" mapstructure:"spec"`
}
✅ 1