generated from aws-controllers-k8s/controller-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 15
Ensure RabbitMQ Broker reaches synced status when using non-default security group #104
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
Merged
ack-prow
merged 10 commits into
aws-controllers-k8s:main
from
knottnt:rabbitmq-security-groups
Oct 2, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2459edf
Avoid sending unnecessary fields in UpdateBroker call
knottnt e5cc9c7
Only compare EngineVersion by prefix
knottnt e28fbc2
Ensure that Broker is synced in E2E test
knottnt 2041f1e
Add e2e test for RabbitMQ with non-default sg
knottnt fac0f5a
Test engine comparison logic
knottnt a8ed1c8
Update created/delete e2e test to verify update
knottnt d42701a
Fix naming of test resource
knottnt 402a132
Fix collision in test secret names
knottnt 73f4c60
Update delta_test.go
knottnt 40da041
Rebuild new code-gen version
knottnt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
*.swp | ||
*~ | ||
.idea | ||
.vscode | ||
/docs/site | ||
bin | ||
build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
ack_generate_info: | ||
build_date: "2025-09-19T17:08:59Z" | ||
build_hash: 6b4211163dcc34776b01da9a18217bac0f4103fd | ||
go_version: go1.24.6 | ||
version: v0.52.0 | ||
build_date: "2025-09-29T19:41:37Z" | ||
build_hash: ef6e2f362a0f93d4a063b0a2b416f7ab0a156843 | ||
go_version: go1.25.0 | ||
version: v0.52.0-4-gef6e2f3 | ||
api_directory_checksum: 524e0af3e7ceea86a3153c12c06091ea924d3410 | ||
api_version: v1alpha1 | ||
aws_sdk_go_version: v1.32.6 | ||
generator_config_info: | ||
file_checksum: 7d89869149ba948467065fc8d5947d9eff039b8b | ||
file_checksum: 72d5fe6ac88d647ed6c67869928f3bc12ea6a566 | ||
original_file_name: generator.yaml | ||
last_modification: | ||
reason: API generation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"). You may | ||
// not use this file except in compliance with the License. A copy of the | ||
// License is located at | ||
// | ||
// http://aws.amazon.com/apache2.0/ | ||
// | ||
// or in the "license" file accompanying this file. This file is distributed | ||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
|
||
package broker | ||
|
||
import ( | ||
"testing" | ||
|
||
svcapitypes "github.com/aws-controllers-k8s/mq-controller/apis/v1alpha1" | ||
"github.com/aws/aws-sdk-go-v2/aws" | ||
) | ||
|
||
func TestNewResourceDelta_EngineVersionPrefix(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
aEngineVersion *string | ||
bEngineVersion *string | ||
expectDelta bool | ||
}{ | ||
{ | ||
name: "a is prefix of b - no delta expected", | ||
aEngineVersion: aws.String("3.13"), | ||
bEngineVersion: aws.String("3.13.1"), | ||
expectDelta: false, | ||
}, | ||
{ | ||
name: "a is prefix of b with patch version - no delta expected", | ||
aEngineVersion: aws.String("5.18"), | ||
bEngineVersion: aws.String("5.18.4"), | ||
expectDelta: false, | ||
}, | ||
{ | ||
name: "exact match - no delta expected", | ||
aEngineVersion: aws.String("3.13.1"), | ||
bEngineVersion: aws.String("3.13.1"), | ||
expectDelta: false, | ||
}, | ||
michaelhtm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
name: "different patch versions - no delta expected", | ||
aEngineVersion: aws.String("3.13.2"), | ||
bEngineVersion: aws.String("3.13.1"), | ||
expectDelta: true, | ||
}, | ||
{ | ||
name: "different minor versions - delta expected", | ||
aEngineVersion: aws.String("3.13"), | ||
bEngineVersion: aws.String("3.14.1"), | ||
expectDelta: true, | ||
}, | ||
{ | ||
name: "a is longer than b - delta expected", | ||
aEngineVersion: aws.String("3.13.1"), | ||
bEngineVersion: aws.String("3.13"), | ||
expectDelta: true, | ||
}, | ||
{ | ||
name: "nil versions - no delta expected", | ||
aEngineVersion: nil, | ||
bEngineVersion: nil, | ||
expectDelta: false, | ||
}, | ||
{ | ||
name: "a nil, b not nil - delta expected", | ||
aEngineVersion: nil, | ||
bEngineVersion: aws.String("3.13.1"), | ||
expectDelta: true, | ||
michaelhtm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
{ | ||
name: "a not nil, b nil - delta expected", | ||
aEngineVersion: aws.String("3.13"), | ||
bEngineVersion: nil, | ||
expectDelta: true, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
a := &resource{ | ||
ko: &svcapitypes.Broker{ | ||
Spec: svcapitypes.BrokerSpec{ | ||
EngineVersion: tt.aEngineVersion, | ||
}, | ||
}, | ||
} | ||
b := &resource{ | ||
ko: &svcapitypes.Broker{ | ||
Spec: svcapitypes.BrokerSpec{ | ||
EngineVersion: tt.bEngineVersion, | ||
}, | ||
}, | ||
} | ||
|
||
delta := newResourceDelta(a, b) | ||
hasDelta := delta.DifferentAt("Spec.EngineVersion") | ||
|
||
if tt.expectDelta && !hasDelta { | ||
t.Errorf("Expected delta for EngineVersion but none found") | ||
} | ||
if !tt.expectDelta && hasDelta { | ||
t.Errorf("Expected no delta for EngineVersion but found one") | ||
} | ||
}) | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.