Skip to content

Commit d8388fb

Browse files
committed
Add support to read lincence from secret
This commit add support to take licence from a kubernetes secret. A kubernetes secret can be created, which can be passed through helm chart. Previous flag is still present to provide backward comptability. Signed-off-by: Vivek Singh <[email protected]>
1 parent f123aff commit d8388fb

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

chart/inlets-operator/templates/deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ spec:
5858
env:
5959
- name: client_image
6060
value: "{{.Values.clientImage}}"
61+
{{- if and .Values.proLicenseSecret.name .Values.proLicenseSecret.key }}
62+
- name: LICENSE
63+
valueFrom:
64+
secretKeyRef:
65+
name: {{ .Values.proLicenseSecret.name }}
66+
key: {{ .Values.proLicenseSecret.key }}
67+
{{- end }}
6168
volumeMounts:
6269
- mountPath: /var/secrets/inlets/
6370
name: inlets-access-key

chart/inlets-operator/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ vpcId: ""
3535
subnetId: ""
3636

3737
# Only provide LoadBalancers for Services annotated with "dev.inlets.manage=true"
38+
proLicenseSecret:
39+
name: ""
40+
key: ""
41+
3842
annotatedOnly: false
3943

4044
image: "ghcr.io/inlets/inlets-operator:0.14.1"

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,12 @@ func main() {
7373
}
7474

7575
infra.InletsClientImage = os.Getenv("client_image")
76-
7776
log.Printf("Client image: %s\n", infra.GetInletsClientImage())
7877

78+
if len(infra.ProConfig.License) == 0 {
79+
infra.ProConfig.License = os.Getenv("LICENSE")
80+
}
81+
7982
if _, err := infra.ProConfig.GetLicenseKey(); err != nil {
8083
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
8184
os.Exit(1)

0 commit comments

Comments
 (0)