Skip to content

Commit 5a0c106

Browse files
committed
fabric-config 0.1.0 -> 0.2.1
Add ports 443 for the peer
1 parent d551efc commit 5a0c106

File tree

6 files changed

+27
-8
lines changed

6 files changed

+27
-8
lines changed

charts/hlf-ordnode/templates/service.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ metadata:
77
spec:
88
type: {{ .Values.service.type }}
99
ports:
10+
- port: 443
11+
targetPort: 7050
12+
protocol: TCP
13+
name: grpc-443
1014
- port: {{ .Values.service.port }}
1115
targetPort: 7050
1216
protocol: TCP

controllers/followerchannel/followerchannel_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,18 @@ func (r *FabricFollowerChannelReconciler) Reconcile(ctx context.Context, req ctr
251251
r.Log.Info(fmt.Sprintf("Old anchor peers %v", anchorPeers))
252252

253253
for _, anchorPeer := range anchorPeers {
254+
reqLogger.Info(fmt.Sprintf("Removing anchor peer %v", anchorPeer))
254255
err = app.RemoveAnchorPeer(configtx.Address{
255256
Host: anchorPeer.Host,
256257
Port: anchorPeer.Port,
257258
})
258259
if err != nil {
260+
currentAnchorPeers, err := app.AnchorPeers()
261+
reqLogger.Error(err, fmt.Sprintf("Failed to remove anchor peer %v, current anchor peers: %v", anchorPeer, currentAnchorPeers))
259262
r.setConditionStatus(ctx, fabricFollowerChannel, hlfv1alpha1.FailedStatus, false, err, false)
260263
return r.updateCRStatusOrFailReconcile(ctx, r.Log, fabricFollowerChannel)
261264
}
265+
reqLogger.Info(fmt.Sprintf("Removed anchor peer %v", anchorPeer))
262266
}
263267
r.Log.Info(fmt.Sprintf("New anchor peers %v", anchorPeers))
264268

@@ -268,6 +272,7 @@ func (r *FabricFollowerChannelReconciler) Reconcile(ctx context.Context, req ctr
268272
Port: anchorPeer.Port,
269273
})
270274
if err != nil {
275+
reqLogger.Error(err, fmt.Sprintf("Failed to add anchor peer %v", anchorPeer))
271276
r.setConditionStatus(ctx, fabricFollowerChannel, hlfv1alpha1.FailedStatus, false, err, false)
272277
return r.updateCRStatusOrFailReconcile(ctx, r.Log, fabricFollowerChannel)
273278
}

controllers/networkconfig/networkconfig_controller.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ func (r *FabricNetworkConfigReconciler) Reconcile(ctx context.Context, req ctrl.
316316
var cas []*helpers.ClusterCA
317317
for _, ca := range certAuths {
318318
for _, fabricNetworkConfigCA := range fabricNetworkConfig.Spec.CertificateAuthorities {
319-
log.Infof("NAME=%s NAMECA=%s NS=%s NSCA=%s", ca.Item.Name, fabricNetworkConfigCA.Name, ca.Item.Namespace, fabricNetworkConfigCA.Namespace)
320319
if ca.Item.Name == fabricNetworkConfigCA.Name && ca.Item.Namespace == fabricNetworkConfigCA.Namespace {
321320
cas = append(cas, ca)
322321
}
@@ -435,14 +434,13 @@ func (r *FabricNetworkConfigReconciler) Reconcile(ctx context.Context, req ctrl.
435434
}
436435
}
437436
}
438-
for _, peer := range org.Peers {
439-
for idx, p := range peers {
440-
if p.MSPID == mspID && (p.Object.Name != peer.Name || p.Object.Namespace != peer.Namespace) {
441-
peers = append(peers[:idx], peers[idx+1:]...)
442-
break
443-
}
437+
var restPeerOrgs []*helpers.ClusterPeer
438+
for _, p := range peers {
439+
if p.MSPID != mspID {
440+
restPeerOrgs = append(restPeerOrgs, p)
444441
}
445442
}
443+
peers = append(restPeerOrgs, orgPeers...)
446444
orgMap[mspID].Peers = orgPeers
447445
}
448446
}

controllers/peer/peer_controller.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,7 @@ func (r *FabricPeerReconciler) finalizePeer(reqLogger logr.Logger, peer *hlfv1al
15561556
}
15571557

15581558
const PeerPortName = "peer"
1559+
const PeerPortName443 = "peer-443"
15591560
const ChaincodePortName = "chaincode"
15601561
const EventPortName = "event"
15611562
const OperationsPortName = "operations"
@@ -1607,6 +1608,15 @@ func createPeerService(
16071608
serviceSpec := corev1.ServiceSpec{
16081609
Type: peer.Spec.Service.Type,
16091610
Ports: []corev1.ServicePort{
1611+
{
1612+
Name: PeerPortName443,
1613+
Protocol: "TCP",
1614+
Port: 443,
1615+
TargetPort: intstr.IntOrString{
1616+
Type: intstr.Int,
1617+
IntVal: 443,
1618+
},
1619+
},
16101620
{
16111621
Name: PeerPortName,
16121622
Protocol: "TCP",

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ require (
2020
github.com/gorilla/mux v1.8.0
2121
github.com/grantae/certinfo v0.0.0-20170412194111-59d56a35515b
2222
github.com/hyperledger/fabric v2.1.1+incompatible
23-
github.com/hyperledger/fabric-config v0.1.0
23+
github.com/hyperledger/fabric-config v0.2.1
2424
github.com/hyperledger/fabric-lib-go v1.0.0
2525
github.com/hyperledger/fabric-protos-go v0.3.0
2626
github.com/hyperledger/fabric-sdk-go v1.0.1-0.20220124135247-4f34271d9b0f

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,8 @@ github.com/hyperledger/fabric-amcl v0.0.0-20210603140002-2670f91851c8/go.mod h1:
473473
github.com/hyperledger/fabric-config v0.0.5/go.mod h1:YpITBI/+ZayA3XWY5lF302K7PAsFYjEEPM/zr3hegA8=
474474
github.com/hyperledger/fabric-config v0.1.0 h1:TsR3y5xEoUmXWfp8tcDycjJhVvXEHiV5kfZIxuIte08=
475475
github.com/hyperledger/fabric-config v0.1.0/go.mod h1:aeDZ0moG/qKvwLjddcqYr8+58/oNaJy3HE0tI01546c=
476+
github.com/hyperledger/fabric-config v0.2.1 h1:CsReuxvi5c5NUyKKQOIVbHux32o+XtmDNceYLYjycxo=
477+
github.com/hyperledger/fabric-config v0.2.1/go.mod h1:1ZfjDrsuMoM4IPKezQgTByy2vXUj8bgTXaOXaGXK5O4=
476478
github.com/hyperledger/fabric-lib-go v1.0.0 h1:UL1w7c9LvHZUSkIvHTDGklxFv2kTeva1QI2emOVc324=
477479
github.com/hyperledger/fabric-lib-go v1.0.0/go.mod h1:H362nMlunurmHwkYqR5uHL2UDWbQdbfz74n8kbCFsqc=
478480
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=

0 commit comments

Comments
 (0)