-
Notifications
You must be signed in to change notification settings - Fork 110
🐛 fixes issue when we update the clustermanager with new labels. #1047
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package util | ||
|
||
// MapConsists checks if the initialMap is a subset of the entireMap. | ||
func MapConsists(initialMap, entireMap map[string]string) bool { | ||
if len(initialMap) == 0 { | ||
println("Initial map is empty, returning true") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove debug print statements from library code. The if len(initialMap) == 0 {
- println("Initial map is empty, returning true")
return true
}
for key, value := range initialMap {
if entireMap[key] != value {
- println("Map does not consist, returning false")
return false
}
}
- println("Map consists of the required values, returning true")
return true Also applies to: 11-11, 15-15 🤖 Prompt for AI Agents
|
||
return true | ||
} | ||
for key, value := range initialMap { | ||
if entireMap[key] != value { | ||
println("Map does not consist, returning false") | ||
return false | ||
} | ||
} | ||
println("Map consists of the required values, returning true") | ||
return 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.
Fix MapConsists usage - missing assertions.
The
util.MapConsists
calls are not being used properly for testing. The function returns a boolean, but you're not asserting on the result. This means the test will pass even if the label subset check fails.Apply similar fixes to all MapConsists calls in this test. Note that I've also swapped the parameter order based on the function's expected behavior (initialMap should be the expected labels, entireMap should be the actual deployment labels).
Also applies to: 1228-1228, 1238-1238, 1248-1248, 1258-1258, 1269-1269
🤖 Prompt for AI Agents