Skip to content

Commit 145827a

Browse files
committed
Update
Signed-off-by: dviejokfs <[email protected]>
1 parent 33ecf39 commit 145827a

File tree

7 files changed

+62
-2
lines changed

7 files changed

+62
-2
lines changed

api/hlf.kungfusoftware.es/v1alpha1/hlf_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,6 +1368,13 @@ type FabricOperatorAPINetworkConfig struct {
13681368
type FabricOperatorAPIAuth struct {
13691369
OIDCJWKS string `json:"oidcJWKS"`
13701370
OIDCIssuer string `json:"oidcIssuer"`
1371+
1372+
// +kubebuilder:default:=""
1373+
OIDCAuthority string `json:"oidcAuthority"`
1374+
// +kubebuilder:default:=""
1375+
OIDCClientId string `json:"oidcClientId"`
1376+
// +kubebuilder:default:=""
1377+
OIDCScope string `json:"oidcScope"`
13711378
}
13721379

13731380
// FabricOperatorAPISpec defines the desired state of FabricOperatorAPI
@@ -1387,7 +1394,11 @@ type FabricOperatorAPISpec struct {
13871394
// +kubebuilder:validation:Default={}
13881395
Auth *FabricOperatorAPIAuth `json:"auth"`
13891396

1397+
// +kubebuilder:default:=""
1398+
LogoURL string `json:"logoUrl"`
1399+
13901400
HLFConfig FabricOperatorAPIHLFConfig `json:"hlfConfig"`
1401+
13911402
// +optional
13921403
// +kubebuilder:validation:Optional
13931404
// +nullable

charts/hlf-operator-api/templates/deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ spec:
7171
- "--auth-jwks"
7272
- "{{ .Values.auth.oidcJWKS }}"
7373
{{ end }}
74+
{{ if and .Values.auth.oidcAuthority .Values.auth.oidcScope .Values.auth.oidcClientId }}
75+
- "--auth-authority"
76+
- "{{ .Values.auth.oidcAuthority }}"
77+
- "--auth-scope"
78+
- "{{ .Values.auth.oidcScope }}"
79+
- "--auth-client-id"
80+
- "{{ .Values.auth.oidcClientId }}"
81+
{{ end }}
82+
{{ if .Values.logoUrl }}
83+
- "--logo-url"
84+
- "{{ .Values.logoUrl }}"
85+
{{ end }}
7486
livenessProbe:
7587
httpGet:
7688
path: /playground

charts/hlf-operator-api/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ image:
1414
auth:
1515
oidcJWKS: ""
1616
oidcIssuer: ""
17+
oidcAuthority: ""
18+
oidcClientId: ""
19+
oidcScope: ""
20+
21+
logoUrl: "xxxxxx"
22+
1723

1824
hlf:
1925
mspID: ""

charts/hlf-operator-ui/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ image:
1313

1414

1515
logoUrl: ""
16+
1617
auth:
1718
oidcAuthority: ""
1819
oidcClientId: ""

config/crd/bases/hlf.kungfusoftware.es_fabricoperatorapis.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,13 +866,25 @@ spec:
866866
auth:
867867
nullable: true
868868
properties:
869+
oidcAuthority:
870+
default: ""
871+
type: string
872+
oidcClientId:
873+
default: ""
874+
type: string
869875
oidcIssuer:
870876
type: string
871877
oidcJWKS:
872878
type: string
879+
oidcScope:
880+
default: ""
881+
type: string
873882
required:
883+
- oidcAuthority
884+
- oidcClientId
874885
- oidcIssuer
875886
- oidcJWKS
887+
- oidcScope
876888
type: object
877889
env:
878890
items:
@@ -1100,6 +1112,9 @@ spec:
11001112
required:
11011113
- ingressGateway
11021114
type: object
1115+
logoUrl:
1116+
default: ""
1117+
type: string
11031118
replicas:
11041119
type: integer
11051120
resources:
@@ -1177,6 +1192,7 @@ spec:
11771192
- imagePullPolicy
11781193
- ingress
11791194
- istio
1195+
- logoUrl
11801196
- replicas
11811197
- tag
11821198
type: object

controllers/operatorapi/operatorapi.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,13 @@ func GetConfig(conf *hlfv1alpha1.FabricOperatorAPI) (*HLFOperatorAPIChart, error
488488
if spec.Auth != nil {
489489
auth.OIDCJWKS = spec.Auth.OIDCJWKS
490490
auth.OIDCIssuer = spec.Auth.OIDCIssuer
491+
auth.OIDCAuthority = spec.Auth.OIDCAuthority
492+
auth.OIDCClientId = spec.Auth.OIDCClientId
493+
auth.OIDCScope = spec.Auth.OIDCScope
491494
}
492495
var c = HLFOperatorAPIChart{
493496
ReplicaCount: spec.Replicas,
497+
LogoURL: spec.LogoURL,
494498
Image: Image{
495499
Repository: spec.Image,
496500
Tag: spec.Tag,

controllers/operatorapi/types.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,31 @@ type Image struct {
1010
PullPolicy corev1.PullPolicy `json:"pullPolicy"`
1111
Tag string `json:"tag"`
1212
}
13+
1314
type ServiceAccount struct {
1415
Create bool `json:"create"`
1516
Annotations map[string]string `json:"annotations"`
1617
Name string `json:"name"`
1718
}
19+
1820
type Service struct {
1921
Type string `json:"type"`
2022
Port int `json:"port"`
2123
}
24+
2225
type Autoscaling struct {
2326
Enabled bool `json:"enabled"`
2427
MinReplicas int `json:"minReplicas"`
2528
MaxReplicas int `json:"maxReplicas"`
2629
TargetCPUUtilizationPercentage int `json:"targetCPUUtilizationPercentage"`
2730
}
31+
2832
type HLFConfig struct {
2933
MspID string `json:"mspID"`
3034
User string `json:"user"`
3135
NetworkConfig HLFNetworkConfig `json:"networkConfig"`
3236
}
37+
3338
type HLFNetworkConfig struct {
3439
SecretName string `json:"secretName"`
3540
Key string `json:"key"`
@@ -47,13 +52,15 @@ type IngressHost struct {
4752
Host string `json:"host"`
4853
Paths []IngressPath `json:"paths"`
4954
}
55+
5056
type IngressPath struct {
5157
Path string `json:"path"`
5258
PathType string `json:"pathType"`
5359
}
5460

5561
type HLFOperatorAPIChart struct {
5662
ReplicaCount int `json:"replicaCount"`
63+
LogoURL string `json:"logoUrl"`
5764
Image Image `json:"image"`
5865
Hlf HLFConfig `json:"hlf,omitempty"`
5966
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets"`
@@ -69,6 +76,9 @@ type HLFOperatorAPIChart struct {
6976
}
7077

7178
type Auth struct {
72-
OIDCJWKS string `json:"oidcJWKS"`
73-
OIDCIssuer string `json:"oidcIssuer"`
79+
OIDCJWKS string `json:"oidcJWKS"`
80+
OIDCIssuer string `json:"oidcIssuer"`
81+
OIDCAuthority string `json:"oidcAuthority"`
82+
OIDCClientId string `json:"oidcClientId"`
83+
OIDCScope string `json:"oidcScope"`
7484
}

0 commit comments

Comments
 (0)