Skip to content

Commit

Permalink
fix: correct plugins config comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
GGabriele committed May 27, 2024
1 parent 0db6092 commit d01141c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/fatih/color v1.15.0
github.com/google/go-cmp v0.6.0
github.com/kong/go-apiops v0.1.33
github.com/kong/go-database-reconciler v1.11.0
github.com/kong/go-database-reconciler v1.12.0
github.com/kong/go-kong v0.55.0
github.com/mitchellh/go-homedir v1.1.0
github.com/spf13/cobra v1.8.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y7
github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/kong/go-apiops v0.1.33 h1:Y7IVksHPdHcXM6C+gPc25JiY4KRgYDAOn/jTx3sDU1k=
github.com/kong/go-apiops v0.1.33/go.mod h1:o8lzBtbCLSXCMKzzqR8dcBhB7yzPs+9csAMZ1T1hsL0=
github.com/kong/go-database-reconciler v1.11.0 h1:AowvG85lOWMZSCMZ9UpCGLAYoq/lXvoXJGc6BXH2+qU=
github.com/kong/go-database-reconciler v1.11.0/go.mod h1:fX9SV2ukbuUdVw2h1rakWTi/DUxAV9cbj4QWttoiRrc=
github.com/kong/go-database-reconciler v1.12.0 h1:8+mt2VX/j5uTByPF0dC7Xsh9LscaPjxxXErzaKbL2ik=
github.com/kong/go-database-reconciler v1.12.0/go.mod h1:fX9SV2ukbuUdVw2h1rakWTi/DUxAV9cbj4QWttoiRrc=
github.com/kong/go-kong v0.55.0 h1:lonKRzsDGk12dh9E+y+pWnY2ThXhKuMHjzBHSpCvQLw=
github.com/kong/go-kong v0.55.0/go.mod h1:i1cMgTu6RYPHSyMpviShddRnc+DML/vlpgKC00hr8kU=
github.com/kong/go-slugify v1.0.0 h1:vCFAyf2sdoSlBtLcrmDWUFn0ohlpKiKvQfXZkO5vSKY=
Expand Down
23 changes: 23 additions & 0 deletions tests/integration/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import (
)

var (
emptyOutput = `Summary:
Created: 0
Updated: 0
Deleted: 0
`

expectedOutputMasked = `updating service svc1 {
"connect_timeout": 60000,
"enabled": true,
Expand Down Expand Up @@ -742,3 +748,20 @@ func Test_Diff_Unmasked_NewerThan3x(t *testing.T) {
})
}
}

// test scope:
// - 3.5
func Test_Diff_NoDiffUnorderedArray(t *testing.T) {
runWhen(t, "enterprise", ">=3.5.0")
setup(t)

// test that the diff command does not return any changes when
// array fields are not sorted.
stateFile := "testdata/diff/004-no-diff-plugin/kong.yaml"
assert.NoError(t, sync(stateFile, "--timeout", "60"))

out, err := diff(stateFile)
assert.NoError(t, err)
assert.Equal(t, emptyOutput, out)
reset(t)
}
8 changes: 8 additions & 0 deletions tests/integration/testdata/diff/004-no-diff-plugin/kong.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_format_version: "3.0"
plugins:
- name: openid-connect
config:
extra_jwks_uris:
- https://foo.com/baz
- https://foo.com/bar
issuer: https://test.com

0 comments on commit d01141c

Please sign in to comment.