GitOps for k8s
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sync.go 972B

12345678910111213141516171819202122232425262728293031323334353637
  1. package cluster
  2. import (
  3. "strings"
  4. "github.com/fluxcd/flux/resource"
  5. )
  6. // Definitions for use in synchronising a cluster with a git repo.
  7. // SyncSet groups the set of resources to be updated. Usually this is
  8. // the set of resources found in a git repo; in any case, it must
  9. // represent the complete set of resources, as garbage collection will
  10. // assume missing resources should be deleted. The name is used to
  11. // distinguish the resources from a set from other resources -- e.g.,
  12. // cluster resources not marked as belonging to a set will not be
  13. // deleted by garbage collection.
  14. type SyncSet struct {
  15. Name string
  16. Resources []resource.Resource
  17. }
  18. type ResourceError struct {
  19. ResourceID resource.ID
  20. Source string
  21. Error error
  22. }
  23. type SyncError []ResourceError
  24. func (err SyncError) Error() string {
  25. var errs []string
  26. for _, e := range err {
  27. errs = append(errs, e.ResourceID.String()+": "+e.Error.Error())
  28. }
  29. return strings.Join(errs, "; ")
  30. }