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
6229de47
Commit
6229de47
authored
May 29, 2024
by
Tim Leers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add current Obj for handling events
parent
c648beef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
ingress.go
pkg/controller/ingress.go
+10
-2
worker.go
pkg/controller/worker.go
+8
-3
status.go
pkg/update/status.go
+1
-0
No files found.
pkg/controller/ingress.go
View file @
6229de47
...
...
@@ -562,6 +562,7 @@ func (worker *NamespaceWorker) ings2VCLSpec(ings []*net_v1.Ingress) (
addrs
,
extName
,
extPort
,
status
:=
worker
.
ingBackend2Addrs
(
namespace
,
*
backend
)
if
status
.
IsError
()
{
status
.
Obj
=
ing
allStatus
=
append
(
allStatus
,
status
)
continue
}
...
...
@@ -569,6 +570,7 @@ func (worker *NamespaceWorker) ings2VCLSpec(ings []*net_v1.Ingress) (
getVCLSvc
(
namespace
,
backend
.
Service
.
Name
,
addrs
,
extName
,
extPort
)
if
status
.
IsError
()
{
status
.
Obj
=
ing
allStatus
=
append
(
allStatus
,
status
)
return
vclSpec
,
bcfgs
,
onlds
,
allStatus
}
...
...
@@ -605,6 +607,7 @@ func (worker *NamespaceWorker) ings2VCLSpec(ings []*net_v1.Ingress) (
path
.
Backend
)
if
status
.
IsError
()
{
status
.
Obj
=
ing
allStatus
=
append
(
allStatus
,
status
)
return
vclSpec
,
bcfgs
,
onlds
,
allStatus
}
...
...
@@ -619,6 +622,7 @@ func (worker *NamespaceWorker) ings2VCLSpec(ings []*net_v1.Ingress) (
path
.
Backend
.
Service
.
Name
,
addrs
,
extName
,
extPort
)
if
status
.
IsError
()
{
status
.
Obj
=
ing
allStatus
=
append
(
allStatus
,
status
)
return
vclSpec
,
bcfgs
,
onlds
,
allStatus
}
...
...
@@ -649,7 +653,9 @@ func (worker *NamespaceWorker) ings2VCLSpec(ings []*net_v1.Ingress) (
namespace
,
ing
.
Name
,
pathKey
.
Path
,
*
path
.
PathType
,
rule
.
Host
)
allStatus
=
append
(
allStatus
,
update
.
MakeFatal
(
msg
))
status
=
update
.
MakeFatal
(
msg
)
status
.
Obj
=
ing
allStatus
=
append
(
allStatus
,
status
)
return
vclSpec
,
bcfgs
,
onlds
,
allStatus
}
vclRule
.
PathMap
[
pathKey
]
=
vclSvc
...
...
@@ -675,7 +681,9 @@ func (worker *NamespaceWorker) ings2VCLSpec(ings []*net_v1.Ingress) (
}
vclSpec
.
Rules
=
append
(
vclSpec
.
Rules
,
vclRule
)
}
allStatus
=
append
(
allStatus
,
update
.
MakeSuccess
(
""
))
status
:=
update
.
MakeSuccess
(
""
)
status
.
Obj
=
ing
allStatus
=
append
(
allStatus
,
status
)
}
return
vclSpec
,
bcfgs
,
onlds
,
allStatus
}
...
...
pkg/controller/worker.go
View file @
6229de47
...
...
@@ -284,13 +284,18 @@ func (worker *NamespaceWorker) next() {
name
+
": "
}
}
if
len
(
status
)
==
1
{
worker
.
handleStatus
(
status
[
0
],
msgPfx
,
obj
)
return
}
// for loop over status
// maybe add field to status to indentify obj
for
_
,
s
:=
range
status
{
worker
.
handleStatus
(
s
,
msgPfx
,
obj
)
statusObj
:=
&
SyncObj
{
Type
:
Update
,
Obj
:
s
.
Obj
}
if
statusObj
.
Obj
==
nil
{
statusObj
.
Obj
=
obj
}
worker
.
handleStatus
(
s
,
msgPfx
,
statusObj
)
}
}
...
...
pkg/update/status.go
View file @
6229de47
...
...
@@ -122,6 +122,7 @@ func (t StatusType) Reason() string {
type
Status
struct
{
Msg
string
Type
StatusType
Obj
interface
{}
}
func
(
status
Status
)
String
()
string
{
...
...
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