Skip to content

Commit eb5327e

Browse files
committed
cleanup
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
1 parent 2da1217 commit eb5327e

2 files changed

Lines changed: 4 additions & 26 deletions

File tree

app/cli/cmd/apply.go

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
package cmd
1717

1818
import (
19-
"fmt"
20-
2119
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
2220
"github.com/spf13/cobra"
2321
)
@@ -41,26 +39,7 @@ Supports multi-document YAML files. Each document must have a 'kind' field.`,
4139
return err
4240
}
4341

44-
var contracts int
45-
var errors []string
46-
for _, r := range results {
47-
if r.Error != nil {
48-
errors = append(errors, fmt.Sprintf(" %s/%s: %s", r.Kind, r.Name, r.Error))
49-
continue
50-
}
51-
if r.Kind == action.KindContract {
52-
contracts++
53-
}
54-
}
55-
56-
if len(errors) > 0 {
57-
for _, e := range errors {
58-
logger.Error().Msg(e)
59-
}
60-
return fmt.Errorf("%d of %d resources failed to apply", len(errors), len(results))
61-
}
62-
63-
logger.Info().Msgf("%d contracts applied", contracts)
42+
logger.Info().Msgf("%d contracts applied", len(results))
6443

6544
return nil
6645
},

app/cli/pkg/action/apply.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ const (
3434
KindContract = "Contract"
3535
)
3636

37-
// ApplyResult holds the outcome of applying a single resource document
37+
// ApplyResult holds the outcome of a successfully applied resource document
3838
type ApplyResult struct {
39-
Kind string
40-
Name string
41-
Error error
39+
Kind string
40+
Name string
4241
}
4342

4443
// YAMLDoc holds a parsed YAML document with its kind and raw bytes

0 commit comments

Comments
 (0)