Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SecretVolumePath is the path of ALL the mounted secrets. SecretVolumePath = "/etc/secrets" // ConfigVolumePath is the path of the mounted NATS config file. ConfigVolumePath = "/etc/config" )
Variables ¶
This section is empty.
Functions ¶
func GetTLSConfig ¶
GetTLSConfig is a utility function to translate a NATS tls config to tls.Config
Types ¶
type NatsVolumeReader ¶
type NatsVolumeReader struct {
// contains filtered or unexported fields
}
NatsVolumeReader is a utility struct for reading secret volumes.
func NewNatsVolumeReader ¶
func NewNatsVolumeReader(secretPath string) *NatsVolumeReader
NewNatsVolumeReader creates a new NatsVolumeReader with the specified secret path.
func (*NatsVolumeReader) GetSecretFromVolume ¶
func (nvr *NatsVolumeReader) GetSecretFromVolume(selector *corev1.SecretKeySelector) (string, error)
GetSecretFromVolume retrieves the value from a mounted secret volume. It trims any newline suffix from the value.
func (*NatsVolumeReader) GetSecretVolumePath ¶
func (nvr *NatsVolumeReader) GetSecretVolumePath(selector *corev1.SecretKeySelector) (string, error)
GetSecretVolumePath constructs and returns the path of a mounted secret based on the secret key selector.
type VolumeReader ¶
type VolumeReader interface { GetSecretFromVolume(selector *corev1.SecretKeySelector) (string, error) GetSecretVolumePath(selector *corev1.SecretKeySelector) (string, error) }
VolumeReader is an interface that defines methods to interact with secret volumes in a Kubernetes environment.
Click to show internal directories.
Click to hide internal directories.