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
1bd42928
Commit
1bd42928
authored
May 22, 2024
by
Tim Leers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
collect all status and return them
parent
1d3e51ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
14 deletions
+27
-14
ingress.go
pkg/controller/ingress.go
+27
-13
worker.go
pkg/controller/worker.go
+0
-1
No files found.
pkg/controller/ingress.go
View file @
1bd42928
...
...
@@ -1218,7 +1218,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
vcfgs
,
err
:=
worker
.
vcfg
.
List
(
labels
.
Everything
())
if
err
!=
nil
{
if
!
errors
.
IsNotFound
(
err
)
{
return
[]
update
.
Status
{
update
.
MakeRecoverable
(
"%v"
,
err
)}
allStatus
=
append
(
allStatus
,
update
.
MakeRecoverable
(
"%v"
,
err
))
return
allStatus
}
}
for
_
,
v
:=
range
vcfgs
{
...
...
@@ -1237,14 +1238,17 @@ func (worker *NamespaceWorker) addOrUpdateIng(
svc
.
Namespace
,
svc
.
Name
)
if
status
:=
worker
.
configSharding
(
&
vclSpec
,
vcfg
,
svc
);
status
.
IsError
()
{
return
[]
update
.
Status
{
status
}
allStatus
=
append
(
allStatus
,
status
)
return
allStatus
}
if
err
:=
worker
.
configAuth
(
&
vclSpec
,
vcfg
);
err
!=
nil
{
return
[]
update
.
Status
{
update
.
MakeIncomplete
(
"%v"
,
err
)}
allStatus
=
append
(
allStatus
,
update
.
MakeIncomplete
(
"%v"
,
err
))
return
allStatus
}
worker
.
configACL
(
&
vclSpec
,
vcfg
)
if
err
:=
worker
.
configRewrites
(
&
vclSpec
,
vcfg
);
err
!=
nil
{
return
[]
update
.
Status
{
update
.
MakeFatal
(
"%v"
,
err
)}
allStatus
=
append
(
allStatus
,
update
.
MakeFatal
(
"%v"
,
err
))
return
allStatus
}
worker
.
configReqDisps
(
&
vclSpec
,
vcfg
.
Spec
.
ReqDispositions
,
vcfg
.
Kind
,
vcfg
.
Namespace
,
vcfg
.
Name
)
...
...
@@ -1261,7 +1265,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
// Varnish is ready.
offldrSpec
,
err
:=
worker
.
ings2OffloaderSpec
(
svc
,
ings
)
if
err
!=
nil
{
return
[]
update
.
Status
{
update
.
MakeFatal
(
"%v"
,
err
)}
allStatus
=
append
(
allStatus
,
update
.
MakeFatal
(
"%v"
,
err
))
return
allStatus
}
offldrSpec
.
Defaults
=
&
haproxyDefSpec
for
n
,
v
:=
range
onlds
{
...
...
@@ -1272,7 +1277,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
ingNames
)
}
else
{
if
secrKey
,
dSecr
,
err
:=
worker
.
getDplaneSecret
();
err
!=
nil
{
return
[]
update
.
Status
{
update
.
MakeIncomplete
(
"%s"
,
err
)}
allStatus
=
append
(
allStatus
,
update
.
MakeIncomplete
(
"%s"
,
err
))
return
allStatus
}
else
if
dSecr
==
nil
{
worker
.
log
.
Warnf
(
"Service %s: Currently no known "
+
"dataplane Secret"
,
svcKey
)
...
...
@@ -1286,7 +1292,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
addrs
,
offldAddrs
,
serviceStatus
:=
worker
.
svc2Addrs
(
svc
)
if
serviceStatus
.
IsError
()
{
return
[]
update
.
Status
{
serviceStatus
}
allStatus
=
append
(
allStatus
,
serviceStatus
)
return
allStatus
}
if
len
(
offldrSpec
.
Secrets
)
!=
0
||
len
(
onlds
)
!=
0
{
...
...
@@ -1300,13 +1307,15 @@ func (worker *NamespaceWorker) addOrUpdateIng(
}
if
status
:=
worker
.
hController
.
Update
(
svcKey
,
offldAddrs
,
offldrSpec
);
status
.
IsError
()
{
return
[]
update
.
Status
{
status
}
allStatus
=
append
(
allStatus
,
status
)
return
allStatus
}
for
_
,
tlsSecr
:=
range
offldrSpec
.
Secrets
{
status
:=
worker
.
hController
.
AddOrUpdateTLSSecret
(
svcKey
,
tlsSecr
)
if
status
.
IsError
()
{
return
[]
update
.
Status
{
status
}
allStatus
=
append
(
allStatus
,
status
)
return
allStatus
}
worker
.
log
.
Infof
(
"Ingress TLS Secret %s/%s: "
+
"Service %s: %s"
,
tlsSecr
.
Namespace
,
...
...
@@ -1316,7 +1325,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
secret
,
err
:=
worker
.
setAdmSecretForSvc
(
svc
)
if
err
!=
nil
{
return
[]
update
.
Status
{
IncompleteIfNotFound
(
err
,
"%v"
,
err
)}
allStatus
=
append
(
allStatus
,
IncompleteIfNotFound
(
err
,
"%v"
,
err
))
return
allStatus
}
secretKey
:=
secret
.
Namespace
+
"/"
+
secret
.
Name
updateSvcStatus
:=
worker
.
vController
.
UpdateSvcForSecret
(
svcKey
,
secretKey
)
...
...
@@ -1324,7 +1334,8 @@ func (worker *NamespaceWorker) addOrUpdateIng(
// Only abort on fatal errors.
// Recoverable or Incomplete status may be
// resolved by the upcoming update.
return
[]
update
.
Status
{
updateSvcStatus
}
allStatus
=
append
(
allStatus
,
updateSvcStatus
)
return
allStatus
}
worker
.
hController
.
SetOffldSecret
(
svcKey
,
secretKey
)
...
...
@@ -1368,13 +1379,16 @@ func (worker *NamespaceWorker) addOrUpdateIng(
controllerStatus
:=
worker
.
vController
.
Update
(
svcKey
,
vclSpec
,
addrs
,
ingsMeta
,
vcfgMeta
,
bcfgMeta
)
if
controllerStatus
.
IsError
()
{
return
[]
update
.
Status
{
controllerStatus
}
allStatus
=
append
(
allStatus
,
controllerStatus
)
return
allStatus
}
worker
.
log
.
Debugf
(
"Updated config svc=%s ingressMetaData=%+v "
+
"vcfgMetaData=%+v bcfgMetaData=%+v: %+v"
,
svcKey
,
ingsMeta
,
vcfgMeta
,
bcfgMeta
,
vclSpec
)
}
return
[]
update
.
Status
{
worker
.
updateIngStatus
(
svc
,
ings
)}
allStatus
=
append
(
allStatus
,
worker
.
updateIngStatus
(
svc
,
ings
))
return
allStatus
}
// We only handle Ingresses whose IngressClass is set to the value
...
...
pkg/controller/worker.go
View file @
1bd42928
...
...
@@ -276,7 +276,6 @@ func (worker *NamespaceWorker) next() {
}
defer
worker
.
queue
.
Done
(
obj
)
// if ingress dispatchIngress
status
:=
worker
.
dispatch
(
obj
)
msgPfx
:=
""
if
syncObj
,
ok
:=
obj
.
(
*
SyncObj
);
ok
{
...
...
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