Documentation ¶
Index ¶
- Variables
- func KubeConfig(context *Context) clientcmd.ClientConfig
- func RawKubeConfig() (api.Config, error)
- func WritePachTokenToConfig(token string, enterpriseContext bool) error
- func WritePachTokenToConfigPath(token string, path string, enterpriseContext bool) error
- type Config
- func (c *Config) ActiveContext(errorOnNoActive bool) (string, *Context, error)
- func (c *Config) ActiveEnterpriseContext(errorOnNoActive bool) (string, *Context, error)
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetUserId() string
- func (x *Config) GetV1() *ConfigV1
- func (x *Config) GetV2() *ConfigV2
- func (c *Config) InitV2() error
- func (x *Config) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- func (m *Config) Validate() error
- func (m *Config) ValidateAll() error
- func (c *Config) Write() error
- type ConfigMultiError
- type ConfigV1
- func (*ConfigV1) Descriptor() ([]byte, []int)deprecated
- func (x *ConfigV1) GetActiveTransaction() string
- func (x *ConfigV1) GetPachdAddress() string
- func (x *ConfigV1) GetServerCas() string
- func (x *ConfigV1) GetSessionToken() string
- func (x *ConfigV1) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (*ConfigV1) ProtoMessage()
- func (x *ConfigV1) ProtoReflect() protoreflect.Message
- func (x *ConfigV1) Reset()
- func (x *ConfigV1) String() string
- func (m *ConfigV1) Validate() error
- func (m *ConfigV1) ValidateAll() error
- type ConfigV1MultiError
- type ConfigV1ValidationError
- type ConfigV2
- func (*ConfigV2) Descriptor() ([]byte, []int)deprecated
- func (x *ConfigV2) GetActiveContext() string
- func (x *ConfigV2) GetActiveEnterpriseContext() string
- func (x *ConfigV2) GetContexts() map[string]*Context
- func (x *ConfigV2) GetMaxShellCompletions() int64
- func (x *ConfigV2) GetMetrics() bool
- func (x *ConfigV2) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (*ConfigV2) ProtoMessage()
- func (x *ConfigV2) ProtoReflect() protoreflect.Message
- func (x *ConfigV2) Reset()
- func (x *ConfigV2) String() string
- func (m *ConfigV2) Validate() error
- func (m *ConfigV2) ValidateAll() error
- type ConfigV2MultiError
- type ConfigV2ValidationError
- type ConfigValidationError
- type Context
- func (*Context) Descriptor() ([]byte, []int)deprecated
- func (x *Context) GetActiveTransaction() string
- func (x *Context) GetAuthInfo() string
- func (x *Context) GetClusterDeploymentId() string
- func (x *Context) GetClusterName() string
- func (x *Context) GetEnterpriseServer() bool
- func (x *Context) GetNamespace() string
- func (x *Context) GetPachdAddress() string
- func (x *Context) GetPortForwarders() map[string]uint32
- func (x *Context) GetProject() string
- func (x *Context) GetServerCas() string
- func (x *Context) GetSessionToken() string
- func (x *Context) GetSource() ContextSource
- func (x *Context) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (*Context) ProtoMessage()
- func (x *Context) ProtoReflect() protoreflect.Message
- func (x *Context) Reset()
- func (x *Context) String() string
- func (m *Context) Validate() error
- func (m *Context) ValidateAll() error
- type ContextMultiError
- type ContextSource
- func (ContextSource) Descriptor() protoreflect.EnumDescriptor
- func (x ContextSource) Enum() *ContextSource
- func (ContextSource) EnumDescriptor() ([]byte, []int)deprecated
- func (x ContextSource) Number() protoreflect.EnumNumber
- func (x ContextSource) String() string
- func (ContextSource) Type() protoreflect.EnumType
- type ContextValidationError
Constants ¶
This section is empty.
Variables ¶
var ( ContextSource_name = map[int32]string{ 0: "NONE", 1: "CONFIG_V1", 2: "HUB", 3: "IMPORTED", } ContextSource_value = map[string]int32{ "NONE": 0, "CONFIG_V1": 1, "HUB": 2, "IMPORTED": 3, } )
Enum value maps for ContextSource.
var File_internal_config_config_proto protoreflect.FileDescriptor
Functions ¶
func KubeConfig ¶
func KubeConfig(context *Context) clientcmd.ClientConfig
KubeConfig gets the kubernetes config
func RawKubeConfig ¶
RawKubeConfig gets the "raw" kube config, e.g. without overrides
func WritePachTokenToConfig ¶
WritePachTokenToConfig sets the auth token for the current pachctl config. Used during tests to ensure we don't lose access to a cluster if a test fails.
Types ¶
type Config ¶
type Config struct { UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // Configuration options. Exactly one of these fields should be set // (depending on which version of the config is being used) V1 *ConfigV1 `protobuf:"bytes,2,opt,name=v1,proto3" json:"v1,omitempty"` V2 *ConfigV2 `protobuf:"bytes,3,opt,name=v2,proto3" json:"v2,omitempty"` // contains filtered or unexported fields }
Config specifies the pachyderm config that is read and interpreted by the pachctl command-line tool. Right now, this is stored at $HOME/.pachyderm/config.
Different versions of the pachyderm config are specified as subfields of this message (this allows us to make significant changes to the config structure without breaking existing users by defining a new config version).
These structures are stored in a JSON format, so it should be safe to modify fields as long as compatibility is ensured with previous versions.
func Read ¶
Read loads the Pachyderm config on this machine. If an existing configuration cannot be found, it sets up the defaults. Read returns a nil Config if and only if it returns a non-nil error.
func (*Config) ActiveContext ¶
ActiveContext gets the active context in the config
func (*Config) ActiveEnterpriseContext ¶
ActiveEnterpriseContext gets the active enterprise server context in the config. If no enterprise context is configured, this returns the active context.
func (*Config) Descriptor
deprecated
func (*Config) MarshalLogObject ¶
func (x *Config) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶ added in v2.7.0
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) Validate ¶ added in v2.8.0
Validate checks the field values on Config with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Config) ValidateAll ¶ added in v2.8.0
ValidateAll checks the field values on Config with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConfigMultiError, or nil if none found.
type ConfigMultiError ¶ added in v2.8.0
type ConfigMultiError []error
ConfigMultiError is an error wrapping multiple validation errors returned by Config.ValidateAll() if the designated constraints aren't met.
func (ConfigMultiError) AllErrors ¶ added in v2.8.0
func (m ConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfigMultiError) Error ¶ added in v2.8.0
func (m ConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfigV1 ¶
type ConfigV1 struct { // A host:port pointing pachd at a pachyderm cluster. PachdAddress string `protobuf:"bytes,1,opt,name=pachd_address,json=pachdAddress,proto3" json:"pachd_address,omitempty"` // Trusted root certificates (overrides installed certificates), formatted // as base64-encoded PEM ServerCas string `protobuf:"bytes,2,opt,name=server_cas,json=serverCas,proto3" json:"server_cas,omitempty"` // A secret token identifying the current pachctl user within their // pachyderm cluster. This is included in all RPCs sent by pachctl, and used // to determine if pachctl actions are authorized. SessionToken string `protobuf:"bytes,3,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` // The currently active transaction for batching together pachctl commands. // This can be set or cleared via many of the `pachctl * transaction` commands. // This is the ID of the transaction object stored in the pachyderm etcd. ActiveTransaction string `protobuf:"bytes,4,opt,name=active_transaction,json=activeTransaction,proto3" json:"active_transaction,omitempty"` // contains filtered or unexported fields }
ConfigV1 specifies v1 of the pachyderm config (June 30 2017 - June 2019)
func (*ConfigV1) Descriptor
deprecated
func (*ConfigV1) GetActiveTransaction ¶
func (*ConfigV1) GetPachdAddress ¶
func (*ConfigV1) GetServerCas ¶ added in v2.7.0
func (*ConfigV1) GetSessionToken ¶
func (*ConfigV1) MarshalLogObject ¶
func (x *ConfigV1) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*ConfigV1) ProtoMessage ¶
func (*ConfigV1) ProtoMessage()
func (*ConfigV1) ProtoReflect ¶ added in v2.7.0
func (x *ConfigV1) ProtoReflect() protoreflect.Message
func (*ConfigV1) Validate ¶ added in v2.8.0
Validate checks the field values on ConfigV1 with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ConfigV1) ValidateAll ¶ added in v2.8.0
ValidateAll checks the field values on ConfigV1 with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConfigV1MultiError, or nil if none found.
type ConfigV1MultiError ¶ added in v2.8.0
type ConfigV1MultiError []error
ConfigV1MultiError is an error wrapping multiple validation errors returned by ConfigV1.ValidateAll() if the designated constraints aren't met.
func (ConfigV1MultiError) AllErrors ¶ added in v2.8.0
func (m ConfigV1MultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfigV1MultiError) Error ¶ added in v2.8.0
func (m ConfigV1MultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfigV1ValidationError ¶ added in v2.8.0
type ConfigV1ValidationError struct {
// contains filtered or unexported fields
}
ConfigV1ValidationError is the validation error returned by ConfigV1.Validate if the designated constraints aren't met.
func (ConfigV1ValidationError) Cause ¶ added in v2.8.0
func (e ConfigV1ValidationError) Cause() error
Cause function returns cause value.
func (ConfigV1ValidationError) Error ¶ added in v2.8.0
func (e ConfigV1ValidationError) Error() string
Error satisfies the builtin error interface
func (ConfigV1ValidationError) ErrorName ¶ added in v2.8.0
func (e ConfigV1ValidationError) ErrorName() string
ErrorName returns error name.
func (ConfigV1ValidationError) Field ¶ added in v2.8.0
func (e ConfigV1ValidationError) Field() string
Field function returns field value.
func (ConfigV1ValidationError) Key ¶ added in v2.8.0
func (e ConfigV1ValidationError) Key() bool
Key function returns key value.
func (ConfigV1ValidationError) Reason ¶ added in v2.8.0
func (e ConfigV1ValidationError) Reason() string
Reason function returns reason value.
type ConfigV2 ¶
type ConfigV2 struct { ActiveContext string `protobuf:"bytes,1,opt,name=active_context,json=activeContext,proto3" json:"active_context,omitempty"` ActiveEnterpriseContext string `` /* 132-byte string literal not displayed */ Contexts map[string]*Context `` /* 157-byte string literal not displayed */ Metrics bool `protobuf:"varint,4,opt,name=metrics,proto3" json:"metrics,omitempty"` MaxShellCompletions int64 `protobuf:"varint,5,opt,name=max_shell_completions,json=maxShellCompletions,proto3" json:"max_shell_completions,omitempty"` // contains filtered or unexported fields }
ConfigV2 specifies v2 of the pachyderm config (June 2019 - present)
func (*ConfigV2) Descriptor
deprecated
func (*ConfigV2) GetActiveContext ¶
func (*ConfigV2) GetActiveEnterpriseContext ¶
func (*ConfigV2) GetContexts ¶
func (*ConfigV2) GetMaxShellCompletions ¶
func (*ConfigV2) GetMetrics ¶
func (*ConfigV2) MarshalLogObject ¶
func (x *ConfigV2) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*ConfigV2) ProtoMessage ¶
func (*ConfigV2) ProtoMessage()
func (*ConfigV2) ProtoReflect ¶ added in v2.7.0
func (x *ConfigV2) ProtoReflect() protoreflect.Message
func (*ConfigV2) Validate ¶ added in v2.8.0
Validate checks the field values on ConfigV2 with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ConfigV2) ValidateAll ¶ added in v2.8.0
ValidateAll checks the field values on ConfigV2 with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConfigV2MultiError, or nil if none found.
type ConfigV2MultiError ¶ added in v2.8.0
type ConfigV2MultiError []error
ConfigV2MultiError is an error wrapping multiple validation errors returned by ConfigV2.ValidateAll() if the designated constraints aren't met.
func (ConfigV2MultiError) AllErrors ¶ added in v2.8.0
func (m ConfigV2MultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfigV2MultiError) Error ¶ added in v2.8.0
func (m ConfigV2MultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfigV2ValidationError ¶ added in v2.8.0
type ConfigV2ValidationError struct {
// contains filtered or unexported fields
}
ConfigV2ValidationError is the validation error returned by ConfigV2.Validate if the designated constraints aren't met.
func (ConfigV2ValidationError) Cause ¶ added in v2.8.0
func (e ConfigV2ValidationError) Cause() error
Cause function returns cause value.
func (ConfigV2ValidationError) Error ¶ added in v2.8.0
func (e ConfigV2ValidationError) Error() string
Error satisfies the builtin error interface
func (ConfigV2ValidationError) ErrorName ¶ added in v2.8.0
func (e ConfigV2ValidationError) ErrorName() string
ErrorName returns error name.
func (ConfigV2ValidationError) Field ¶ added in v2.8.0
func (e ConfigV2ValidationError) Field() string
Field function returns field value.
func (ConfigV2ValidationError) Key ¶ added in v2.8.0
func (e ConfigV2ValidationError) Key() bool
Key function returns key value.
func (ConfigV2ValidationError) Reason ¶ added in v2.8.0
func (e ConfigV2ValidationError) Reason() string
Reason function returns reason value.
type ConfigValidationError ¶ added in v2.8.0
type ConfigValidationError struct {
// contains filtered or unexported fields
}
ConfigValidationError is the validation error returned by Config.Validate if the designated constraints aren't met.
func (ConfigValidationError) Cause ¶ added in v2.8.0
func (e ConfigValidationError) Cause() error
Cause function returns cause value.
func (ConfigValidationError) Error ¶ added in v2.8.0
func (e ConfigValidationError) Error() string
Error satisfies the builtin error interface
func (ConfigValidationError) ErrorName ¶ added in v2.8.0
func (e ConfigValidationError) ErrorName() string
ErrorName returns error name.
func (ConfigValidationError) Field ¶ added in v2.8.0
func (e ConfigValidationError) Field() string
Field function returns field value.
func (ConfigValidationError) Key ¶ added in v2.8.0
func (e ConfigValidationError) Key() bool
Key function returns key value.
func (ConfigValidationError) Reason ¶ added in v2.8.0
func (e ConfigValidationError) Reason() string
Reason function returns reason value.
type Context ¶
type Context struct { // Where this context came from Source ContextSource `protobuf:"varint,1,opt,name=source,proto3,enum=config_v2.ContextSource" json:"source,omitempty"` // The hostname or IP address pointing pachd at a pachyderm cluster. PachdAddress string `protobuf:"bytes,2,opt,name=pachd_address,json=pachdAddress,proto3" json:"pachd_address,omitempty"` // Trusted root certificates (overrides installed certificates), formatted // as base64-encoded PEM. ServerCas string `protobuf:"bytes,3,opt,name=server_cas,json=serverCas,proto3" json:"server_cas,omitempty"` // A secret token identifying the current pachctl user within their // pachyderm cluster. This is included in all RPCs sent by pachctl, and used // to determine if pachctl actions are authorized. SessionToken string `protobuf:"bytes,4,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` // The currently active transaction for batching together pachctl commands. // This can be set or cleared via many of the `pachctl * transaction` commands. // This is the ID of the transaction object stored in the pachyderm etcd. ActiveTransaction string `protobuf:"bytes,5,opt,name=active_transaction,json=activeTransaction,proto3" json:"active_transaction,omitempty"` // The k8s cluster name - used to construct a k8s context. ClusterName string `protobuf:"bytes,6,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"` // The k8s auth info - used to construct a k8s context. AuthInfo string `protobuf:"bytes,7,opt,name=auth_info,json=authInfo,proto3" json:"auth_info,omitempty"` // The k8s namespace - used to construct a k8s context. Namespace string `protobuf:"bytes,8,opt,name=namespace,proto3" json:"namespace,omitempty"` // A mapping of service -> port number, when port forwarding is // running for this context. PortForwarders map[string]uint32 `` /* 192-byte string literal not displayed */ // A unique ID for the cluster deployment. At client initialization time, // we ensure this is the same as what the cluster reports back, to prevent // us from connecting to the wrong cluster. ClusterDeploymentId string `protobuf:"bytes,10,opt,name=cluster_deployment_id,json=clusterDeploymentId,proto3" json:"cluster_deployment_id,omitempty"` // A boolean that records whether the context points at an enterprise server. // If false, the context points at a stand-alone pachd. EnterpriseServer bool `protobuf:"varint,11,opt,name=enterprise_server,json=enterpriseServer,proto3" json:"enterprise_server,omitempty"` // The current project. Project string `protobuf:"bytes,12,opt,name=project,proto3" json:"project,omitempty"` // contains filtered or unexported fields }
func (*Context) Descriptor
deprecated
func (*Context) GetActiveTransaction ¶
func (*Context) GetAuthInfo ¶
func (*Context) GetClusterDeploymentId ¶ added in v2.7.0
func (*Context) GetClusterName ¶
func (*Context) GetEnterpriseServer ¶
func (*Context) GetNamespace ¶
func (*Context) GetPachdAddress ¶
func (*Context) GetPortForwarders ¶
func (*Context) GetProject ¶
func (*Context) GetServerCas ¶ added in v2.7.0
func (*Context) GetSessionToken ¶
func (*Context) GetSource ¶
func (x *Context) GetSource() ContextSource
func (*Context) MarshalLogObject ¶
func (x *Context) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*Context) ProtoMessage ¶
func (*Context) ProtoMessage()
func (*Context) ProtoReflect ¶ added in v2.7.0
func (x *Context) ProtoReflect() protoreflect.Message
func (*Context) Validate ¶ added in v2.8.0
Validate checks the field values on Context with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Context) ValidateAll ¶ added in v2.8.0
ValidateAll checks the field values on Context with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ContextMultiError, or nil if none found.
type ContextMultiError ¶ added in v2.8.0
type ContextMultiError []error
ContextMultiError is an error wrapping multiple validation errors returned by Context.ValidateAll() if the designated constraints aren't met.
func (ContextMultiError) AllErrors ¶ added in v2.8.0
func (m ContextMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ContextMultiError) Error ¶ added in v2.8.0
func (m ContextMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ContextSource ¶
type ContextSource int32
const ( ContextSource_NONE ContextSource = 0 ContextSource_CONFIG_V1 ContextSource = 1 ContextSource_HUB ContextSource = 2 ContextSource_IMPORTED ContextSource = 3 )
func (ContextSource) Descriptor ¶ added in v2.7.0
func (ContextSource) Descriptor() protoreflect.EnumDescriptor
func (ContextSource) Enum ¶ added in v2.7.0
func (x ContextSource) Enum() *ContextSource
func (ContextSource) EnumDescriptor
deprecated
func (ContextSource) EnumDescriptor() ([]byte, []int)
Deprecated: Use ContextSource.Descriptor instead.
func (ContextSource) Number ¶ added in v2.7.0
func (x ContextSource) Number() protoreflect.EnumNumber
func (ContextSource) String ¶
func (x ContextSource) String() string
func (ContextSource) Type ¶ added in v2.7.0
func (ContextSource) Type() protoreflect.EnumType
type ContextValidationError ¶ added in v2.8.0
type ContextValidationError struct {
// contains filtered or unexported fields
}
ContextValidationError is the validation error returned by Context.Validate if the designated constraints aren't met.
func (ContextValidationError) Cause ¶ added in v2.8.0
func (e ContextValidationError) Cause() error
Cause function returns cause value.
func (ContextValidationError) Error ¶ added in v2.8.0
func (e ContextValidationError) Error() string
Error satisfies the builtin error interface
func (ContextValidationError) ErrorName ¶ added in v2.8.0
func (e ContextValidationError) ErrorName() string
ErrorName returns error name.
func (ContextValidationError) Field ¶ added in v2.8.0
func (e ContextValidationError) Field() string
Field function returns field value.
func (ContextValidationError) Key ¶ added in v2.8.0
func (e ContextValidationError) Key() bool
Key function returns key value.
func (ContextValidationError) Reason ¶ added in v2.8.0
func (e ContextValidationError) Reason() string
Reason function returns reason value.