Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added "allow_reauth" config option for openstack client #11572

Merged
merged 4 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plugins/inputs/openstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ your requirements. This will help with load and cardinality as well.
username = "admin"
password = "password"

## AllowReauth should be set to true if you grant permission for Gophercloud to
## cache your credentials in memory, and to allow Gophercloud to attempt to
## re-authenticate automatically if/when your token expires. If you set it to
## false, it will not cache these settings, but re-authentication will not be
## possible. This setting defaults to false.
# allow_reauth = false

singamSrikar marked this conversation as resolved.
Show resolved Hide resolved
## Available services are:
## "agents", "aggregates", "flavors", "hypervisors", "networks", "nova_services",
## "ports", "projects", "servers", "services", "stacks", "storage_pools", "subnets", "volumes"
Expand Down
2 changes: 2 additions & 0 deletions plugins/inputs/openstack/openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ type OpenStack struct {
TagValue string `toml:"tag_value"`
HumanReadableTS bool `toml:"human_readable_timestamps"`
MeasureRequest bool `toml:"measure_openstack_requests"`
AllowReauth bool `toml:"allow_reauth"`
Log telegraf.Logger `toml:"-"`
httpconfig.HTTPClientConfig

Expand Down Expand Up @@ -141,6 +142,7 @@ func (o *OpenStack) Init() error {
TenantName: o.Project,
Username: o.Username,
Password: o.Password,
AllowReauth: o.AllowReauth,
}
provider, err := openstack.NewClient(authOption.IdentityEndpoint)
if err != nil {
Expand Down
7 changes: 7 additions & 0 deletions plugins/inputs/openstack/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
username = "admin"
password = "password"

## AllowReauth should be set to true if you grant permission for Gophercloud to
## cache your credentials in memory, and to allow Gophercloud to attempt to
## re-authenticate automatically if/when your token expires. If you set it to
## false, it will not cache these settings, but re-authentication will not be
## possible. This setting defaults to false.
# allow_reauth = false

## Available services are:
## "agents", "aggregates", "flavors", "hypervisors", "networks", "nova_services",
## "ports", "projects", "servers", "services", "stacks", "storage_pools", "subnets", "volumes"
Expand Down