Skip to content

Commit

Permalink
Merge branch 'main' into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Sep 18, 2024
1 parent e4f2cfc commit 7e51659
Show file tree
Hide file tree
Showing 18 changed files with 811 additions and 638 deletions.
2 changes: 1 addition & 1 deletion agent/agents/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (p *Process) toWaiting() {
// FAILING -> DONE.
func (p *Process) toFailing(err error) {
p.l.Tracef("Process: failing")
p.changes <- inventorypb.AgentStatus_INITIALIZATION_ERROR
p.changes <- inventoryv1.AgentStatus_AGENT_STATUS_INITIALIZATION_ERROR
p.l.Infof("Process: exited: %s.", p.cmd.ProcessState)
go p.toDone()
p.err = err
Expand Down
6 changes: 3 additions & 3 deletions agent/agents/process/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestProcess(t *testing.T) {
go p.Run(ctx)

assertStates(t, p, inventoryv1.AgentStatus_AGENT_STATUS_STARTING, inventoryv1.AgentStatus_AGENT_STATUS_INITIALIZATION_ERROR,
inventoryv1.AgentStatus_AGENT_STATUS_DONE, inventoryv1.AgentStatus_AGENT_STATUS_INVALID)
inventoryv1.AgentStatus_AGENT_STATUS_DONE, inventoryv1.AgentStatus_AGENT_STATUS_UNSPECIFIED)
})

t.Run("ExitedEarly", func(t *testing.T) {
Expand All @@ -94,8 +94,8 @@ func TestProcess(t *testing.T) {
p := New(&Params{Path: "sleep", Args: []string{sleep}}, nil, l)
go p.Run(ctx)

assertStates(t, p, inventoryv1.AgentStatus_STARTING, inventoryv1.AgentStatus_INITIALIZATION_ERROR,
inventoryv1.AgentStatus_DONE, inventoryv1.AgentStatus_AGENT_STATUS_INVALID)
assertStates(t, p, inventoryv1.AgentStatus_AGENT_STATUS_STARTING, inventoryv1.AgentStatus_AGENT_STATUS_INITIALIZATION_ERROR,
inventoryv1.AgentStatus_AGENT_STATUS_DONE, inventoryv1.AgentStatus_AGENT_STATUS_UNSPECIFIED)
})

t.Run("Exited", func(t *testing.T) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/agentlocal/v1/json/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@
"x-order": 4
},
"status": {
"description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent finished.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.",
"description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent finished.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.",
"type": "string",
"default": "AGENT_STATUS_UNSPECIFIED",
"enum": [
"AGENT_STATUS_UNSPECIFIED",
"AGENT_STATUS_STARTING",
"INITIALIZATION_ERROR",
"AGENT_STATUS_INITIALIZATION_ERROR",
"AGENT_STATUS_RUNNING",
"AGENT_STATUS_WAITING",
"AGENT_STATUS_STOPPING",
Expand Down Expand Up @@ -344,13 +344,13 @@
"x-order": 4
},
"status": {
"description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent finished.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.",
"description": "AgentStatus represents actual Agent status.\n\n - AGENT_STATUS_STARTING: Agent is starting.\n - AGENT_STATUS_INITIALIZATION_ERROR: Agent encountered error when starting.\n - AGENT_STATUS_RUNNING: Agent is running.\n - AGENT_STATUS_WAITING: Agent encountered error and will be restarted automatically soon.\n - AGENT_STATUS_STOPPING: Agent is stopping.\n - AGENT_STATUS_DONE: Agent finished.\n - AGENT_STATUS_UNKNOWN: Agent is not connected, we don't know anything about it's state.",
"type": "string",
"default": "AGENT_STATUS_UNSPECIFIED",
"enum": [
"AGENT_STATUS_UNSPECIFIED",
"AGENT_STATUS_STARTING",
"INITIALIZATION_ERROR",
"AGENT_STATUS_INITIALIZATION_ERROR",
"AGENT_STATUS_RUNNING",
"AGENT_STATUS_WAITING",
"AGENT_STATUS_STOPPING",
Expand Down
Binary file modified api/descriptor.bin
Binary file not shown.
83 changes: 45 additions & 38 deletions api/inventory/v1/agent_status.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions api/inventory/v1/agent_status.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ enum AgentStatus {
// Agent is starting.
AGENT_STATUS_STARTING = 1;
// Agent encountered error when starting.
INITIALIZATION_ERROR = 7;
AGENT_STATUS_INITIALIZATION_ERROR = 2;
// Agent is running.
AGENT_STATUS_RUNNING = 2;
AGENT_STATUS_RUNNING = 3;
// Agent encountered error and will be restarted automatically soon.
AGENT_STATUS_WAITING = 3;
AGENT_STATUS_WAITING = 4;
// Agent is stopping.
AGENT_STATUS_STOPPING = 4;
AGENT_STATUS_STOPPING = 5;
// Agent finished.
AGENT_STATUS_DONE = 5;
AGENT_STATUS_DONE = 6;
// Agent is not connected, we don't know anything about it's state.
AGENT_STATUS_UNKNOWN = 6;
AGENT_STATUS_UNKNOWN = 7;
}
Loading

0 comments on commit 7e51659

Please sign in to comment.