Skip to content

Commit 45bf73d

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 45bf73d

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,18 @@ func main() {
7474

7575
infra.InletsClientImage = os.Getenv("client_image")
7676

77-
log.Printf("Client image: %s\n", infra.GetInletsClientImage())
77+
if len(infra.ProConfig.License) == 0 {
78+
infra.ProConfig.License = os.Getenv("LICENSE")
79+
}
7880

7981
if _, err := infra.ProConfig.GetLicenseKey(); err != nil {
8082
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
8183
os.Exit(1)
8284
}
8385

86+
log.Printf("Inlets client: %s\n", infra.GetInletsClientImage())
87+
log.Printf("Inlets pro: %v\n", infra.UsePro())
88+
8489
// set up signals so we handle the first shutdown signal gracefully
8590
stopCh := signals.SetupSignalHandler()
8691

0 commit comments

Comments
 (0)