mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
rebase: bump the github-dependencies group across 1 directory with 9 updates
Bumps the github-dependencies group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/IBM/keyprotect-go-client](https://github.com/IBM/keyprotect-go-client) | `0.12.2` | `0.14.1` | | [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) | `1.53.14` | `1.54.6` | | [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) | `1.28.1` | `1.29.1` | | [github.com/hashicorp/vault/api](https://github.com/hashicorp/vault) | `1.12.0` | `1.14.0` | | [github.com/kubernetes-csi/csi-lib-utils](https://github.com/kubernetes-csi/csi-lib-utils) | `0.17.0` | `0.18.1` | | [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) | `2.17.1` | `2.19.0` | | [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) | `1.18.0` | `1.19.1` | | [github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go) | `1.6.0` | `1.7.0` | Updates `github.com/IBM/keyprotect-go-client` from 0.12.2 to 0.14.1 - [Release notes](https://github.com/IBM/keyprotect-go-client/releases) - [Changelog](https://github.com/IBM/keyprotect-go-client/blob/master/CHANGELOG.md) - [Commits](https://github.com/IBM/keyprotect-go-client/compare/v0.12.2...v0.14.1) Updates `github.com/aws/aws-sdk-go` from 1.53.14 to 1.54.6 - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.53.14...v1.54.6) Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.28.1 to 1.29.1 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ecr/v1.28.1...service/s3/v1.29.1) Updates `github.com/hashicorp/vault/api` from 1.12.0 to 1.14.0 - [Release notes](https://github.com/hashicorp/vault/releases) - [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/vault/compare/v1.12.0...v1.14.0) Updates `github.com/kubernetes-csi/csi-lib-utils` from 0.17.0 to 0.18.1 - [Release notes](https://github.com/kubernetes-csi/csi-lib-utils/releases) - [Commits](https://github.com/kubernetes-csi/csi-lib-utils/compare/v0.17.0...v0.18.1) Updates `github.com/onsi/ginkgo/v2` from 2.17.1 to 2.19.0 - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.17.1...v2.19.0) Updates `github.com/onsi/gomega` from 1.32.0 to 1.33.1 - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.32.0...v1.33.1) Updates `github.com/prometheus/client_golang` from 1.18.0 to 1.19.1 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.18.0...v1.19.1) Updates `github.com/Azure/azure-sdk-for-go/sdk/azidentity` from 1.6.0 to 1.7.0 - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md) - [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/azcore/v1.6.0...sdk/azcore/v1.7.0) --- updated-dependencies: - dependency-name: github.com/IBM/keyprotect-go-client dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/hashicorp/vault/api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/kubernetes-csi/csi-lib-utils dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azidentity dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
29dde7abc2
commit
171ba6a65d
17
vendor/github.com/hashicorp/vault/api/lifetime_watcher.go
generated
vendored
17
vendor/github.com/hashicorp/vault/api/lifetime_watcher.go
generated
vendored
@ -6,6 +6,7 @@ package api
|
||||
import (
|
||||
"errors"
|
||||
"math/rand"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -31,6 +32,7 @@ var (
|
||||
DefaultRenewerRenewBuffer = 5
|
||||
)
|
||||
|
||||
//go:generate enumer -type=RenewBehavior -trimprefix=RenewBehavior
|
||||
type RenewBehavior uint
|
||||
|
||||
const (
|
||||
@ -288,12 +290,18 @@ func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool,
|
||||
switch {
|
||||
case nonRenewable || r.renewBehavior == RenewBehaviorRenewDisabled:
|
||||
// Can't or won't renew, just keep the same expiration so we exit
|
||||
// when it's reauthentication time
|
||||
// when it's re-authentication time
|
||||
remainingLeaseDuration = fallbackLeaseDuration
|
||||
|
||||
default:
|
||||
// Renew the token
|
||||
renewal, err = renew(credString, r.increment)
|
||||
if err != nil && strings.Contains(err.Error(), "permission denied") {
|
||||
// We can't renew since the token doesn't have permission to. Fall back
|
||||
// to the code path for non-renewable tokens.
|
||||
nonRenewable = true
|
||||
continue
|
||||
}
|
||||
if err != nil || renewal == nil || (tokenMode && renewal.Auth == nil) {
|
||||
if r.renewBehavior == RenewBehaviorErrorOnErrors {
|
||||
if err != nil {
|
||||
@ -349,8 +357,11 @@ func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool,
|
||||
|
||||
if errorBackoff == nil {
|
||||
sleepDuration = r.calculateSleepDuration(remainingLeaseDuration, priorDuration)
|
||||
} else if errorBackoff.NextBackOff() == backoff.Stop {
|
||||
return err
|
||||
} else {
|
||||
sleepDuration = errorBackoff.NextBackOff()
|
||||
if sleepDuration == backoff.Stop {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// remainingLeaseDuration becomes the priorDuration for the next loop
|
||||
|
11
vendor/github.com/hashicorp/vault/api/plugin_helpers.go
generated
vendored
11
vendor/github.com/hashicorp/vault/api/plugin_helpers.go
generated
vendored
@ -13,8 +13,8 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
|
||||
"github.com/go-jose/go-jose/v3/jwt"
|
||||
|
||||
jose "github.com/go-jose/go-jose/v4"
|
||||
"github.com/go-jose/go-jose/v4/jwt"
|
||||
"github.com/hashicorp/errwrap"
|
||||
)
|
||||
|
||||
@ -41,6 +41,11 @@ const (
|
||||
// PluginUnwrapTokenEnv is the ENV name used to pass unwrap tokens to the
|
||||
// plugin.
|
||||
PluginUnwrapTokenEnv = "VAULT_UNWRAP_TOKEN"
|
||||
|
||||
// CubbyHoleJWTSignatureAlgorithm is the signature algorithm used for
|
||||
// the unwrap token that Vault passes to a plugin when auto-mTLS is
|
||||
// not enabled.
|
||||
CubbyHoleJWTSignatureAlgorithm = jose.ES512
|
||||
)
|
||||
|
||||
// PluginAPIClientMeta is a helper that plugins can use to configure TLS connections
|
||||
@ -103,7 +108,7 @@ func VaultPluginTLSProviderContext(ctx context.Context, apiTLSConfig *TLSConfig)
|
||||
return func() (*tls.Config, error) {
|
||||
unwrapToken := os.Getenv(PluginUnwrapTokenEnv)
|
||||
|
||||
parsedJWT, err := jwt.ParseSigned(unwrapToken)
|
||||
parsedJWT, err := jwt.ParseSigned(unwrapToken, []jose.SignatureAlgorithm{CubbyHoleJWTSignatureAlgorithm})
|
||||
if err != nil {
|
||||
return nil, errwrap.Wrapf("error parsing wrapping token: {{err}}", err)
|
||||
}
|
||||
|
23
vendor/github.com/hashicorp/vault/api/plugin_runtime_types.go
generated
vendored
23
vendor/github.com/hashicorp/vault/api/plugin_runtime_types.go
generated
vendored
@ -9,11 +9,9 @@ package api
|
||||
|
||||
import "fmt"
|
||||
|
||||
var PluginRuntimeTypes = []PluginRuntimeType{
|
||||
PluginRuntimeTypeUnsupported,
|
||||
PluginRuntimeTypeContainer,
|
||||
}
|
||||
var PluginRuntimeTypes = _PluginRuntimeTypeValues
|
||||
|
||||
//go:generate enumer -type=PluginRuntimeType -trimprefix=PluginRuntimeType -transform=snake
|
||||
type PluginRuntimeType uint32
|
||||
|
||||
// This is a list of PluginRuntimeTypes used by Vault.
|
||||
@ -22,20 +20,11 @@ const (
|
||||
PluginRuntimeTypeContainer
|
||||
)
|
||||
|
||||
func (r PluginRuntimeType) String() string {
|
||||
switch r {
|
||||
case PluginRuntimeTypeContainer:
|
||||
return "container"
|
||||
default:
|
||||
return "unsupported"
|
||||
}
|
||||
}
|
||||
|
||||
// ParsePluginRuntimeType is a wrapper around PluginRuntimeTypeString kept for backwards compatibility.
|
||||
func ParsePluginRuntimeType(PluginRuntimeType string) (PluginRuntimeType, error) {
|
||||
switch PluginRuntimeType {
|
||||
case "container":
|
||||
return PluginRuntimeTypeContainer, nil
|
||||
default:
|
||||
t, err := PluginRuntimeTypeString(PluginRuntimeType)
|
||||
if err != nil {
|
||||
return PluginRuntimeTypeUnsupported, fmt.Errorf("%q is not a supported plugin runtime type", PluginRuntimeType)
|
||||
}
|
||||
return t, nil
|
||||
}
|
||||
|
49
vendor/github.com/hashicorp/vault/api/pluginruntimetype_enumer.go
generated
vendored
Normal file
49
vendor/github.com/hashicorp/vault/api/pluginruntimetype_enumer.go
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
// Code generated by "enumer -type=PluginRuntimeType -trimprefix=PluginRuntimeType -transform=snake"; DO NOT EDIT.
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const _PluginRuntimeTypeName = "unsupportedcontainer"
|
||||
|
||||
var _PluginRuntimeTypeIndex = [...]uint8{0, 11, 20}
|
||||
|
||||
func (i PluginRuntimeType) String() string {
|
||||
if i >= PluginRuntimeType(len(_PluginRuntimeTypeIndex)-1) {
|
||||
return fmt.Sprintf("PluginRuntimeType(%d)", i)
|
||||
}
|
||||
return _PluginRuntimeTypeName[_PluginRuntimeTypeIndex[i]:_PluginRuntimeTypeIndex[i+1]]
|
||||
}
|
||||
|
||||
var _PluginRuntimeTypeValues = []PluginRuntimeType{0, 1}
|
||||
|
||||
var _PluginRuntimeTypeNameToValueMap = map[string]PluginRuntimeType{
|
||||
_PluginRuntimeTypeName[0:11]: 0,
|
||||
_PluginRuntimeTypeName[11:20]: 1,
|
||||
}
|
||||
|
||||
// PluginRuntimeTypeString retrieves an enum value from the enum constants string name.
|
||||
// Throws an error if the param is not part of the enum.
|
||||
func PluginRuntimeTypeString(s string) (PluginRuntimeType, error) {
|
||||
if val, ok := _PluginRuntimeTypeNameToValueMap[s]; ok {
|
||||
return val, nil
|
||||
}
|
||||
return 0, fmt.Errorf("%s does not belong to PluginRuntimeType values", s)
|
||||
}
|
||||
|
||||
// PluginRuntimeTypeValues returns all values of the enum
|
||||
func PluginRuntimeTypeValues() []PluginRuntimeType {
|
||||
return _PluginRuntimeTypeValues
|
||||
}
|
||||
|
||||
// IsAPluginRuntimeType returns "true" if the value is listed in the enum definition. "false" otherwise
|
||||
func (i PluginRuntimeType) IsAPluginRuntimeType() bool {
|
||||
for _, v := range _PluginRuntimeTypeValues {
|
||||
if i == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
50
vendor/github.com/hashicorp/vault/api/renewbehavior_enumer.go
generated
vendored
Normal file
50
vendor/github.com/hashicorp/vault/api/renewbehavior_enumer.go
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
// Code generated by "enumer -type=RenewBehavior -trimprefix=RenewBehavior"; DO NOT EDIT.
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const _RenewBehaviorName = "IgnoreErrorsRenewDisabledErrorOnErrors"
|
||||
|
||||
var _RenewBehaviorIndex = [...]uint8{0, 12, 25, 38}
|
||||
|
||||
func (i RenewBehavior) String() string {
|
||||
if i >= RenewBehavior(len(_RenewBehaviorIndex)-1) {
|
||||
return fmt.Sprintf("RenewBehavior(%d)", i)
|
||||
}
|
||||
return _RenewBehaviorName[_RenewBehaviorIndex[i]:_RenewBehaviorIndex[i+1]]
|
||||
}
|
||||
|
||||
var _RenewBehaviorValues = []RenewBehavior{0, 1, 2}
|
||||
|
||||
var _RenewBehaviorNameToValueMap = map[string]RenewBehavior{
|
||||
_RenewBehaviorName[0:12]: 0,
|
||||
_RenewBehaviorName[12:25]: 1,
|
||||
_RenewBehaviorName[25:38]: 2,
|
||||
}
|
||||
|
||||
// RenewBehaviorString retrieves an enum value from the enum constants string name.
|
||||
// Throws an error if the param is not part of the enum.
|
||||
func RenewBehaviorString(s string) (RenewBehavior, error) {
|
||||
if val, ok := _RenewBehaviorNameToValueMap[s]; ok {
|
||||
return val, nil
|
||||
}
|
||||
return 0, fmt.Errorf("%s does not belong to RenewBehavior values", s)
|
||||
}
|
||||
|
||||
// RenewBehaviorValues returns all values of the enum
|
||||
func RenewBehaviorValues() []RenewBehavior {
|
||||
return _RenewBehaviorValues
|
||||
}
|
||||
|
||||
// IsARenewBehavior returns "true" if the value is listed in the enum definition. "false" otherwise
|
||||
func (i RenewBehavior) IsARenewBehavior() bool {
|
||||
for _, v := range _RenewBehaviorValues {
|
||||
if i == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
15
vendor/github.com/hashicorp/vault/api/replication_status.go
generated
vendored
15
vendor/github.com/hashicorp/vault/api/replication_status.go
generated
vendored
@ -19,13 +19,14 @@ const (
|
||||
)
|
||||
|
||||
type ClusterInfo struct {
|
||||
APIAddr string `json:"api_address,omitempty" mapstructure:"api_address"`
|
||||
ClusterAddress string `json:"cluster_address,omitempty" mapstructure:"cluster_address"`
|
||||
ConnectionStatus string `json:"connection_status,omitempty" mapstructure:"connection_status"`
|
||||
LastHeartBeat string `json:"last_heartbeat,omitempty" mapstructure:"last_heartbeat"`
|
||||
LastHeartBeatDurationMillis string `json:"last_heartbeat_duration_ms,omitempty" mapstructure:"last_heartbeat_duration_ms"`
|
||||
ClockSkewMillis string `json:"clock_skew_ms,omitempty" mapstructure:"clock_skew_ms"`
|
||||
NodeID string `json:"node_id,omitempty" mapstructure:"node_id"`
|
||||
APIAddr string `json:"api_address,omitempty" mapstructure:"api_address"`
|
||||
ClusterAddress string `json:"cluster_address,omitempty" mapstructure:"cluster_address"`
|
||||
ConnectionStatus string `json:"connection_status,omitempty" mapstructure:"connection_status"`
|
||||
LastHeartBeat string `json:"last_heartbeat,omitempty" mapstructure:"last_heartbeat"`
|
||||
LastHeartBeatDurationMillis string `json:"last_heartbeat_duration_ms,omitempty" mapstructure:"last_heartbeat_duration_ms"`
|
||||
ClockSkewMillis string `json:"clock_skew_ms,omitempty" mapstructure:"clock_skew_ms"`
|
||||
NodeID string `json:"node_id,omitempty" mapstructure:"node_id"`
|
||||
ReplicationPrimaryCanaryAgeMillis string `json:"replication_primary_canary_age_ms,omitempty" mapstructure:"replication_primary_canary_age_ms"`
|
||||
}
|
||||
|
||||
type ReplicationStatusGenericResponse struct {
|
||||
|
35
vendor/github.com/hashicorp/vault/api/sys_auth.go
generated
vendored
35
vendor/github.com/hashicorp/vault/api/sys_auth.go
generated
vendored
@ -12,6 +12,41 @@ import (
|
||||
"github.com/mitchellh/mapstructure"
|
||||
)
|
||||
|
||||
func (c *Sys) GetAuth(path string) (*AuthMount, error) {
|
||||
return c.GetAuthWithContext(context.Background(), path)
|
||||
}
|
||||
|
||||
func (c *Sys) GetAuthWithContext(ctx context.Context, path string) (*AuthMount, error) {
|
||||
ctx, cancelFunc := c.c.withConfiguredTimeout(ctx)
|
||||
defer cancelFunc()
|
||||
|
||||
// use `sys/mounts/auth/:path` so we don't require sudo permissions
|
||||
// historically, `sys/auth` doesn't require sudo, so we don't require it here either
|
||||
r := c.c.NewRequest(http.MethodGet, fmt.Sprintf("/v1/sys/mounts/auth/%s", path))
|
||||
|
||||
resp, err := c.c.rawRequestWithContext(ctx, r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
secret, err := ParseSecret(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if secret == nil || secret.Data == nil {
|
||||
return nil, errors.New("data from server response is empty")
|
||||
}
|
||||
|
||||
mount := AuthMount{}
|
||||
err = mapstructure.Decode(secret.Data, &mount)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &mount, nil
|
||||
}
|
||||
|
||||
func (c *Sys) ListAuth() (map[string]*AuthMount, error) {
|
||||
return c.ListAuthWithContext(context.Background())
|
||||
}
|
||||
|
21
vendor/github.com/hashicorp/vault/api/sys_hastatus.go
generated
vendored
21
vendor/github.com/hashicorp/vault/api/sys_hastatus.go
generated
vendored
@ -35,14 +35,15 @@ type HAStatusResponse struct {
|
||||
}
|
||||
|
||||
type HANode struct {
|
||||
Hostname string `json:"hostname"`
|
||||
APIAddress string `json:"api_address"`
|
||||
ClusterAddress string `json:"cluster_address"`
|
||||
ActiveNode bool `json:"active_node"`
|
||||
LastEcho *time.Time `json:"last_echo"`
|
||||
EchoDurationMillis int64 `json:"echo_duration_ms"`
|
||||
ClockSkewMillis int64 `json:"clock_skew_ms"`
|
||||
Version string `json:"version"`
|
||||
UpgradeVersion string `json:"upgrade_version,omitempty"`
|
||||
RedundancyZone string `json:"redundancy_zone,omitempty"`
|
||||
Hostname string `json:"hostname"`
|
||||
APIAddress string `json:"api_address"`
|
||||
ClusterAddress string `json:"cluster_address"`
|
||||
ActiveNode bool `json:"active_node"`
|
||||
LastEcho *time.Time `json:"last_echo"`
|
||||
EchoDurationMillis int64 `json:"echo_duration_ms"`
|
||||
ClockSkewMillis int64 `json:"clock_skew_ms"`
|
||||
Version string `json:"version"`
|
||||
UpgradeVersion string `json:"upgrade_version,omitempty"`
|
||||
RedundancyZone string `json:"redundancy_zone,omitempty"`
|
||||
ReplicationPrimaryCanaryAgeMillis int64 `json:"replication_primary_canary_age_ms"`
|
||||
}
|
||||
|
29
vendor/github.com/hashicorp/vault/api/sys_health.go
generated
vendored
29
vendor/github.com/hashicorp/vault/api/sys_health.go
generated
vendored
@ -38,18 +38,19 @@ func (c *Sys) HealthWithContext(ctx context.Context) (*HealthResponse, error) {
|
||||
}
|
||||
|
||||
type HealthResponse struct {
|
||||
Initialized bool `json:"initialized"`
|
||||
Sealed bool `json:"sealed"`
|
||||
Standby bool `json:"standby"`
|
||||
PerformanceStandby bool `json:"performance_standby"`
|
||||
ReplicationPerformanceMode string `json:"replication_performance_mode"`
|
||||
ReplicationDRMode string `json:"replication_dr_mode"`
|
||||
ServerTimeUTC int64 `json:"server_time_utc"`
|
||||
Version string `json:"version"`
|
||||
ClusterName string `json:"cluster_name,omitempty"`
|
||||
ClusterID string `json:"cluster_id,omitempty"`
|
||||
LastWAL uint64 `json:"last_wal,omitempty"`
|
||||
Enterprise bool `json:"enterprise"`
|
||||
EchoDurationMillis int64 `json:"echo_duration_ms"`
|
||||
ClockSkewMillis int64 `json:"clock_skew_ms"`
|
||||
Initialized bool `json:"initialized"`
|
||||
Sealed bool `json:"sealed"`
|
||||
Standby bool `json:"standby"`
|
||||
PerformanceStandby bool `json:"performance_standby"`
|
||||
ReplicationPerformanceMode string `json:"replication_performance_mode"`
|
||||
ReplicationDRMode string `json:"replication_dr_mode"`
|
||||
ServerTimeUTC int64 `json:"server_time_utc"`
|
||||
Version string `json:"version"`
|
||||
ClusterName string `json:"cluster_name,omitempty"`
|
||||
ClusterID string `json:"cluster_id,omitempty"`
|
||||
LastWAL uint64 `json:"last_wal,omitempty"`
|
||||
Enterprise bool `json:"enterprise"`
|
||||
EchoDurationMillis int64 `json:"echo_duration_ms"`
|
||||
ClockSkewMillis int64 `json:"clock_skew_ms"`
|
||||
ReplicationPrimaryCanaryAgeMillis int64 `json:"replication_primary_canary_age_ms"`
|
||||
}
|
||||
|
33
vendor/github.com/hashicorp/vault/api/sys_mounts.go
generated
vendored
33
vendor/github.com/hashicorp/vault/api/sys_mounts.go
generated
vendored
@ -13,6 +13,39 @@ import (
|
||||
"github.com/mitchellh/mapstructure"
|
||||
)
|
||||
|
||||
func (c *Sys) GetMount(path string) (*MountOutput, error) {
|
||||
return c.GetMountWithContext(context.Background(), path)
|
||||
}
|
||||
|
||||
func (c *Sys) GetMountWithContext(ctx context.Context, path string) (*MountOutput, error) {
|
||||
ctx, cancelFunc := c.c.withConfiguredTimeout(ctx)
|
||||
defer cancelFunc()
|
||||
|
||||
r := c.c.NewRequest(http.MethodGet, fmt.Sprintf("/v1/sys/mounts/%s", path))
|
||||
|
||||
resp, err := c.c.rawRequestWithContext(ctx, r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
secret, err := ParseSecret(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if secret == nil || secret.Data == nil {
|
||||
return nil, errors.New("data from server response is empty")
|
||||
}
|
||||
|
||||
mount := MountOutput{}
|
||||
err = mapstructure.Decode(secret.Data, &mount)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &mount, nil
|
||||
}
|
||||
|
||||
func (c *Sys) ListMounts() (map[string]*MountOutput, error) {
|
||||
return c.ListMountsWithContext(context.Background())
|
||||
}
|
||||
|
43
vendor/github.com/hashicorp/vault/api/sys_raft.go
generated
vendored
43
vendor/github.com/hashicorp/vault/api/sys_raft.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
@ -100,6 +101,23 @@ type AutopilotState struct {
|
||||
OptimisticFailureTolerance int `mapstructure:"optimistic_failure_tolerance,omitempty"`
|
||||
}
|
||||
|
||||
func (a *AutopilotState) String() string {
|
||||
var result string
|
||||
result += fmt.Sprintf("Healthy: %t. FailureTolerance: %d. Leader: %s. OptimisticFailureTolerance: %d\n", a.Healthy, a.FailureTolerance, a.Leader, a.OptimisticFailureTolerance)
|
||||
for _, s := range a.Servers {
|
||||
result += fmt.Sprintf("Server: %s\n", s)
|
||||
}
|
||||
result += fmt.Sprintf("Voters: %v\n", a.Voters)
|
||||
result += fmt.Sprintf("NonVoters: %v\n", a.NonVoters)
|
||||
|
||||
for name, zone := range a.RedundancyZones {
|
||||
result += fmt.Sprintf("RedundancyZone %s: %s\n", name, &zone)
|
||||
}
|
||||
|
||||
result += fmt.Sprintf("Upgrade: %s", a.Upgrade)
|
||||
return result
|
||||
}
|
||||
|
||||
// AutopilotServer represents the server blocks in the response of the raft
|
||||
// autopilot state API.
|
||||
type AutopilotServer struct {
|
||||
@ -119,12 +137,21 @@ type AutopilotServer struct {
|
||||
NodeType string `mapstructure:"node_type,omitempty"`
|
||||
}
|
||||
|
||||
func (a *AutopilotServer) String() string {
|
||||
return fmt.Sprintf("ID: %s. Name: %s. Address: %s. NodeStatus: %s. LastContact: %s. LastTerm: %d. LastIndex: %d. Healthy: %t. StableSince: %s. Status: %s. Version: %s. UpgradeVersion: %s. RedundancyZone: %s. NodeType: %s",
|
||||
a.ID, a.Name, a.Address, a.NodeStatus, a.LastContact, a.LastTerm, a.LastIndex, a.Healthy, a.StableSince, a.Status, a.Version, a.UpgradeVersion, a.RedundancyZone, a.NodeType)
|
||||
}
|
||||
|
||||
type AutopilotZone struct {
|
||||
Servers []string `mapstructure:"servers,omitempty"`
|
||||
Voters []string `mapstructure:"voters,omitempty"`
|
||||
FailureTolerance int `mapstructure:"failure_tolerance,omitempty"`
|
||||
}
|
||||
|
||||
func (a *AutopilotZone) String() string {
|
||||
return fmt.Sprintf("Servers: %v. Voters: %v. FailureTolerance: %d", a.Servers, a.Voters, a.FailureTolerance)
|
||||
}
|
||||
|
||||
type AutopilotUpgrade struct {
|
||||
Status string `mapstructure:"status"`
|
||||
TargetVersion string `mapstructure:"target_version,omitempty"`
|
||||
@ -137,6 +164,17 @@ type AutopilotUpgrade struct {
|
||||
RedundancyZones map[string]AutopilotZoneUpgradeVersions `mapstructure:"redundancy_zones,omitempty"`
|
||||
}
|
||||
|
||||
func (a *AutopilotUpgrade) String() string {
|
||||
result := fmt.Sprintf("Status: %s. TargetVersion: %s. TargetVersionVoters: %v. TargetVersionNonVoters: %v. TargetVersionReadReplicas: %v. OtherVersionVoters: %v. OtherVersionNonVoters: %v. OtherVersionReadReplicas: %v",
|
||||
a.Status, a.TargetVersion, a.TargetVersionVoters, a.TargetVersionNonVoters, a.TargetVersionReadReplicas, a.OtherVersionVoters, a.OtherVersionNonVoters, a.OtherVersionReadReplicas)
|
||||
|
||||
for name, zone := range a.RedundancyZones {
|
||||
result += fmt.Sprintf("Redundancy Zone %s: %s", name, zone)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
type AutopilotZoneUpgradeVersions struct {
|
||||
TargetVersionVoters []string `mapstructure:"target_version_voters,omitempty"`
|
||||
TargetVersionNonVoters []string `mapstructure:"target_version_non_voters,omitempty"`
|
||||
@ -144,6 +182,11 @@ type AutopilotZoneUpgradeVersions struct {
|
||||
OtherVersionNonVoters []string `mapstructure:"other_version_non_voters,omitempty"`
|
||||
}
|
||||
|
||||
func (a *AutopilotZoneUpgradeVersions) String() string {
|
||||
return fmt.Sprintf("TargetVersionVoters: %v. TargetVersionNonVoters: %v. OtherVersionVoters: %v. OtherVersionNonVoters: %v",
|
||||
a.TargetVersionVoters, a.TargetVersionNonVoters, a.OtherVersionVoters, a.OtherVersionNonVoters)
|
||||
}
|
||||
|
||||
// RaftJoin wraps RaftJoinWithContext using context.Background.
|
||||
func (c *Sys) RaftJoin(opts *RaftJoinRequest) (*RaftJoinResponse, error) {
|
||||
return c.RaftJoinWithContext(context.Background(), opts)
|
||||
|
Reference in New Issue
Block a user