Documentation ¶
Index ¶
- Constants
- func AddDaemonContainer(config *HSMConfig, resource Resource, contResource corev1.ResourceRequirements, ...)
- func NodeOUConfigToBytes(config *NodeOUConfig) ([]byte, error)
- type Auth
- type Client
- type Crypto
- type CryptoResponse
- type Cryptos
- type Daemon
- type HSMConfig
- type Identifier
- type Library
- type MountPath
- type NodeOUConfig
- type NodeOUs
- type Path
- type Resource
- type Response
Constants ¶
const DAEMON_CHECK_CMD = "while true; do if [ -f /shared/daemon-launched ]; then break; fi; done"
Variables ¶
This section is empty.
Functions ¶
func AddDaemonContainer ¶
func AddDaemonContainer(config *HSMConfig, resource Resource, contResource corev1.ResourceRequirements, pvcMount *corev1.VolumeMount)
AddDaemonContainer appends an init container responsible for launching HSM daemon as a background process within the processNamespace of the pod
func NodeOUConfigToBytes ¶
func NodeOUConfigToBytes(config *NodeOUConfig) ([]byte, error)
Types ¶
type Auth ¶
type Auth struct {
ImagePullSecret string `json:"imagePullSecret,omitempty"`
}
Auth represents the authentication methods that are supported
func (*Auth) BuildPullSecret ¶
func (a *Auth) BuildPullSecret() corev1.LocalObjectReference
BuildPullSecret builds the pull secret string into the type expected by kubernetes
type CryptoResponse ¶
func (*CryptoResponse) VerifyCertOU ¶
func (c *CryptoResponse) VerifyCertOU(crType string) error
type Cryptos ¶
func (*Cryptos) GenerateCryptoResponse ¶
func (c *Cryptos) GenerateCryptoResponse() (*CryptoResponse, error)
type Daemon ¶
type Daemon struct { Image string `json:"image"` Envs []corev1.EnvVar `json:"envs,omitempty"` Auth *Auth `json:"auth,omitempty"` SecurityContext *container.SecurityContext `json:"securityContext,omitempty"` Resources *corev1.ResourceRequirements `json:"daemon,omitempty"` }
Daemon represents that configuration for the HSM Daemon
func (*Daemon) BuildPullSecret ¶
func (d *Daemon) BuildPullSecret() corev1.LocalObjectReference
BuildPullSecret builds the string secret into the type expected by kubernetes
type HSMConfig ¶
type HSMConfig struct { Type string `json:"type,omitempty"` Version string `json:"version,omitempty"` Library Library `json:"library"` MountPaths []MountPath `json:"mountpaths"` Envs []corev1.EnvVar `json:"envs,omitempty"` Daemon *Daemon `json:"daemon,omitempty"` }
HSMConfig defines the configuration parameters for HSMs
func ReadHSMConfig ¶
ReadHSMConfig reads hsm configuration from 'ibp-hsm-config', and key 'ibp-hsm-config.yaml' from data
func (*HSMConfig) BuildPullSecret ¶
func (h *HSMConfig) BuildPullSecret() corev1.LocalObjectReference
BuildPullSecret builds the string secret into the type expected by kubernetes
func (*HSMConfig) GetVolumeMounts ¶
func (h *HSMConfig) GetVolumeMounts() []corev1.VolumeMount
GetVolumeMounts builds the volume mount spec into the type expected by kubernetes
func (*HSMConfig) GetVolumes ¶
GetVolumes builds the volume spec into the type expected by kubernetes, by default the volume source is empty dir with memory as the storage medium
type Identifier ¶
type Library ¶
type Library struct { FilePath string `json:"filepath"` Image string `json:"image"` AutoUpdateDisabled bool `json:"autoUpdateDisabled,omitempty"` Auth *Auth `json:"auth,omitempty"` }
Library represents the configuration for an HSM library
type MountPath ¶
type MountPath struct { Name string `json:"name"` Secret string `json:"secret"` MountPath string `json:"mountpath"` UsePVC bool `json:"usePVC"` SubPath string `json:"subpath,omitempty"` Paths []Path `json:"paths,omitempty"` VolumeSource *corev1.VolumeSource `json:"volumeSource,omitempty"` }
MountPath represent the configuration of volume mounts on a container
func (*MountPath) BuildVolume ¶
BuildVolume builds the volume spec into the type expected by kubernetes
func (*MountPath) BuildVolumeMount ¶
func (m *MountPath) BuildVolumeMount() corev1.VolumeMount
BuildVolumeMount builds the volume mount spec into the type expected by kubernetes
type NodeOUConfig ¶
type NodeOUConfig struct {
NodeOUs NodeOUs
}
func NodeOUConfigFromBytes ¶
func NodeOUConfigFromBytes(nodeOU []byte) (*NodeOUConfig, error)
type NodeOUs ¶
type NodeOUs struct { Enable bool ClientOUIdentifier Identifier PeerOUIdentifier Identifier AdminOUIdentifier Identifier OrdererOUIdentifier Identifier }
type Resource ¶
type Resource interface { AddContainer(add container.Container) AppendVolumeIfMissing(volume corev1.Volume) AppendPullSecret(imagePullSecret corev1.LocalObjectReference) }
Resource defines the contract required for adding a daemon init containter on to a kubernetes resource
type Response ¶
type Response struct { CACerts [][]byte IntermediateCerts [][]byte AdminCerts [][]byte SignCert []byte Keystore []byte }
func GenerateCrypto ¶
TODO: Next refactor should move this outside of config package into cryptogen package along with the Response struct, which is required to avoid cyclical dependencies