WIP: Trying to diff
This commit is contained in:
@ -24,7 +24,7 @@ func ReadTheConfig(path string) (*config.Config, error) {
|
||||
return conf, nil
|
||||
}
|
||||
|
||||
func Reconcile(definedWorkdirPath, sshKeyPath string, conf *config.Config, dry bool) error {
|
||||
func Sync(definedWorkdirPath, sshKeyPath string, conf *config.Config, dry, diffArg bool) error {
|
||||
// Start by creating a directory where everything should be happening
|
||||
configPath := filepath.Dir(conf.ConfigPath)
|
||||
workdirPath, err := workdir.CreateWorkdir(definedWorkdirPath)
|
||||
@ -88,6 +88,14 @@ func Reconcile(definedWorkdirPath, sshKeyPath string, conf *config.Config, dry b
|
||||
return err
|
||||
}
|
||||
|
||||
if diffArg {
|
||||
_, err := hh.PullChart(workdirPath, *release.RepositoryObj, release.Chart, release.Version)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hh.RenderChart(workdirPath, *release.RepositoryObj, release.Chart, release.Version)
|
||||
}
|
||||
|
||||
if err := release.ValuesHandler(configPath); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -105,6 +113,12 @@ func Reconcile(definedWorkdirPath, sshKeyPath string, conf *config.Config, dry b
|
||||
return err
|
||||
}
|
||||
|
||||
if diffArg {
|
||||
for _, releaseCurrent := range releasesCurrent {
|
||||
hh.PullChart(workdirPath, *releaseCurrent.RepositoryObj, releaseCurrent.Chart, releaseCurrent.Version)
|
||||
}
|
||||
}
|
||||
|
||||
// Compare releases from the lockfile to ones from the current cluster config
|
||||
diffReleases, err := diff.DiffReleases(releasesCurrent, cluster.ReleasesObj)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user