Skip to content

Commit

Permalink
Add update_url column to orbit_info (#25532)
Browse files Browse the repository at this point in the history
Adding new column to ease TUF migration QA and deployment.

![Screenshot 2025-01-17 at 8 24
56 AM](https://github.com/user-attachments/assets/3565fa4c-4bb4-4218-8122-5f3402e02d99)
  • Loading branch information
lucasmrod authored Jan 17, 2025
1 parent 732f46c commit 88a5804
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions orbit/cmd/orbit/orbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,7 @@ func main() {
trw,
startTime,
scriptsEnabledFn,
opt.ServerURL,
)),
)

Expand Down
5 changes: 5 additions & 0 deletions orbit/pkg/table/orbit_info/orbit_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ type Extension struct {
dektopVersion string
trw *token.ReadWriter
scriptsEnabled func() bool
updateURL string
}

var _ orbit_table.Extension = (*Extension)(nil)

func New(
orbitClient *service.OrbitClient, orbitChannel, osquerydChannel, desktopChannel string, desktopVersion string, trw *token.ReadWriter,
startTime time.Time, scriptsEnabled func() bool,
updateURL string,
) *Extension {
return &Extension{
startTime: startTime,
Expand All @@ -39,6 +41,7 @@ func New(
dektopVersion: desktopVersion,
trw: trw,
scriptsEnabled: scriptsEnabled,
updateURL: updateURL,
}
}

Expand All @@ -60,6 +63,7 @@ func (o Extension) Columns() []table.ColumnDefinition {
table.TextColumn("desktop_version"),
table.BigIntColumn("uptime"),
table.IntegerColumn("scripts_enabled"),
table.TextColumn("update_url"),
}
}

Expand Down Expand Up @@ -104,5 +108,6 @@ func (o Extension) GenerateFunc(_ context.Context, _ table.QueryContext) ([]map[
"desktop_version": o.dektopVersion,
"uptime": strconv.FormatInt(int64(time.Since(o.startTime).Seconds()), 10),
"scripts_enabled": strconv.FormatInt(boolToInt(o.scriptsEnabled()), 10),
"update_url": o.updateURL,
}}, nil
}
6 changes: 6 additions & 0 deletions schema/osquery_fleet_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17870,6 +17870,12 @@
"type": "integer",
"required": false,
"description": "1 if running scripts is enabled, 0 if disabled."
},
{
"name": "update_url",
"type": "text",
"required": false,
"description": "The Update Framework server URL."
}
],
"notes": "This table is not a core osquery table. It is included as part of Fleet's agent ([fleetd](https://fleetdm.com/docs/get-started/anatomy#fleetd)).",
Expand Down
4 changes: 4 additions & 0 deletions schema/tables/orbit_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ columns:
type: integer
required: false
description: 1 if running scripts is enabled, 0 if disabled.
- name: update_url
type: text
required: false
description: The Update Framework server URL.
notes: This table is not a core osquery table. It is included as part of Fleet's agent ([fleetd](https://fleetdm.com/docs/get-started/anatomy#fleetd)).
evented: false

0 comments on commit 88a5804

Please sign in to comment.