mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
Merge pull request #18326 from cevich/f38_update
Cirrus: Update CI VM Image to F38
This commit is contained in:
20
.cirrus.yml
20
.cirrus.yml
@ -26,14 +26,15 @@ env:
|
||||
####
|
||||
#### Cache-image names to test with (double-quotes around names are critical)
|
||||
####
|
||||
FEDORA_NAME: "fedora-37"
|
||||
FEDORA_NAME: "fedora-38"
|
||||
FEDORA_AARCH64_NAME: "${FEDORA_NAME}-aarch64"
|
||||
PRIOR_FEDORA_NAME: "fedora-36"
|
||||
PRIOR_FEDORA_NAME: "fedora-37"
|
||||
RAWHIDE_NAME: "rawhide"
|
||||
DEBIAN_NAME: "debian-12"
|
||||
|
||||
# Image identifiers
|
||||
IMAGE_SUFFIX: "c20230420t184033z-f37f36d12"
|
||||
IMAGE_SUFFIX: "c20230426t140447z-f38f37d12"
|
||||
|
||||
# EC2 images
|
||||
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"
|
||||
FEDORA_AARCH64_AMI: "fedora-podman-aws-arm64-${IMAGE_SUFFIX}"
|
||||
@ -219,7 +220,7 @@ build_aarch64_task:
|
||||
# This confirms the binaries can be executed, checks --help vs docs, and
|
||||
# other essential post-build validation checks.
|
||||
validate_task:
|
||||
name: "Validate $DISTRO_NV Build"
|
||||
name: "Validate ${DISTRO_NV} Build"
|
||||
alias: validate
|
||||
# This task is primarily intended to catch human-errors early on, in a
|
||||
# PR. Skip it for branch-push, branch-create, and tag-push to improve
|
||||
@ -235,9 +236,16 @@ validate_task:
|
||||
<<: *standardvm
|
||||
cpu: 8
|
||||
memory: "16Gb"
|
||||
matrix:
|
||||
- env:
|
||||
<<: *stdenvars
|
||||
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
|
||||
DISTRO_NV: ${FEDORA_NAME}
|
||||
- env:
|
||||
<<: *stdenvars
|
||||
VM_IMAGE_NAME: ${RAWHIDE_CACHE_IMAGE_NAME}
|
||||
DISTRO_NV: ${RAWHIDE_NAME}
|
||||
env:
|
||||
<<: *stdenvars
|
||||
DISTRO_NV: ${FEDORA_NAME}
|
||||
TEST_FLAVOR: validate
|
||||
# N/B: This script depends on ${DISTRO_NV} being defined for the task.
|
||||
clone_script: &get_gosrc |
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@ -118,13 +117,6 @@ type Runtime struct {
|
||||
secretsManager *secrets.SecretsManager
|
||||
}
|
||||
|
||||
func init() {
|
||||
// generateName calls namesgenerator.GetRandomName which the
|
||||
// global RNG from math/rand. Seed it here to make sure we
|
||||
// don't get the same name every time.
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
}
|
||||
|
||||
// SetXdgDirs ensures the XDG_RUNTIME_DIR env and XDG_CONFIG_HOME variables are set.
|
||||
// containers/image uses XDG_RUNTIME_DIR to locate the auth file, XDG_CONFIG_HOME is
|
||||
// use for the containers.conf configuration file.
|
||||
|
18
libpod/runtime_pre_go1.20.go
Normal file
18
libpod/runtime_pre_go1.20.go
Normal file
@ -0,0 +1,18 @@
|
||||
// In go 1.20 and later, the global RNG is automatically initialized.
|
||||
// Ref: https://pkg.go.dev/math/rand@go1.20#Seed
|
||||
//go:build !go1.20
|
||||
// +build !go1.20
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// generateName calls namesgenerator.GetRandomName which the
|
||||
// global RNG from math/rand. Seed it here to make sure we
|
||||
// don't get the same name every time.
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package libpod
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
@ -19,10 +18,8 @@ func Test_generateName(t *testing.T) {
|
||||
}
|
||||
|
||||
// Test that (*Runtime).generateName returns different names
|
||||
// if called twice, even if the global RNG has the default
|
||||
// seed.
|
||||
// if called twice.
|
||||
n1, _ := r.generateName()
|
||||
rand.Seed(1)
|
||||
n2, _ := r.generateName()
|
||||
assert.NotEqual(t, n1, n2)
|
||||
}
|
||||
|
@ -430,11 +430,11 @@ func GetPortLock(port string) *lockfile.LockFile {
|
||||
// collisions during parallel tests
|
||||
func GetRandomIPAddress() string {
|
||||
// To avoid IP collisions of initialize random seed for random IP addresses
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
rng := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
// Add GinkgoParallelProcess() on top of the IP address
|
||||
// in case of the same random seed
|
||||
ip3 := strconv.Itoa(rand.Intn(230) + GinkgoParallelProcess())
|
||||
ip4 := strconv.Itoa(rand.Intn(230) + GinkgoParallelProcess())
|
||||
ip3 := strconv.Itoa(rng.Intn(230) + GinkgoParallelProcess())
|
||||
ip4 := strconv.Itoa(rng.Intn(230) + GinkgoParallelProcess())
|
||||
return "10.88." + ip3 + "." + ip4
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user