Skip to content

Commit

Permalink
v1alpha5: Fix panic in conversion when port has no binding profile
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbooth committed Mar 14, 2024
1 parent 654d714 commit 559cbf2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions api/v1alpha5/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,16 @@ func Convert_v1beta1_PortOpts_To_v1alpha5_PortOpts(in *infrav1.PortOpts, out *Po
}
}

out.Profile = make(map[string]string)
if pointer.BoolDeref(in.Profile.OVSHWOffload, false) {
(out.Profile)["capabilities"] = "[\"switchdev\"]"
}
if pointer.BoolDeref(in.Profile.TrustedVF, false) {
(out.Profile)["trusted"] = trueString
if in.Profile != nil {
out.Profile = make(map[string]string)
if pointer.BoolDeref(in.Profile.OVSHWOffload, false) {
(out.Profile)["capabilities"] = "[\"switchdev\"]"
}
if pointer.BoolDeref(in.Profile.TrustedVF, false) {
(out.Profile)["trusted"] = trueString
}
}

return nil
}

Expand Down

0 comments on commit 559cbf2

Please sign in to comment.