Skip to content

Commit

Permalink
Merge pull request #1949 from shiftstack/issue1948
Browse files Browse the repository at this point in the history
πŸ› v1alpha5: Fix panic in conversion when port has no binding profile
  • Loading branch information
k8s-ci-robot authored Mar 15, 2024
2 parents 654d714 + 559cbf2 commit 4ab8b3a
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 4ab8b3a

Please sign in to comment.