-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Conversation
daemon/daemon.go
Outdated
JobStatusCache *job.StatusCache | ||
EventWriter event.EventWriter | ||
Logger log.Logger | ||
ResourceSyncErrors map[flux.ResourceID]error |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
daemon/daemon.go
Outdated
@@ -136,6 +138,10 @@ func (d *Daemon) ListServicesWithOptions(ctx context.Context, opts v11.ListServi | |||
case service.IsSystem: | |||
readOnly = v6.ReadOnlySystem | |||
} | |||
if syncerr, ok := d.ResourceSyncErrors[service.ID]; ok { | |||
service.Rollout.Messages = append(service.Rollout.Messages, syncerr.Error()) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
daemon/loop.go
Outdated
@@ -192,6 +192,11 @@ func (d *Daemon) doSync(logger log.Logger) (retErr error) { | |||
} | |||
|
|||
var syncErrors []event.ResourceError | |||
// Since Sync() applies *all* resources we clear all errors here. | |||
// If there is a recurring issue it will show up every time when | |||
// this code is run. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
a2a3a39
to
231a0d3
Compare
cluster/cluster.go
Outdated
@@ -17,7 +17,7 @@ type Cluster interface { | |||
SomeControllers([]flux.ResourceID) ([]Controller, error) | |||
Ping() error | |||
Export() ([]byte, error) | |||
Sync(SyncDef) error | |||
Sync(SyncDef, bool) error |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
What's happening with this one? Looks like there's only a couple of things holding it back:
|
That latest commit looks good 🍊 Regarding the sync error field -- we could think of (or even implement) the sync status as a Condition, in which case we'd probably treat it like we would |
Thinking this through a little more, if the sync status is a condition, then it should be considered as part of the rollout status calculation. That would need control flow to change, since that calculation is all done purely from the cluster resource, at present. |
Alternative: remove the bit that adds the sync error to the |
When applying the Kubernetes YAML fails we now record this and make it available within the daemon.
`fluxsync.Sync()` applies everything as a multidoc by default. If any apply fails, the next `Sync()` will apply the failed ones one by one while the rest is still applied as a multidoc.
I finally came to the realization that the sync errors should not be part of the rollout status. The rollout basically provides the current state of a workload. The sync error is from whenever the yaml file last changed (and has been sync'ed past) and has no relation to the current rollout status. Creating a release does commit & sync, while sync will fail during an user triggered release and provide semi-instant feedback (through polling jobs). Providing the information in I removed the part where it copies it into the rollout status for now and will add this directly as sub field for the |
c818454
to
936d121
Compare
The cluster delivers information about controllers and also performs the sync action. It is standing to reason that it should also fill in the blanks for sync errors.
Not quite, but this is at least as good a line of reasoning :-)
I like the moving it fully into the cluster implementation -- nice work there. |
When applying the Kubernetes YAML fails we now return this error in
ListServices
as part of the rollout messages.Closes #1010