Skip to content

Commit

Permalink
fabric-config 0.1.0 -> 0.2.1
Browse files Browse the repository at this point in the history
Add ports 443 for the peer
  • Loading branch information
dviejokfs committed Jan 8, 2024
1 parent d551efc commit 5a0c106
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
4 changes: 4 additions & 0 deletions charts/hlf-ordnode/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
spec:
type: {{ .Values.service.type }}
ports:
- port: 443
targetPort: 7050
protocol: TCP
name: grpc-443
- port: {{ .Values.service.port }}
targetPort: 7050
protocol: TCP
Expand Down
5 changes: 5 additions & 0 deletions controllers/followerchannel/followerchannel_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,18 @@ func (r *FabricFollowerChannelReconciler) Reconcile(ctx context.Context, req ctr
r.Log.Info(fmt.Sprintf("Old anchor peers %v", anchorPeers))

for _, anchorPeer := range anchorPeers {
reqLogger.Info(fmt.Sprintf("Removing anchor peer %v", anchorPeer))
err = app.RemoveAnchorPeer(configtx.Address{
Host: anchorPeer.Host,
Port: anchorPeer.Port,
})
if err != nil {
currentAnchorPeers, err := app.AnchorPeers()
reqLogger.Error(err, fmt.Sprintf("Failed to remove anchor peer %v, current anchor peers: %v", anchorPeer, currentAnchorPeers))
r.setConditionStatus(ctx, fabricFollowerChannel, hlfv1alpha1.FailedStatus, false, err, false)
return r.updateCRStatusOrFailReconcile(ctx, r.Log, fabricFollowerChannel)
}
reqLogger.Info(fmt.Sprintf("Removed anchor peer %v", anchorPeer))
}
r.Log.Info(fmt.Sprintf("New anchor peers %v", anchorPeers))

Expand All @@ -268,6 +272,7 @@ func (r *FabricFollowerChannelReconciler) Reconcile(ctx context.Context, req ctr
Port: anchorPeer.Port,
})
if err != nil {
reqLogger.Error(err, fmt.Sprintf("Failed to add anchor peer %v", anchorPeer))
r.setConditionStatus(ctx, fabricFollowerChannel, hlfv1alpha1.FailedStatus, false, err, false)
return r.updateCRStatusOrFailReconcile(ctx, r.Log, fabricFollowerChannel)
}
Expand Down
12 changes: 5 additions & 7 deletions controllers/networkconfig/networkconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ func (r *FabricNetworkConfigReconciler) Reconcile(ctx context.Context, req ctrl.
var cas []*helpers.ClusterCA
for _, ca := range certAuths {
for _, fabricNetworkConfigCA := range fabricNetworkConfig.Spec.CertificateAuthorities {
log.Infof("NAME=%s NAMECA=%s NS=%s NSCA=%s", ca.Item.Name, fabricNetworkConfigCA.Name, ca.Item.Namespace, fabricNetworkConfigCA.Namespace)
if ca.Item.Name == fabricNetworkConfigCA.Name && ca.Item.Namespace == fabricNetworkConfigCA.Namespace {
cas = append(cas, ca)
}
Expand Down Expand Up @@ -435,14 +434,13 @@ func (r *FabricNetworkConfigReconciler) Reconcile(ctx context.Context, req ctrl.
}
}
}
for _, peer := range org.Peers {
for idx, p := range peers {
if p.MSPID == mspID && (p.Object.Name != peer.Name || p.Object.Namespace != peer.Namespace) {
peers = append(peers[:idx], peers[idx+1:]...)
break
}
var restPeerOrgs []*helpers.ClusterPeer
for _, p := range peers {
if p.MSPID != mspID {
restPeerOrgs = append(restPeerOrgs, p)
}
}
peers = append(restPeerOrgs, orgPeers...)
orgMap[mspID].Peers = orgPeers
}
}
Expand Down
10 changes: 10 additions & 0 deletions controllers/peer/peer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,7 @@ func (r *FabricPeerReconciler) finalizePeer(reqLogger logr.Logger, peer *hlfv1al
}

const PeerPortName = "peer"
const PeerPortName443 = "peer-443"
const ChaincodePortName = "chaincode"
const EventPortName = "event"
const OperationsPortName = "operations"
Expand Down Expand Up @@ -1607,6 +1608,15 @@ func createPeerService(
serviceSpec := corev1.ServiceSpec{
Type: peer.Spec.Service.Type,
Ports: []corev1.ServicePort{
{
Name: PeerPortName443,
Protocol: "TCP",
Port: 443,
TargetPort: intstr.IntOrString{
Type: intstr.Int,
IntVal: 443,
},
},
{
Name: PeerPortName,
Protocol: "TCP",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/grantae/certinfo v0.0.0-20170412194111-59d56a35515b
github.com/hyperledger/fabric v2.1.1+incompatible
github.com/hyperledger/fabric-config v0.1.0
github.com/hyperledger/fabric-config v0.2.1
github.com/hyperledger/fabric-lib-go v1.0.0
github.com/hyperledger/fabric-protos-go v0.3.0
github.com/hyperledger/fabric-sdk-go v1.0.1-0.20220124135247-4f34271d9b0f
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ github.com/hyperledger/fabric-amcl v0.0.0-20210603140002-2670f91851c8/go.mod h1:
github.com/hyperledger/fabric-config v0.0.5/go.mod h1:YpITBI/+ZayA3XWY5lF302K7PAsFYjEEPM/zr3hegA8=
github.com/hyperledger/fabric-config v0.1.0 h1:TsR3y5xEoUmXWfp8tcDycjJhVvXEHiV5kfZIxuIte08=
github.com/hyperledger/fabric-config v0.1.0/go.mod h1:aeDZ0moG/qKvwLjddcqYr8+58/oNaJy3HE0tI01546c=
github.com/hyperledger/fabric-config v0.2.1 h1:CsReuxvi5c5NUyKKQOIVbHux32o+XtmDNceYLYjycxo=
github.com/hyperledger/fabric-config v0.2.1/go.mod h1:1ZfjDrsuMoM4IPKezQgTByy2vXUj8bgTXaOXaGXK5O4=
github.com/hyperledger/fabric-lib-go v1.0.0 h1:UL1w7c9LvHZUSkIvHTDGklxFv2kTeva1QI2emOVc324=
github.com/hyperledger/fabric-lib-go v1.0.0/go.mod h1:H362nMlunurmHwkYqR5uHL2UDWbQdbfz74n8kbCFsqc=
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
Expand Down

0 comments on commit 5a0c106

Please sign in to comment.