mirror of
https://github.com/containers/podman.git
synced 2026-07-12 16:25:08 -04:00
This was implemented by containers/netavark #1369; this commit completes the process by wiring it into Podman. We now respect the CLI order for configured networks - if a user passes `--net net1,net2` we guarantee that net1 will be configured before net2. For containers created before this patch, we don't retain enough information to configure networks in CLI order, so we use alphabetical order instead to still guarantee consistency. No breaking API changes have been made, but we do add a new field to supplement the existing map to (optionally) provide ordering information. The Podman CLI will always pass this. Existing applications that do not will, again, receive] deterministic ordering based on an alphabetical sort of network names. This requires the latest version of Netavark to work properly. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
56 lines
1.4 KiB
Go
56 lines
1.4 KiB
Go
//go:build !linux
|
|
|
|
/*
|
|
Copyright The containerd Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License 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 platforms
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
)
|
|
|
|
func getCPUVariant() (string, error) {
|
|
var variant string
|
|
|
|
switch runtime.GOOS {
|
|
case "windows", "darwin":
|
|
// Windows/Darwin only supports v7 for ARM32 and v8 for ARM64 and so we can use
|
|
// runtime.GOARCH to determine the variants
|
|
switch runtime.GOARCH {
|
|
case "arm64":
|
|
variant = "v8"
|
|
case "arm":
|
|
variant = "v7"
|
|
default:
|
|
variant = "unknown"
|
|
}
|
|
case "freebsd":
|
|
// FreeBSD supports ARMv6 and ARMv7 as well as ARMv4 and ARMv5 (though deprecated)
|
|
// detecting those variants is currently unimplemented
|
|
switch runtime.GOARCH {
|
|
case "arm64":
|
|
variant = "v8"
|
|
default:
|
|
variant = "unknown"
|
|
}
|
|
default:
|
|
return "", fmt.Errorf("getCPUVariant for OS %s: %v", runtime.GOOS, errNotImplemented)
|
|
}
|
|
|
|
return variant, nil
|
|
}
|