-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing a generic Ingress based on Lua And A/B Testing Release #86
Implementing a generic Ingress based on Lua And A/B Testing Release #86
Conversation
Codecov Report
@@ Coverage Diff @@
## master #86 +/- ##
==========================================
+ Coverage 16.11% 19.01% +2.90%
==========================================
Files 30 33 +3
Lines 3482 3703 +221
==========================================
+ Hits 561 704 +143
- Misses 2821 2874 +53
- Partials 100 125 +25
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
235cb04
to
8da90a4
Compare
pkg/util/lua_configuration.go
Outdated
if f.IsDir() { | ||
return nil | ||
} | ||
data, err := ioutil.ReadFile(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G304: Potential file inclusion via variable
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
pkg/util/lua_configuration.go
Outdated
|
||
import ( | ||
"io/ioutil" | ||
"k8s.io/klog/v2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goimports: File is not goimports
-ed
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
@@ -0,0 +1,31 @@ | |||
annotations = obj.annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 5 similar findings have been found in this PR
W111: setting non-standard global variable 'annotations'
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 17 |
lua_configuration/trafficrouting_ingress/aliyun-mse.lua | 1 |
lua_configuration/trafficrouting_ingress/aliyun-mse.lua | 17 |
lua_configuration/trafficrouting_ingress/nginx.lua | 1 |
lua_configuration/trafficrouting_ingress/nginx.lua | 17 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sonatype-lift ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've recorded this as ignored for this pull request.
If you change your mind, just comment @sonatype-lift unignore
.
@@ -0,0 +1,31 @@ | |||
annotations = obj.annotations | |||
annotations["alb.ingress.kubernetes.io/canary"] = "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 32 similar findings have been found in this PR
W112: mutating non-standard global variable 'annotations'
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 3 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 4 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 5 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 6 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 7 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 10 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 20 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 22 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 25 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 27 |
Showing 10 of 32 findings. Visit the Lift Web Console to see all.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sonatype-lift ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've recorded this as ignored for this pull request.
If you change your mind, just comment @sonatype-lift unignore
.
@@ -0,0 +1,31 @@ | |||
annotations = obj.annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 38 similar findings have been found in this PR
W113: accessing undefined variable 'obj'
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 8 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 10 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 12 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 14 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 16 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 18 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 20 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 22 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 23 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 25 |
Showing 10 of 38 findings. Visit the Lift Web Console to see all.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sonatype-lift ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've recorded this as ignored for this pull request.
If you change your mind, just comment @sonatype-lift unignore
.
8da90a4
to
73ffa55
Compare
pkg/util/lua_configuration.go
Outdated
return nil | ||
} | ||
var data []byte | ||
data, err = ioutil.ReadFile(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G304: Potential file inclusion via variable
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
pkg/util/lua_configuration.go
Outdated
|
||
func init() { | ||
luaConfigurationList = map[string]string{} | ||
filepath.Walk("./lua_configuration", func(path string, f os.FileInfo, err error) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SA4009: argument err is overwritten before first use
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
73ffa55
to
2205cb7
Compare
2205cb7
to
7016e0a
Compare
@@ -0,0 +1,35 @@ | |||
annotations = obj.annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 8 similar findings have been found in this PR
W111: setting non-standard global variable 'annotations'
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 4 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 21 |
lua_configuration/trafficrouting_ingress/aliyun-mse.lua | 1 |
lua_configuration/trafficrouting_ingress/aliyun-mse.lua | 4 |
lua_configuration/trafficrouting_ingress/aliyun-mse.lua | 21 |
lua_configuration/trafficrouting_ingress/nginx.lua | 1 |
lua_configuration/trafficrouting_ingress/nginx.lua | 4 |
lua_configuration/trafficrouting_ingress/nginx.lua | 21 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
then | ||
annotations = {} | ||
end | ||
annotations["alb.ingress.kubernetes.io/canary"] = "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 32 similar findings have been found in this PR
W112: mutating non-standard global variable 'annotations'
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 7 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 8 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 9 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 10 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 11 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 14 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 24 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 26 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 29 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 31 |
Showing 10 of 32 findings. Visit the Lift Web Console to see all.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
@@ -0,0 +1,35 @@ | |||
annotations = obj.annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 41 similar findings have been found in this PR
W113: accessing undefined variable 'obj'
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 2 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 12 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 14 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 16 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 18 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 20 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 22 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 24 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 26 |
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 27 |
Showing 10 of 41 findings. Visit the Lift Web Console to see all.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
c8df109
to
d0c7c6d
Compare
pkg/util/luamanager/json.go
Outdated
"encoding/json" | ||
"errors" | ||
|
||
"github.com/yuin/gopher-lua" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goimports: File is not goimports
-ed
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
a86836d
to
d1b14f9
Compare
f309156
to
be0c76c
Compare
@@ -0,0 +1,35 @@ | |||
annotations = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 5 similar findings have been found in this PR
W111: setting non-standard global variable 'annotations'
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 4 |
lua_configuration/trafficrouting_ingress/aliyun-mse.lua | 1 |
lua_configuration/trafficrouting_ingress/aliyun-mse.lua | 4 |
lua_configuration/trafficrouting_ingress/nginx.lua | 1 |
lua_configuration/trafficrouting_ingress/nginx.lua | 4 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
@@ -0,0 +1,35 @@ | |||
annotations = {} | |||
if ( obj.annotations ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 5 similar findings have been found in this PR
W113: accessing undefined variable 'obj'
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
lua_configuration/trafficrouting_ingress/aliyun-alb.lua | 4 |
lua_configuration/trafficrouting_ingress/aliyun-mse.lua | 2 |
lua_configuration/trafficrouting_ingress/aliyun-mse.lua | 4 |
lua_configuration/trafficrouting_ingress/nginx.lua | 2 |
lua_configuration/trafficrouting_ingress/nginx.lua | 4 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
be0c76c
to
b8531f8
Compare
@@ -0,0 +1,5 @@ | |||
# Ignore results from vendor directories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lift Configuration Added: Key: ignoreFiles
New value: vendor/
lua_configuration/
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
b8531f8
to
1ff521d
Compare
Signed-off-by: liheng.zms <liheng.zms@alibaba-inc.com>
1ff521d
to
015ab3f
Compare
9a4e9aa
to
67714bd
Compare
api/v1alpha1/rollout_types.go
Outdated
@@ -141,7 +149,8 @@ type TrafficRouting struct { | |||
|
|||
// IngressTrafficRouting configuration for ingress controller to control traffic routing | |||
type IngressTrafficRouting struct { | |||
// ClassType refers to the class type of an `Ingress`, e.g. Nginx. Default is Nginx | |||
// ClassType refers to the type of `Ingress`. | |||
// current support nginx, aliyun-alb, aliyun-mse. default is nginx. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aliyun-mse is not in the lua_configuration
return false, nil | ||
} | ||
// First, set canary route 0 weight. | ||
newAnnotations, err := r.executeLuaForCanary(canaryIngress.Annotations, utilpointer.Int32(0), nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz make sure that we use zero weight or -1 weight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is setting weight=0, because I want to set zero traffic to canary service first. And second delete the canary ingress.
func (r *gatewayController) buildDesiredHTTPRoute(rules []gatewayv1alpha2.HTTPRouteRule, weight *int32, matches []rolloutv1alpha1.HttpRouteMatch) []gatewayv1alpha2.HTTPRouteRule { | ||
var desired []gatewayv1alpha2.HTTPRouteRule | ||
// Only when finalize method parameter weight=-1, then we need to remove the canary route policy and restore to the original configuration | ||
if weight != nil && *weight == -1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we replace hard coded special value -1 with nil ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot, because step.weight=nil is valid parameter. weight=-1 specifically refers to the need to delete the canary configuration.
end | ||
for _,match in pairs(obj.matches) | ||
do | ||
if ( not (match or match.headers) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz include a test that use json in the lua script
Signed-off-by: liheng.zms <liheng.zms@alibaba-inc.com>
67714bd
to
aab4903
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: furykerry The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: liheng.zms liheng.zms@alibaba-inc.com
Ⅰ. Describe what this PR does