fix lint errors
This commit is contained in:
parent
d815419c7b
commit
a6fe8fe799
@ -316,7 +316,9 @@ func (a *App) ConfigCmd(docs []string, includeSystemConfig bool) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if includeSystemConfig {
|
if includeSystemConfig {
|
||||||
_, err = a.emitter.Emit(a.Config, nil)
|
if _, err = a.emitter.Emit(a.Config, nil); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_, err = a.emitter.(data.ManyEmitter).EmitMany(a.Documents, nil)
|
_, err = a.emitter.(data.ManyEmitter).EmitMany(a.Documents, nil)
|
||||||
return
|
return
|
||||||
|
@ -275,12 +275,7 @@ func (d *Document) Apply(state string) error {
|
|||||||
slog.Info("Document.Apply() applying resource", "index", idx, "uri", d.ResourceDeclarations[idx].Resource().URI(), "resource", d.ResourceDeclarations[idx].Resource())
|
slog.Info("Document.Apply() applying resource", "index", idx, "uri", d.ResourceDeclarations[idx].Resource().URI(), "resource", d.ResourceDeclarations[idx].Resource())
|
||||||
|
|
||||||
if d.ResourceDeclarations[idx].Requires.Check() {
|
if d.ResourceDeclarations[idx].Requires.Check() {
|
||||||
|
|
||||||
// fmt.Fprintf(os.Stderr, "%s: ", d.ResourceDeclarations[idx].Resource().URI())
|
|
||||||
|
|
||||||
if e := d.ResourceDeclarations[idx].Apply(state); e != nil {
|
if e := d.ResourceDeclarations[idx].Apply(state); e != nil {
|
||||||
// slog.Error("Document.Apply() error applying resource", "index", idx, "uri", d.ResourceDeclarations[idx].Resource().URI(), "error", e)
|
|
||||||
// fmt.Fprintf(os.Stderr, "%s\n", "error")
|
|
||||||
d.ResourceDeclarations[idx].Error = e.Error()
|
d.ResourceDeclarations[idx].Error = e.Error()
|
||||||
switch d.ResourceDeclarations[idx].OnError.GetStrategy() {
|
switch d.ResourceDeclarations[idx].OnError.GetStrategy() {
|
||||||
case OnErrorStop:
|
case OnErrorStop:
|
||||||
@ -288,8 +283,6 @@ func (d *Document) Apply(state string) error {
|
|||||||
case OnErrorFail:
|
case OnErrorFail:
|
||||||
d.failedResources++
|
d.failedResources++
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// fmt.Fprintf(os.Stderr, "%s\n", state)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
d.ResourceDeclarations[idx].Error = fmt.Sprintf("Constraint failure: %s", d.ResourceDeclarations[idx].Requires)
|
d.ResourceDeclarations[idx].Error = fmt.Sprintf("Constraint failure: %s", d.ResourceDeclarations[idx].Requires)
|
||||||
|
Loading…
Reference in New Issue
Block a user