initializer

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCoreFromConfigMap

func GetCoreFromConfigMap(client k8sclient.Client, instance *current.IBPPeer) (*corev1.ConfigMap, error)

Types

type Config

type Config struct {
	OUFile                 string
	InterOUFile            string
	CorePeerFile           string
	CorePeerV2File         string
	DeploymentFile         string
	PVCFile                string
	CouchDBPVCFile         string
	ServiceFile            string
	RoleFile               string
	ServiceAccountFile     string
	RoleBindingFile        string
	FluentdConfigMapFile   string
	CouchContainerFile     string
	CouchInitContainerFile string
	IngressFile            string
	Ingressv1beta1File     string
	CCLauncherFile         string
	RouteFile              string
	StoragePath            string
}

type CoreConfig

type CoreConfig interface {
	MergeWith(interface{}, bool) error
	GetAddressOverrides() []v1.AddressOverride
	ToBytes() ([]byte, error)
	UsingPKCS11() bool
	SetPKCS11Defaults(bool)
	GetBCCSPSection() *commonapi.BCCSP
	SetBCCSPLibrary(string)
}

func GetCoreConfigFromBytes

func GetCoreConfigFromBytes(instance *current.IBPPeer, bytes []byte) (CoreConfig, error)

func GetCoreConfigFromFile

func GetCoreConfigFromFile(instance *current.IBPPeer, file string) (CoreConfig, error)

type CoreConfigMap

type CoreConfigMap struct {
	Config    *Config
	Scheme    *runtime.Scheme
	GetLabels func(instance metav1.Object) map[string]string
	Client    k8sclient.Client
}

func (*CoreConfigMap) AddNodeOU

func (c *CoreConfigMap) AddNodeOU(instance *current.IBPPeer) error

func (*CoreConfigMap) CreateOrUpdate

func (c *CoreConfigMap) CreateOrUpdate(instance *current.IBPPeer, peer CoreConfig) error

func (*CoreConfigMap) GetCoreConfig

func (c *CoreConfigMap) GetCoreConfig(instance *current.IBPPeer) (*corev1.ConfigMap, error)

type IBPPeer

type IBPPeer interface {
	DeliveryClientCrypto() map[string][]byte
	OverrideConfig(CoreConfig) error
	GenerateCrypto() (*config.CryptoResponse, error)
	GetConfig() CoreConfig
}

type Initializer

type Initializer struct {
	Config    *Config
	Scheme    *runtime.Scheme
	GetLabels func(instance metav1.Object) map[string]string

	Timeouts enroller.HSMEnrollJobTimeouts

	Client        k8sclient.Client
	Validator     common.CryptoValidator
	SecretManager *secretmanager.SecretManager
	// contains filtered or unexported fields
}

func New

func New(config *Config, scheme *runtime.Scheme, client k8sclient.Client, labels func(instance metav1.Object) map[string]string, validator common.CryptoValidator, timeouts enroller.HSMEnrollJobTimeouts) *Initializer

func (*Initializer) CheckIfAdminCertsUpdated

func (i *Initializer) CheckIfAdminCertsUpdated(instance *current.IBPPeer) (bool, error)

func (*Initializer) CoreConfigMap

func (i *Initializer) CoreConfigMap() *CoreConfigMap

func (*Initializer) Create

func (i *Initializer) Create(overrides CoreConfig, peer IBPPeer, storagePath string) (*Response, error)

func (*Initializer) CreateOrUpdateSecret

func (i *Initializer) CreateOrUpdateSecret(instance *current.IBPPeer, name string, data map[string][]byte) error

func (*Initializer) GenerateOrdererCACertsSecret

func (i *Initializer) GenerateOrdererCACertsSecret(instance *current.IBPPeer, certs map[string][]byte) error

func (*Initializer) GenerateSecrets

func (i *Initializer) GenerateSecrets(prefix common.SecretType, instance metav1.Object, crypto *config.Response) error

func (*Initializer) GenerateSecretsFromResponse

func (i *Initializer) GenerateSecretsFromResponse(instance *current.IBPPeer, cryptoResponse *config.CryptoResponse) error

func (*Initializer) GetCrypto

func (i *Initializer) GetCrypto(instance *current.IBPPeer) (*config.CryptoResponse, error)

func (*Initializer) GetEnrollers

func (i *Initializer) GetEnrollers(cryptos *config.Cryptos, instance *current.IBPPeer, storagePath string) error

func (*Initializer) GetInitPeer

func (i *Initializer) GetInitPeer(instance *current.IBPPeer, storagePath string) (*Peer, error)

func (*Initializer) GetMSPCrypto

func (i *Initializer) GetMSPCrypto(cryptos *config.Cryptos, instance *current.IBPPeer) error

func (*Initializer) GetUpdatedPeer

func (i *Initializer) GetUpdatedPeer(instance *current.IBPPeer) (*Peer, error)

func (*Initializer) MissingCrypto

func (i *Initializer) MissingCrypto(instance *current.IBPPeer) bool

func (*Initializer) Update

func (i *Initializer) Update(overrides CoreConfig, peer IBPPeer) (*Response, error)

func (*Initializer) UpdateAdminSecret

func (i *Initializer) UpdateAdminSecret(instance *current.IBPPeer) error

func (*Initializer) UpdateSecrets

func (i *Initializer) UpdateSecrets(prefix common.SecretType, instance *current.IBPPeer, crypto *config.Response) error

func (*Initializer) UpdateSecretsFromResponse

func (i *Initializer) UpdateSecretsFromResponse(instance *current.IBPPeer, cryptoResponse *config.CryptoResponse) error

type Peer

type Peer struct {
	Config        CoreConfig
	Cryptos       *commonconfig.Cryptos
	UsingHSMProxy bool
}

func (*Peer) DeliveryClientCrypto

func (p *Peer) DeliveryClientCrypto() map[string][]byte

func (*Peer) GenerateCrypto

func (p *Peer) GenerateCrypto() (*commonconfig.CryptoResponse, error)

func (*Peer) GetConfig

func (p *Peer) GetConfig() CoreConfig

func (*Peer) OverrideConfig

func (p *Peer) OverrideConfig(newConfig CoreConfig) (err error)

type PeerConfig

type PeerConfig interface {
	MergeWith(interface{}, bool) error
	GetAddressOverrides() []configv1.AddressOverride
	ToBytes() ([]byte, error)
	UsingPKCS11() bool
	SetPKCS11Defaults(bool)
	GetBCCSPSection() *commonapi.BCCSP
	GetMaxNameLength() *int
	SetDefaultKeyStore()
}

type Response

type Response struct {
	Config              CoreConfig
	Crypto              *config.CryptoResponse
	DeliveryClientCerts map[string][]byte
}

Directories

Path Synopsis
config
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL