Skip to content

Commit

Permalink
[Fleet] Support agent privilages root
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Nov 2, 2023
1 parent 71374b4 commit ce7e4db
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/datastream.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type DataStream struct {
Streams []Stream `config:"streams" json:"streams,omitempty" yaml:"streams,omitempty" `
Package string `json:"package,omitempty" yaml:"package,omitempty"`
Elasticsearch *DataStreamElasticsearch `config:"elasticsearch,omitempty" json:"elasticsearch,omitempty" yaml:"elasticsearch,omitempty"`
Agent *DataStreamAgent `config:"agent,omitempty" json:"agent,omitempty" yaml:"agent,omitempty"`

// Generated fields
Path string `json:"path,omitempty" yaml:"path,omitempty"`
Expand Down Expand Up @@ -94,6 +95,14 @@ type Variable struct {
Default interface{} `config:"default" json:"default,omitempty" yaml:"default,omitempty"`
}

type DataStreamAgent struct {
Privileges *DataStreamAgentPrivileges `config:"privileges,omitempty" json:"privileges,omitempty" yaml:"privileges,omitempty"`
}

type DataStreamAgentPrivileges struct {
Root bool `config:"root,omitempty" json:"root,omitempty" yaml:"root,omitempty"`
}

type DataStreamElasticsearch struct {
IndexTemplateSettings map[string]interface{} `config:"index_template.settings" json:"index_template.settings,omitempty" yaml:"index_template.settings,omitempty"`
IndexTemplateMappings map[string]interface{} `config:"index_template.mappings" json:"index_template.mappings,omitempty" yaml:"index_template.mappings,omitempty"`
Expand Down
9 changes: 9 additions & 0 deletions packages/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Package struct {
DataStreams []*DataStream `config:"data_streams,omitempty" json:"data_streams,omitempty" yaml:"data_streams,omitempty"`
Vars []Variable `config:"vars" json:"vars,omitempty" yaml:"vars,omitempty"`
Elasticsearch *PackageElasticsearch `config:"elasticsearch,omitempty" json:"elasticsearch,omitempty" yaml:"elasticsearch,omitempty"`
Agent *PackageAgent `config:"agent,omitempty" json:"agent,omitempty" yaml:"agent,omitempty"`
// Local path to the package dir
BasePath string `json:"-" yaml:"-"`

Expand Down Expand Up @@ -146,6 +147,14 @@ type Image struct {
Type string `config:"type" json:"type,omitempty"`
}

type PackageAgent struct {
Privileges *PackageAgentPrivileges `config:"privileges,omitempty" json:"privileges,omitempty" yaml:"privileges,omitempty"`
}

type PackageAgentPrivileges struct {
Root bool `config:"root,omitempty" json:"root,omitempty" yaml:"root,omitempty"`
}

type PackageElasticsearch struct {
Privileges *PackageElasticsearchPrivileges `config:"privileges,omitempty" json:"privileges,omitempty" yaml:"privileges,omitempty"`
}
Expand Down

0 comments on commit ce7e4db

Please sign in to comment.