Remove unused config files

This commit is contained in:
sophia 2021-11-19 11:49:00 -06:00 committed by Paul Hinze
parent bb43048813
commit 25b9d829eb
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
4 changed files with 3 additions and 131 deletions

View File

@ -1,33 +0,0 @@
package config
import (
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/vagrant/internal/server/proto/vagrant_server"
)
type Basis struct {
// These are new configurations
Location string `hcl:"location,attr"`
Runner *Runner `hcl:"runner,block" default:"{}"`
Labels map[string]string `hcl:"labels,optional"`
// These should _roughly_ map to existing Vagrantfile configurations
Vagrant *Vagrant `hcl:"vagrant,block"`
Targets []*Target `hcl:"target,block"`
Body hcl.Body `hcl:",body"`
Remain hcl.Body `hcl:",remain"`
ref *vagrant_server.Basis
path string
config *Config
}
func (b *Basis) Ref() *vagrant_server.Basis {
return b.ref
}
func (b *Basis) Validate() (err error) {
return
}

View File

@ -11,17 +11,13 @@ import (
"github.com/hashicorp/vagrant/internal/pkg/defaults"
)
// Config is the core configuration
// TODO(spox): We need to do the whole merging thing
// with the config and access things directly
// via the Config, not the Basis or Project
// Config is the core configuration for connecting to the
// Vagrant server/runners.
// This does not include Vagrantfile type config
type Config struct {
Runner *Runner `hcl:"runner,block" default:"{}"`
Labels map[string]string `hcl:"labels,optional"`
Basis *Basis
Project *Project
pathData map[string]string
ctx *hcl.EvalContext
}
@ -85,49 +81,3 @@ func Load(path string, pwd string) (*Config, error) {
return &cfg, nil
}
// Load a project from a configuration file (Vagrantfile)
// func (c *Config) LoadProject(vagrantfile *vagrant_server.Vagrantfile, projectRef *vagrant_server.Ref_Project) (*Project, error) {
// // We require an absolute path for the path so we can set the path vars
// // if !filepath.IsAbs(path) {
// // var err error
// // path, err = filepath.Abs(path)
// // if err != nil {
// // return nil, err
// // }
// // }
// // // If we have no pwd, then use pwd from basis config
// // if pwd == "" {
// // pwd = c.pathData["pwd"]
// // }
// // // Setup our initial variable set
// // pathData := map[string]string{
// // "pwd": pwd,
// // "project": filepath.Dir(path),
// // "vagrantfile": path,
// // }
// // Decode
// // var cfg Project
// // cfg.Location = filepath.Dir(path)
// machines := []*Machine{}
// for _, el := range vagrantfile.MachineConfigs {
// machines = append(machines, &Machine{Name: el.Name, Box: el.Box})
// }
// communicators := []*Communicator{}
// for _, el := range vagrantfile.Communicators {
// communicators = append(communicators, &Communicator{Name: el.Name})
// }
// return &Project{
// Location: filepath.Dir(vagrantfile.Path),
// Vagrant: &Vagrant{},
// Machines: machines,
// Communicators: communicators,
// path: filepath.Dir(vagrantfile.Path),
// config: c,
// ref: projectRef,
// }, nil
// }

View File

@ -1,33 +0,0 @@
package config
import (
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/vagrant-plugin-sdk/proto/vagrant_plugin_sdk"
)
type Project struct {
// These are new configurations
Location string `hcl:"location,attr"`
Runner *Runner `hcl:"runner,block" default:"{}"`
Labels map[string]string `hcl:"labels,optional"`
// These should _roughly_ map to existing Vagrantfile configurations
Vagrant *Vagrant `hcl:"vagrant,block"`
Targets []*Target `hcl:"machine,block"`
Body hcl.Body `hcl:",body"`
Remain hcl.Body `hcl:",remain"`
path string
ref *vagrant_plugin_sdk.Ref_Project
config *Config
}
func (p *Project) Ref() *vagrant_plugin_sdk.Ref_Project {
return p.ref
}
func (p *Project) Validate() (err error) {
return
}

View File

@ -1,12 +0,0 @@
package config
import (
"github.com/hashicorp/hcl/v2"
)
type Target struct {
Name string `hcl:"name,label"`
Body hcl.Body `hcl:",body"`
Remain hcl.Body `hcl:",remain"`
}