Skip to content
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

ocp: fix mapping name check #522

Merged
merged 1 commit into from
Aug 9, 2023
Merged

Conversation

bennyz
Copy link
Member

@bennyz bennyz commented Aug 9, 2023

Consider namespace/name format for source NAD

Consider namespace/name format for source NAD

Signed-off-by: Benny Zlotnik <[email protected]>
@bennyz bennyz requested a review from ahadas as a code owner August 9, 2023 15:42
@sonarcloud
Copy link

sonarcloud bot commented Aug 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
6.5% 6.5% Duplication

@@ -133,7 +135,12 @@ func (r *NetworkMap) FindNetworkByType(networkType string) (pair NetworkPair, fo
// Find network map for source name and namespace.
func (r *NetworkMap) FindNetworkByNameAndNamespace(namespace, name string) (pair NetworkPair, found bool) {
for _, pair = range r.Spec.Map {
if pair.Source.Namespace == namespace && pair.Source.Name == name {
if pair.Source.Namespace != "" {
if pair.Source.Namespace == namespace && pair.Source.Name == name {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

such a high cognitive complexity but ok, it's lower than 16... :)

@ahadas ahadas merged commit 56a92b8 into kubev2v:main Aug 9, 2023
8 checks passed
@ahadas ahadas added this to the v2.5.0 milestone Aug 9, 2023
@ahadas
Copy link
Member

ahadas commented Aug 9, 2023

@bennyz please backport

@ahadas ahadas removed this from the v2.5.0 milestone Aug 9, 2023
@bennyz bennyz deleted the fix-network-mapping branch August 15, 2023 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants