@@ -18,6 +18,7 @@ package v1alpha1
18
18
19
19
import (
20
20
"fmt"
21
+
21
22
"github.com/kfsoftware/hlf-operator/pkg/status"
22
23
"k8s.io/api/networking/v1beta1"
23
24
kubeclock "k8s.io/apimachinery/pkg/util/clock"
@@ -317,9 +318,11 @@ type Component struct {
317
318
External * ExternalCertificate `json:"external"`
318
319
}
319
320
type ExternalCertificate struct {
320
- SecretName string `json:"secretName"`
321
- CertificateKey string `json:"certificateKey"`
322
- PrivateKeyKey string `json:"privateKeyKey"`
321
+ SecretName string `json:"secretName"`
322
+ SecretNamespace string `json:"secretNamespace"`
323
+ RootCertificateKey string `json:"rootCertificateKey"`
324
+ CertificateKey string `json:"certificateKey"`
325
+ PrivateKeyKey string `json:"privateKeyKey"`
323
326
}
324
327
325
328
func (c * Component ) CAUrl () string {
@@ -341,6 +344,10 @@ type TLS struct {
341
344
Csr Csr `json:"csr"`
342
345
Enrollid string `json:"enrollid"`
343
346
Enrollsecret string `json:"enrollsecret"`
347
+
348
+ // +optional
349
+ // +nullable
350
+ External * ExternalCertificate `json:"external"`
344
351
}
345
352
type Enrollment struct {
346
353
Component Component `json:"component"`
@@ -1429,10 +1436,23 @@ type FabricOperatorAPISpec struct {
1429
1436
1430
1437
// FabricNetworkConfigSpec defines the desired state of FabricNetworkConfig
1431
1438
type FabricNetworkConfigSpec struct {
1432
- Organization string `json:"organization"`
1433
- Internal bool `json:"internal"`
1439
+ Organization string `json:"organization"`
1440
+
1441
+ Internal bool `json:"internal"`
1442
+
1434
1443
Organizations []string `json:"organizations"`
1435
- SecretName string `json:"secretName"`
1444
+
1445
+ Namespaces []string `json:"namespaces"`
1446
+
1447
+ // HLF Identities to be included in the network config
1448
+ Identities []FabricNetworkConfigIdentity `json:"identities"`
1449
+
1450
+ SecretName string `json:"secretName"`
1451
+ }
1452
+
1453
+ type FabricNetworkConfigIdentity struct {
1454
+ Name string `json:"name"`
1455
+ Namespace string `json:"namespace"`
1436
1456
}
1437
1457
1438
1458
// FabricNetworkConfigStatus defines the observed state of FabricNetworkConfig
@@ -1551,6 +1571,56 @@ type FabricChaincodeList struct {
1551
1571
Items []FabricChaincode `json:"items"`
1552
1572
}
1553
1573
1574
+ // FabricMainChannelStatus defines the observed state of FabricMainChannel
1575
+ type FabricIdentityStatus struct {
1576
+ Conditions status.Conditions `json:"conditions"`
1577
+ Message string `json:"message"`
1578
+ // Status of the FabricCA
1579
+ Status DeploymentStatus `json:"status"`
1580
+ }
1581
+
1582
+ // +genclient
1583
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1584
+ // +k8s:defaulter-gen=true
1585
+ // +kubebuilder:subresource:status
1586
+ // +kubebuilder:resource:scope=Namespaced,shortName=fabricidentity,singular=fabricidentity
1587
+ // +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.status"
1588
+ // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
1589
+ // +k8s:openapi-gen=true
1590
+
1591
+ // FabricIdentity is the Schema for the hlfs API
1592
+ type FabricIdentity struct {
1593
+ metav1.TypeMeta `json:",inline"`
1594
+ metav1.ObjectMeta `json:"metadata,omitempty"`
1595
+ Spec FabricIdentitySpec `json:"spec,omitempty"`
1596
+ Status FabricIdentityStatus `json:"status,omitempty"`
1597
+ }
1598
+
1599
+ // +kubebuilder:object:root=true
1600
+
1601
+ // FabricIdentityList contains a list of FabricIdentity
1602
+ type FabricIdentityList struct {
1603
+ metav1.TypeMeta `json:",inline"`
1604
+ metav1.ListMeta `json:"metadata,omitempty"`
1605
+ Items []FabricIdentity `json:"items"`
1606
+ }
1607
+
1608
+ // FabricIdentitySpec defines the desired state of FabricIdentity
1609
+ type FabricIdentitySpec struct {
1610
+ // +kubebuilder:validation:MinLength=1
1611
+ Cahost string `json:"cahost"`
1612
+ // +kubebuilder:validation:MinLength=1
1613
+ Caname string `json:"caname"`
1614
+ Caport int `json:"caport"`
1615
+ Catls Catls `json:"catls"`
1616
+ // +kubebuilder:validation:MinLength=1
1617
+ Enrollid string `json:"enrollid"`
1618
+ // +kubebuilder:validation:MinLength=1
1619
+ Enrollsecret string `json:"enrollsecret"`
1620
+ // +kubebuilder:validation:MinLength=1
1621
+ MSPID string `json:"mspid"`
1622
+ }
1623
+
1554
1624
// FabricMainChannelStatus defines the observed state of FabricMainChannel
1555
1625
type FabricMainChannelStatus struct {
1556
1626
Conditions status.Conditions `json:"conditions"`
@@ -1616,6 +1686,7 @@ type FabricMainChannelSpec struct {
1616
1686
// Consenters are the orderer nodes that are part of the channel consensus
1617
1687
Consenters []FabricMainChannelConsenter `json:"orderers"`
1618
1688
}
1689
+
1619
1690
type FabricMainChannelAdminPeerOrganizationSpec struct {
1620
1691
// MSP ID of the organization
1621
1692
MSPID string `json:"mspID"`
@@ -1940,5 +2011,6 @@ func init() {
1940
2011
SchemeBuilder .Register (& FabricOperatorUI {}, & FabricOperatorUIList {})
1941
2012
SchemeBuilder .Register (& FabricOperatorAPI {}, & FabricOperatorAPIList {})
1942
2013
SchemeBuilder .Register (& FabricMainChannel {}, & FabricMainChannelList {})
2014
+ SchemeBuilder .Register (& FabricIdentity {}, & FabricIdentityList {})
1943
2015
SchemeBuilder .Register (& FabricFollowerChannel {}, & FabricFollowerChannelList {})
1944
2016
}
0 commit comments