Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
k8s-ingress
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-ingress
Commits
4cc092c4
Commit
4cc092c4
authored
Jul 21, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix: TLS Secret invalid (status Fatal) if tls.crt or .key is empty.
parent
611199e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
secret.go
pkg/controller/secret.go
+7
-5
No files found.
pkg/controller/secret.go
View file @
4cc092c4
...
...
@@ -107,16 +107,18 @@ func (worker *NamespaceWorker) updateCertSecret(
string
(
api_v1
.
SecretTypeTLS
))
}
crt
,
ok
:=
tlsSecret
.
Data
[
"tls.crt"
]
if
!
ok
{
if
!
ok
||
len
(
crt
)
==
0
{
return
update
.
MakeFatal
(
"Ingress TLS Secret %s/%s: key tls.crt not found"
,
"Ingress TLS Secret %s/%s: key tls.crt not found "
+
"or empty"
,
tlsSecret
.
ObjectMeta
.
Namespace
,
tlsSecret
.
ObjectMeta
.
Name
)
}
key
,
ok
:=
tlsSecret
.
Data
[
"tls.key"
]
if
!
ok
{
if
!
ok
||
len
(
key
)
==
0
{
return
update
.
MakeFatal
(
"Ingress TLS Secret %s/%s: key tls.key not found"
,
"Ingress TLS Secret %s/%s: key tls.key not found "
+
"or empty"
,
tlsSecret
.
ObjectMeta
.
Namespace
,
tlsSecret
.
ObjectMeta
.
Name
)
}
...
...
@@ -127,7 +129,7 @@ func (worker *NamespaceWorker) updateCertSecret(
return
update
.
MakeIncomplete
(
"%v"
,
err
)
}
pem
:=
string
(
crt
)
if
crt
[
len
(
crt
)
-
1
]
!=
byte
(
'\n'
)
{
if
len
(
crt
)
>
1
&&
crt
[
len
(
crt
)
-
1
]
!=
byte
(
'\n'
)
{
pem
+=
"
\n
"
}
pem
+=
string
(
key
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment