Skip to content

Commit 957091c

Browse files
TLS insecure option functionality
1 parent 1b00942 commit 957091c

File tree

6 files changed

+11
-2
lines changed

6 files changed

+11
-2
lines changed

config/manager/custom-env.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ spec:
2424
secretKeyRef:
2525
name: netris-creds
2626
key: password
27+
- name: CONTROLLER_INSECURE
28+
value: "false"

configloader/config.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type controller struct {
1414
Host string `yaml:"host" envconfig:"CONTROLLER_HOST"`
1515
Login string `yaml:"login" envconfig:"CONTROLLER_LOGIN"`
1616
Password string `yaml:"password" envconfig:"CONTROLLER_PASSWORD"`
17+
Insecure bool `yaml:"insecure" envconfig:"CONTROLLER_INSECURE"`
1718
}
1819

1920
var Root *config

controllers/api_handler.go

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func init() {
3838
if err != nil {
3939
log.Panicf("newHTTPCredentials error %v", err)
4040
}
41+
Cred.InsecureVerify(configloader.Root.Controller.Insecure)
4142
err = Cred.LoginUser()
4243
if err != nil {
4344
log.Printf("LoginUser error %v", err)

deploy/charts/netris-operator/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.0
18+
version: 0.1.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
23-
appVersion: v0.0.1
23+
appVersion: v0.0.2
2424
home: https://github.com/netrisai/netris-operator
2525
icon: https://www.netris.ai/wp-content/uploads/2020/05/logo-600.png # [todo] Change url to permalink
2626
keywords:

deploy/charts/netris-operator/templates/_helpers.tpl

+4
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,9 @@ Create netris-opeator controller envs
102102
secretKeyRef:
103103
name: {{ .Values.controllerCreds.password.secretName }}
104104
key: {{ .Values.controllerCreds.password.key }}
105+
{{- end }}
106+
{{- if or (eq (lower (toString .Values.controller.insecure )) "true") (eq (lower (toString .Values.controller.insecure )) "false") }}
107+
- name: CONTROLLER_INSECURE
108+
value: {{ .Values.controller.insecure | quote }}
105109
{{- end -}}
106110
{{- end -}}

deploy/charts/netris-operator/values.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ controller: {}
1818
# host: http://example.com
1919
# login: login
2020
# password: pass
21+
# insecure: false
2122

2223
controllerCreds:
2324
host:

0 commit comments

Comments
 (0)