Documentation
¶
Index ¶
- Constants
- type CertificateManager
- type CoreConfig
- type DeploymentManager
- type IBPPeer
- type InitializeIBPPeer
- type JobStatus
- type Override
- type Peer
- func (p *Peer) CanSetCertificateTimer(instance *current.IBPPeer, update Update) bool
- func (p *Peer) CheckCSRHosts(instance *current.IBPPeer, hosts []string) bool
- func (p *Peer) CheckCertificates(instance *current.IBPPeer) (*current.CRStatus, error)
- func (p *Peer) CheckDBType(instance *current.IBPPeer) bool
- func (p *Peer) CheckForRunningJobs(listOpt k8sclient.ListOption) (JobStatus, *jobv1.Job, error)
- func (p *Peer) CheckStates(instance *current.IBPPeer) error
- func (p *Peer) ConfigExists(instance *current.IBPPeer) bool
- func (p *Peer) CreateManagers()
- func (p *Peer) CreateSecret(instance *current.IBPPeer) error
- func (p *Peer) CustomLogic(instance *current.IBPPeer, update Update) (*current.CRStatus, *common.Result, error)
- func (p *Peer) EnrollForEcert(instance *current.IBPPeer) error
- func (p *Peer) EnrollForTLSCert(instance *current.IBPPeer) error
- func (p *Peer) FabricPeerMigrationV1_4(instance *current.IBPPeer) (*peerconfig.Core, error)
- func (p *Peer) GetBCCSPSectionForInstance(instance *current.IBPPeer) (*commonapi.BCCSP, error)
- func (p *Peer) GetEndpoints(instance *current.IBPPeer) *current.PeerEndpoints
- func (p *Peer) GetInitStoragePath(instance *current.IBPPeer) string
- func (p *Peer) GetLabels(instance v1.Object) map[string]string
- func (p *Peer) HandleActions(instance *current.IBPPeer, update Update) error
- func (p *Peer) HandleMigrationJobs(listOpt k8sclient.ListOption, instance *current.IBPPeer) (bool, error)
- func (p *Peer) HandleRestart(instance *current.IBPPeer, update Update) error
- func (p *Peer) Initialize(instance *current.IBPPeer, update Update) error
- func (p *Peer) InitializeCreate(instance *current.IBPPeer, initPeer *initializer.Peer) error
- func (p *Peer) InitializeUpdateConfigOverride(instance *current.IBPPeer, initPeer *initializer.Peer) error
- func (p *Peer) InitializeUpdateNodeOU(instance *current.IBPPeer) error
- func (p *Peer) PreReconcileChecks(instance *current.IBPPeer, update Update) (bool, error)
- func (p *Peer) Reconcile(instance *current.IBPPeer, update Update) (common.Result, error)
- func (p *Peer) ReconcileFabricPeerMigrationV1_4(instance *current.IBPPeer) error
- func (p *Peer) ReconcileFabricPeerMigrationV2_0(instance *current.IBPPeer) error
- func (p *Peer) ReconcileFabricPeerMigrationV2_4(instance *current.IBPPeer) error
- func (p *Peer) ReconcileHSMImages(instance *current.IBPPeer) bool
- func (p *Peer) ReconcileManagers(instance *current.IBPPeer, updated Update) error
- func (p *Peer) ReconcilePeerRBAC(instance *current.IBPPeer) error
- func (p *Peer) ReconcileSecret(instance *current.IBPPeer) error
- func (p *Peer) ReenrollEcert(instance *current.IBPPeer) error
- func (p *Peer) ReenrollEcertNewKey(instance *current.IBPPeer) error
- func (p *Peer) ReenrollTLSCert(instance *current.IBPPeer) error
- func (p *Peer) ReenrollTLSCertNewKey(instance *current.IBPPeer) error
- func (p *Peer) RenewCert(certType commoninit.SecretType, obj runtime.Object, newKey bool) error
- func (p *Peer) RestartAction(instance *current.IBPPeer) error
- func (p *Peer) SelectRegion(instance *current.IBPPeer) (bool, error)
- func (p *Peer) SelectZone(instance *current.IBPPeer) (bool, error)
- func (p *Peer) SetCertificateTimer(instance *current.IBPPeer, certType commoninit.SecretType) error
- func (p *Peer) SetVersion(instance *current.IBPPeer) (bool, error)
- func (p *Peer) UpdateCRStatus(instance *current.IBPPeer) error
- func (p *Peer) UpdateConnectionProfile(instance *current.IBPPeer) error
- func (p *Peer) UpdateConnectionProfileConfigmap(instance *current.IBPPeer, endpoints current.PeerEndpoints, tlscert string, ...) error
- func (p *Peer) UpdateExternalEndpoint(instance *current.IBPPeer) bool
- func (p *Peer) UpdateMSPCertificates(instance *current.IBPPeer) error
- func (p *Peer) UpdateSecret(instance *current.IBPPeer, secret *corev1.Secret) error
- func (p *Peer) UpgradeDBs(instance *current.IBPPeer) error
- type RestartManager
- type Update
Constants ¶
const ( DefaultCouchContainer = "./definitions/peer/couchdb.yaml" DefaultCouchInitContainer = "./definitions/peer/couchdb-init.yaml" DaysToSecondsConversion = int64(24 * 60 * 60) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertificateManager ¶
type CertificateManager interface {
CheckCertificatesForExpire(instance v1.Object, numSecondsBeforeExpire int64) (current.IBPCRStatusType, string, error)
GetSignCert(string, string) ([]byte, error)
GetDurationToNextRenewal(commoninit.SecretType, v1.Object, int64) (time.Duration, error)
RenewCert(commoninit.SecretType, certificate.Instance, *current.EnrollmentSpec, *commonapi.BCCSP, string, bool, bool) error
}
type CoreConfig ¶
type DeploymentManager ¶
type IBPPeer ¶
type IBPPeer interface {
Initialize(instance *current.IBPPeer, update Update) error
CheckStates(instance *current.IBPPeer) error
PreReconcileChecks(instance *current.IBPPeer, update Update) (bool, error)
ReconcileManagers(instance *current.IBPPeer, update Update) error
Reconcile(instance *current.IBPPeer, update Update) (common.Result, error)
}
type InitializeIBPPeer ¶
type InitializeIBPPeer interface {
GenerateOrdererCACertsSecret(instance *current.IBPPeer, certs map[string][]byte) error
GenerateSecrets(prefix commoninit.SecretType, instance v1.Object, crypto *commonconfig.Response) error
Create(initializer.CoreConfig, initializer.IBPPeer, string) (*initializer.Response, error)
Update(initializer.CoreConfig, initializer.IBPPeer) (*initializer.Response, error)
CheckIfAdminCertsUpdated(*current.IBPPeer) (bool, error)
UpdateAdminSecret(*current.IBPPeer) error
MissingCrypto(*current.IBPPeer) bool
GetInitPeer(instance *current.IBPPeer, storagePath string) (*initializer.Peer, error)
GetUpdatedPeer(instance *current.IBPPeer) (*initializer.Peer, error)
GenerateSecretsFromResponse(instance *current.IBPPeer, cryptoResponse *commonconfig.CryptoResponse) error
UpdateSecretsFromResponse(instance *current.IBPPeer, cryptoResponse *commonconfig.CryptoResponse) error
GetCrypto(instance *current.IBPPeer) (*commonconfig.CryptoResponse, error)
CoreConfigMap() *initializer.CoreConfigMap
}
type Override ¶
type Override interface {
Deployment(v1.Object, *appsv1.Deployment, resources.Action) error
Service(v1.Object, *corev1.Service, resources.Action) error
PVC(v1.Object, *corev1.PersistentVolumeClaim, resources.Action) error
StateDBPVC(v1.Object, *corev1.PersistentVolumeClaim, resources.Action) error
}
type Peer ¶
type Peer struct {
Client controllerclient.Client
Scheme *runtime.Scheme
Config *config.Config
DeploymentManager DeploymentManager
ServiceManager resources.Manager
PVCManager resources.Manager
StateDBPVCManager resources.Manager
FluentDConfigMapManager resources.Manager
RoleManager resources.Manager
RoleBindingManager resources.Manager
ServiceAccountManager resources.Manager
Override Override
Initializer InitializeIBPPeer
CertificateManager CertificateManager
RenewCertTimers map[string]*time.Timer
Restart RestartManager
}
func (*Peer) CanSetCertificateTimer ¶
This function checks whether the instance is in Deployed or Warning state when a cert update is detected. Only if Deployed or in Warning will a timer be set; otherwise, the update will be requeued until the Peer has completed deploying.
func (*Peer) CheckCSRHosts ¶
func (*Peer) CheckCertificates ¶
func (*Peer) CheckForRunningJobs ¶
func (*Peer) CheckStates ¶
this function makes sure the deployment spec matches the expected state
func (*Peer) CreateManagers ¶
func (p *Peer) CreateManagers()
func (*Peer) CustomLogic ¶
func (*Peer) FabricPeerMigrationV1_4 ¶
Moving to fabric version above 1.4.6 require that the `msp/keystore` value be removed from BCCSP section if configured to use PKCS11 (HSM). NOTE: This does not support migration across major release, will not cover migration peer from 1.4.x to 2.x
func (*Peer) GetBCCSPSectionForInstance ¶
func (*Peer) GetEndpoints ¶
func (p *Peer) GetEndpoints(instance *current.IBPPeer) *current.PeerEndpoints
func (*Peer) GetInitStoragePath ¶
func (*Peer) HandleActions ¶
func (*Peer) HandleMigrationJobs ¶
func (*Peer) HandleRestart ¶
func (*Peer) InitializeCreate ¶
func (*Peer) InitializeUpdateConfigOverride ¶
func (*Peer) InitializeUpdateNodeOU ¶
func (*Peer) PreReconcileChecks ¶
func (*Peer) ReconcileFabricPeerMigrationV1_4 ¶
func (*Peer) ReconcileFabricPeerMigrationV2_0 ¶
func (*Peer) ReconcileFabricPeerMigrationV2_4 ¶
func (*Peer) ReconcileManagers ¶
func (*Peer) ReenrollEcertNewKey ¶
func (*Peer) ReenrollTLSCertNewKey ¶
func (*Peer) RenewCert ¶
func (p *Peer) RenewCert(certType commoninit.SecretType, obj runtime.Object, newKey bool) error
func (*Peer) SetCertificateTimer ¶
func (p *Peer) SetCertificateTimer(instance *current.IBPPeer, certType commoninit.SecretType) error
func (*Peer) UpdateCRStatus ¶
NOTE: This is called by the timer's subroutine when it goes off, not during a reconcile loop. Therefore, it won't be overriden by the "SetStatus" method in ibppeer_controller.go
func (*Peer) UpdateConnectionProfile ¶
func (*Peer) UpdateConnectionProfileConfigmap ¶
func (*Peer) UpdateExternalEndpoint ¶
func (*Peer) UpdateMSPCertificates ¶
func (*Peer) UpdateSecret ¶
type RestartManager ¶
type RestartManager interface {
ForAdminCertUpdate(instance v1.Object) error
ForCertUpdate(certType commoninit.SecretType, instance v1.Object) error
ForConfigOverride(instance v1.Object) error
ForNodeOU(instance v1.Object) error
ForRestartAction(instance v1.Object) error
TriggerIfNeeded(instance restart.Instance) error
}
type Update ¶
type Update interface {
SpecUpdated() bool
ConfigOverridesUpdated() bool
DindArgsUpdated() bool
TLSCertUpdated() bool
EcertUpdated() bool
PeerTagUpdated() bool
CertificateUpdated() bool
SetDindArgsUpdated(updated bool)
RestartNeeded() bool
EcertReenrollNeeded() bool
TLSReenrollNeeded() bool
EcertNewKeyReenroll() bool
TLScertNewKeyReenroll() bool
MigrateToV2() bool
MigrateToV24() bool
UpgradeDBs() bool
MSPUpdated() bool
EcertEnroll() bool
TLSCertEnroll() bool
CertificateCreated() bool
GetCreatedCertType() commoninit.SecretType
CryptoBackupNeeded() bool
NodeOUUpdated() bool
FabricVersionUpdated() bool
ImagesUpdated() bool
}