Skip to content

Commit

Permalink
fix: do not inject plugin.RunOn when Kong >= 2.0.0
Browse files Browse the repository at this point in the history
Kong 2.0.0 removed the `run_on` property on the `plugins` entity.
Controller's code always injects it avoid false positives during diffs.

The change nils the property for Kong 2.0 and above only to avoid any
effect on Kong Enterprise, which follows a different versioning scheme.

From #522
Fix #521
  • Loading branch information
hbagdi authored Jan 31, 2020
1 parent 894fb14 commit 8aea90b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/ingress/controller/kong.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ var (
kong110version = semver.MustParse("1.1.0")
kong120version = semver.MustParse("1.2.0")
kong130version = semver.MustParse("1.3.0")
kong200version = semver.MustParse("2.0.0")

kongEnterprise036version = semver.MustParse("0.36.0")
)
Expand Down Expand Up @@ -387,5 +388,8 @@ func (n *KongController) fillPlugin(plugin *file.FPlugin) error {
plugin.Protocols = kong.StringSlice("http", "https")
}
}
if n.cfg.Kong.Version.GTE(kong200version) {
plugin.RunOn = nil
}
return nil
}

0 comments on commit 8aea90b

Please sign in to comment.