diff --git a/plugin.go b/plugin.go index edd055d..2c6e1f2 100644 --- a/plugin.go +++ b/plugin.go @@ -93,10 +93,16 @@ func (p *Plugin) Exec() error { args = append(args, "push") if p.Config.Spec != "" { - raw, err := ioutil.ReadFile(p.Config.Spec) + var raw []byte + // if spec is not a valid file, assume inlining + if _, err := os.Stat(p.Config.Spec); os.IsNotExist(err) { + raw = []byte(p.Config.Spec) + } else { // otherwise read it + raw, err = ioutil.ReadFile(p.Config.Spec) - if err != nil { - return errors.Wrap(err, "failed to read template") + if err != nil { + return errors.Wrap(err, "failed to read template") + } } spec, err := template.RenderTrim(string(raw), p)