common: merge all *ToPtr methods to one generic ToPtr
After introducing Go 1.18 to a project, it's required by law to convert at least one method to a generic one. Everyone hates IntToPtr, StringToPtr, BoolToPtr and Uint64ToPtr, so let's convert them to the ultimate generic ToPtr one. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
0359647a82
commit
b997142db0
46 changed files with 397 additions and 392 deletions
|
|
@ -6,26 +6,27 @@ import (
|
|||
"strings"
|
||||
|
||||
compute "cloud.google.com/go/compute/apiv1"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"google.golang.org/api/option"
|
||||
computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
// Guest OS Features for RHEL8 images
|
||||
var GuestOsFeaturesRHEL8 []*computepb.GuestOsFeature = []*computepb.GuestOsFeature{
|
||||
{Type: common.StringToPtr(computepb.GuestOsFeature_UEFI_COMPATIBLE.String())},
|
||||
{Type: common.StringToPtr(computepb.GuestOsFeature_VIRTIO_SCSI_MULTIQUEUE.String())},
|
||||
{Type: common.StringToPtr(computepb.GuestOsFeature_SEV_CAPABLE.String())},
|
||||
{Type: common.ToPtr(computepb.GuestOsFeature_UEFI_COMPATIBLE.String())},
|
||||
{Type: common.ToPtr(computepb.GuestOsFeature_VIRTIO_SCSI_MULTIQUEUE.String())},
|
||||
{Type: common.ToPtr(computepb.GuestOsFeature_SEV_CAPABLE.String())},
|
||||
}
|
||||
|
||||
// Guest OS Features for RHEL9 images. Note that if you update this, also
|
||||
// consider changing the code in https://github.com/coreos/coreos-assembler/blob/0083086c4720b602b8243effb85c0a1f73f013dd/mantle/platform/api/gcloud/image.go#L105
|
||||
// for RHEL CoreOS which uses coreos-assembler today.
|
||||
var GuestOsFeaturesRHEL9 []*computepb.GuestOsFeature = []*computepb.GuestOsFeature{
|
||||
{Type: common.StringToPtr(computepb.GuestOsFeature_UEFI_COMPATIBLE.String())},
|
||||
{Type: common.StringToPtr(computepb.GuestOsFeature_VIRTIO_SCSI_MULTIQUEUE.String())},
|
||||
{Type: common.StringToPtr(computepb.GuestOsFeature_SEV_CAPABLE.String())},
|
||||
{Type: common.StringToPtr(computepb.GuestOsFeature_GVNIC.String())},
|
||||
{Type: common.ToPtr(computepb.GuestOsFeature_UEFI_COMPATIBLE.String())},
|
||||
{Type: common.ToPtr(computepb.GuestOsFeature_VIRTIO_SCSI_MULTIQUEUE.String())},
|
||||
{Type: common.ToPtr(computepb.GuestOsFeature_SEV_CAPABLE.String())},
|
||||
{Type: common.ToPtr(computepb.GuestOsFeature_GVNIC.String())},
|
||||
}
|
||||
|
||||
// GuestOsFeaturesByDistro returns the the list of Guest OS Features, which
|
||||
|
|
@ -60,9 +61,11 @@ func GuestOsFeaturesByDistro(distroName string) []*computepb.GuestOsFeature {
|
|||
// object - Google storage object name of the uploaded image
|
||||
// imageName - Desired image name after the import. This must be unique within the whole project.
|
||||
// regions - A list of valid Google Storage regions where the resulting image should be located.
|
||||
//
|
||||
// It is possible to specify multiple regions. Also multi and dual regions are allowed.
|
||||
// If not provided, the region of the used Storage object is used.
|
||||
// See: https://cloud.google.com/storage/docs/locations
|
||||
//
|
||||
// guestOsFeatures - A list of features supported by the Guest OS on the imported image.
|
||||
//
|
||||
// Uses:
|
||||
|
|
@ -91,8 +94,8 @@ func (g *GCP) ComputeImageInsert(
|
|||
StorageLocations: regions,
|
||||
GuestOsFeatures: guestOsFeatures,
|
||||
RawDisk: &computepb.RawDisk{
|
||||
ContainerType: common.StringToPtr(computepb.RawDisk_TAR.String()),
|
||||
Source: common.StringToPtr(fmt.Sprintf("https://storage.googleapis.com/%s/%s", bucket, object)),
|
||||
ContainerType: common.ToPtr(computepb.RawDisk_TAR.String()),
|
||||
Source: common.ToPtr(fmt.Sprintf("https://storage.googleapis.com/%s/%s", bucket, object)),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -190,7 +193,7 @@ func (g *GCP) ComputeImageShare(ctx context.Context, imageName string, shareWith
|
|||
// Completely override the old policy
|
||||
userBinding := &computepb.Binding{
|
||||
Members: shareWith,
|
||||
Role: common.StringToPtr(imageDesiredRole),
|
||||
Role: common.ToPtr(imageDesiredRole),
|
||||
}
|
||||
newPolicy := &computepb.Policy{
|
||||
Bindings: []*computepb.Binding{userBinding},
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ func (s *Server) enqueueKojiCompose(taskID uint64, server, name, version, releas
|
|||
Payload: ir.imageType.PayloadPipelines(),
|
||||
},
|
||||
Targets: targets,
|
||||
ManifestDynArgsIdx: common.IntToPtr(1),
|
||||
ManifestDynArgsIdx: common.ToPtr(1),
|
||||
}, []uuid.UUID{initID, manifestJobID}, channel)
|
||||
if err != nil {
|
||||
return id, HTTPErrorWithInternal(ErrorEnqueueingJob, err)
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ func TestCollectRepos(t *testing.T) {
|
|||
// user repositories from request customizations
|
||||
customRepos := []Repository{
|
||||
{
|
||||
Baseurl: common.StringToPtr("http://example.com/repoone"),
|
||||
Baseurl: common.ToPtr("http://example.com/repoone"),
|
||||
},
|
||||
{
|
||||
Baseurl: common.StringToPtr("http://example.com/repotwo"),
|
||||
Baseurl: common.ToPtr("http://example.com/repotwo"),
|
||||
PackageSets: &[]string{"should-be-ignored"},
|
||||
},
|
||||
}
|
||||
|
|
@ -45,21 +45,21 @@ func TestCollectRepos(t *testing.T) {
|
|||
// repos from the image request (standard repos + package set repos)
|
||||
irRepos := []Repository{
|
||||
{
|
||||
Baseurl: common.StringToPtr("http://example.com/baseos"), // empty field -> all package sets
|
||||
Baseurl: common.ToPtr("http://example.com/baseos"), // empty field -> all package sets
|
||||
},
|
||||
{
|
||||
Baseurl: common.StringToPtr("http://example.com/appstream"), // empty field -> all package sets
|
||||
Baseurl: common.ToPtr("http://example.com/appstream"), // empty field -> all package sets
|
||||
},
|
||||
{
|
||||
Baseurl: common.StringToPtr("http://example.com/baseos-rhel7"), // build only
|
||||
Baseurl: common.ToPtr("http://example.com/baseos-rhel7"), // build only
|
||||
PackageSets: &[]string{"build"},
|
||||
},
|
||||
{
|
||||
Baseurl: common.StringToPtr("http://example.com/extra-tools"), // build and archive
|
||||
Baseurl: common.ToPtr("http://example.com/extra-tools"), // build and archive
|
||||
PackageSets: &[]string{"build", "archive"},
|
||||
},
|
||||
{
|
||||
Baseurl: common.StringToPtr("http://example.com/custom-os-stuff"), // blueprint only
|
||||
Baseurl: common.ToPtr("http://example.com/custom-os-stuff"), // blueprint only
|
||||
PackageSets: &[]string{"blueprint"},
|
||||
},
|
||||
}
|
||||
|
|
@ -93,13 +93,13 @@ func TestRepoConfigConversion(t *testing.T) {
|
|||
testCases := []testCase{
|
||||
{
|
||||
repo: Repository{
|
||||
Baseurl: common.StringToPtr("http://base.url"),
|
||||
CheckGpg: common.BoolToPtr(true),
|
||||
Gpgkey: common.StringToPtr("some-kind-of-key"),
|
||||
IgnoreSsl: common.BoolToPtr(false),
|
||||
Baseurl: common.ToPtr("http://base.url"),
|
||||
CheckGpg: common.ToPtr(true),
|
||||
Gpgkey: common.ToPtr("some-kind-of-key"),
|
||||
IgnoreSsl: common.ToPtr(false),
|
||||
Metalink: nil,
|
||||
Mirrorlist: nil,
|
||||
Rhsm: common.BoolToPtr(false),
|
||||
Rhsm: common.ToPtr(false),
|
||||
PackageSets: nil,
|
||||
},
|
||||
repoConfig: rpmmd.RepoConfig{
|
||||
|
|
@ -117,13 +117,13 @@ func TestRepoConfigConversion(t *testing.T) {
|
|||
},
|
||||
{
|
||||
repo: Repository{
|
||||
Baseurl: common.StringToPtr("http://base.url"),
|
||||
Baseurl: common.ToPtr("http://base.url"),
|
||||
CheckGpg: nil,
|
||||
Gpgkey: nil,
|
||||
IgnoreSsl: common.BoolToPtr(true),
|
||||
Metalink: common.StringToPtr("http://example.org/metalink"),
|
||||
Mirrorlist: common.StringToPtr("http://example.org/mirrorlist"),
|
||||
Rhsm: common.BoolToPtr(false),
|
||||
IgnoreSsl: common.ToPtr(true),
|
||||
Metalink: common.ToPtr("http://example.org/metalink"),
|
||||
Mirrorlist: common.ToPtr("http://example.org/mirrorlist"),
|
||||
Rhsm: common.ToPtr(false),
|
||||
PackageSets: nil,
|
||||
},
|
||||
repoConfig: rpmmd.RepoConfig{
|
||||
|
|
@ -144,10 +144,10 @@ func TestRepoConfigConversion(t *testing.T) {
|
|||
Baseurl: nil,
|
||||
CheckGpg: nil,
|
||||
Gpgkey: nil,
|
||||
IgnoreSsl: common.BoolToPtr(true),
|
||||
Metalink: common.StringToPtr("http://example.org/metalink"),
|
||||
Mirrorlist: common.StringToPtr("http://example.org/mirrorlist"),
|
||||
Rhsm: common.BoolToPtr(false),
|
||||
IgnoreSsl: common.ToPtr(true),
|
||||
Metalink: common.ToPtr("http://example.org/metalink"),
|
||||
Mirrorlist: common.ToPtr("http://example.org/mirrorlist"),
|
||||
Rhsm: common.ToPtr(false),
|
||||
PackageSets: nil,
|
||||
},
|
||||
repoConfig: rpmmd.RepoConfig{
|
||||
|
|
@ -168,10 +168,10 @@ func TestRepoConfigConversion(t *testing.T) {
|
|||
Baseurl: nil,
|
||||
CheckGpg: nil,
|
||||
Gpgkey: nil,
|
||||
IgnoreSsl: common.BoolToPtr(true),
|
||||
Metalink: common.StringToPtr("http://example.org/metalink"),
|
||||
IgnoreSsl: common.ToPtr(true),
|
||||
Metalink: common.ToPtr("http://example.org/metalink"),
|
||||
Mirrorlist: nil,
|
||||
Rhsm: common.BoolToPtr(true),
|
||||
Rhsm: common.ToPtr(true),
|
||||
PackageSets: nil,
|
||||
},
|
||||
repoConfig: rpmmd.RepoConfig{
|
||||
|
|
@ -208,7 +208,7 @@ func TestRepoConfigConversion(t *testing.T) {
|
|||
IgnoreSsl: nil,
|
||||
Metalink: nil,
|
||||
Mirrorlist: nil,
|
||||
Rhsm: common.BoolToPtr(true),
|
||||
Rhsm: common.ToPtr(true),
|
||||
PackageSets: nil,
|
||||
},
|
||||
err: HTTPError(ErrorInvalidRepository).Error(),
|
||||
|
|
@ -218,12 +218,12 @@ func TestRepoConfigConversion(t *testing.T) {
|
|||
{
|
||||
repo: Repository{
|
||||
Baseurl: nil,
|
||||
CheckGpg: common.BoolToPtr(true),
|
||||
CheckGpg: common.ToPtr(true),
|
||||
Gpgkey: nil,
|
||||
IgnoreSsl: common.BoolToPtr(true),
|
||||
Metalink: common.StringToPtr("http://example.org/metalink"),
|
||||
IgnoreSsl: common.ToPtr(true),
|
||||
Metalink: common.ToPtr("http://example.org/metalink"),
|
||||
Mirrorlist: nil,
|
||||
Rhsm: common.BoolToPtr(true),
|
||||
Rhsm: common.ToPtr(true),
|
||||
PackageSets: nil,
|
||||
},
|
||||
err: HTTPError(ErrorNoGPGKey).Error(),
|
||||
|
|
|
|||
|
|
@ -1,17 +1,5 @@
|
|||
package common
|
||||
|
||||
func IntToPtr(x int) *int {
|
||||
return &x
|
||||
}
|
||||
|
||||
func Uint64ToPtr(x uint64) *uint64 {
|
||||
return &x
|
||||
}
|
||||
|
||||
func BoolToPtr(x bool) *bool {
|
||||
return &x
|
||||
}
|
||||
|
||||
func StringToPtr(x string) *string {
|
||||
func ToPtr[T any](x T) *T {
|
||||
return &x
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,26 +6,21 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestIntToPtr(t *testing.T) {
|
||||
var value int = 42
|
||||
got := IntToPtr(value)
|
||||
assert.Equal(t, value, *got)
|
||||
}
|
||||
func TestToPtr(t *testing.T) {
|
||||
var valueInt int = 42
|
||||
gotInt := ToPtr(valueInt)
|
||||
assert.Equal(t, valueInt, *gotInt)
|
||||
|
||||
func TestBoolToPtr(t *testing.T) {
|
||||
var value bool = true
|
||||
got := BoolToPtr(value)
|
||||
assert.Equal(t, value, *got)
|
||||
}
|
||||
var valueBool bool = true
|
||||
gotBool := ToPtr(valueBool)
|
||||
assert.Equal(t, valueBool, *gotBool)
|
||||
|
||||
func TestUint64ToPtr(t *testing.T) {
|
||||
var value uint64 = 1
|
||||
got := Uint64ToPtr(value)
|
||||
assert.Equal(t, value, *got)
|
||||
}
|
||||
var valueUint64 uint64 = 1
|
||||
gotUint64 := ToPtr(valueUint64)
|
||||
assert.Equal(t, valueUint64, *gotUint64)
|
||||
|
||||
var valueStr string = "the-greatest-test-value"
|
||||
gotStr := ToPtr(valueStr)
|
||||
assert.Equal(t, valueStr, *gotStr)
|
||||
|
||||
func TestStringToPtr(t *testing.T) {
|
||||
var value string = "the-greatest-test-value"
|
||||
got := StringToPtr(value)
|
||||
assert.Equal(t, value, *got)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,9 +14,10 @@ import (
|
|||
_ "github.com/containers/image/v5/docker/archive"
|
||||
_ "github.com/containers/image/v5/oci/archive"
|
||||
_ "github.com/containers/image/v5/oci/layout"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
|
||||
"github.com/containers/common/pkg/retry"
|
||||
"github.com/containers/image/v5/copy"
|
||||
"github.com/containers/image/v5/docker"
|
||||
|
|
@ -233,13 +234,13 @@ func (cl *Client) GetTLSVerify() *bool {
|
|||
}
|
||||
|
||||
// NB: we invert the state, i.e. verify == (skip == false)
|
||||
return common.BoolToPtr(skip == types.OptionalBoolFalse)
|
||||
return common.ToPtr(skip == types.OptionalBoolFalse)
|
||||
}
|
||||
|
||||
// SkipTLSVerify is a convenience helper that internally calls
|
||||
// SetTLSVerify with false
|
||||
func (cl *Client) SkipTLSVerify() {
|
||||
cl.SetTLSVerify(common.BoolToPtr(false))
|
||||
cl.SetTLSVerify(common.ToPtr(false))
|
||||
}
|
||||
|
||||
func parseImageName(name string) (types.ImageReference, error) {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/opencontainers/go-digest"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/container"
|
||||
|
||||
|
|
@ -373,7 +374,7 @@ func (reg *Registry) Resolve(target, arch string) (container.Spec, error) {
|
|||
Digest: checksum,
|
||||
ImageID: mf.ConfigDescriptor.Digest.String(),
|
||||
LocalName: ref.String(),
|
||||
TLSVerify: common.BoolToPtr(false),
|
||||
TLSVerify: common.ToPtr(false),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,10 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/container"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
type lessCompare func(i, j int) bool
|
||||
|
|
@ -43,7 +44,7 @@ func TestResolver(t *testing.T) {
|
|||
resolver := container.NewResolver("amd64")
|
||||
|
||||
for _, r := range refs {
|
||||
resolver.Add(r, "", common.BoolToPtr(false))
|
||||
resolver.Add(r, "", common.ToPtr(false))
|
||||
}
|
||||
|
||||
have, err := resolver.Finish()
|
||||
|
|
@ -68,7 +69,7 @@ func TestResolver(t *testing.T) {
|
|||
func TestResolverFail(t *testing.T) {
|
||||
resolver := container.NewResolver("amd64")
|
||||
|
||||
resolver.Add("invalid-reference@${IMAGE_DIGEST}", "", common.BoolToPtr(false))
|
||||
resolver.Add("invalid-reference@${IMAGE_DIGEST}", "", common.ToPtr(false))
|
||||
|
||||
specs, err := resolver.Finish()
|
||||
assert.Error(t, err)
|
||||
|
|
@ -77,7 +78,7 @@ func TestResolverFail(t *testing.T) {
|
|||
registry := NewTestRegistry()
|
||||
defer registry.Close()
|
||||
|
||||
resolver.Add(registry.GetRef("repo"), "", common.BoolToPtr(false))
|
||||
resolver.Add(registry.GetRef("repo"), "", common.ToPtr(false))
|
||||
specs, err = resolver.Finish()
|
||||
assert.Error(t, err)
|
||||
assert.Len(t, specs, 0)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ package disk
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewPathTrieFromMap(t *testing.T) {
|
||||
|
|
@ -24,59 +25,59 @@ func TestNewPathTrieFromMap(t *testing.T) {
|
|||
},
|
||||
{
|
||||
entries: map[string]interface{}{
|
||||
"/": common.IntToPtr(1),
|
||||
"/": common.ToPtr(1),
|
||||
},
|
||||
trie: &PathTrie{
|
||||
Name: []string{},
|
||||
Payload: common.IntToPtr(1),
|
||||
Payload: common.ToPtr(1),
|
||||
},
|
||||
},
|
||||
{
|
||||
entries: map[string]interface{}{
|
||||
"/": common.IntToPtr(1),
|
||||
"/var": common.IntToPtr(2),
|
||||
"/var/lib/chrony": common.IntToPtr(3),
|
||||
"/var/lib/chrony/logs": common.IntToPtr(4),
|
||||
"/var/lib/osbuild": common.IntToPtr(5),
|
||||
"/var/lib/osbuild/store/cache": common.IntToPtr(6),
|
||||
"/boot": common.IntToPtr(7),
|
||||
"/boot/efi": common.IntToPtr(8),
|
||||
"/": common.ToPtr(1),
|
||||
"/var": common.ToPtr(2),
|
||||
"/var/lib/chrony": common.ToPtr(3),
|
||||
"/var/lib/chrony/logs": common.ToPtr(4),
|
||||
"/var/lib/osbuild": common.ToPtr(5),
|
||||
"/var/lib/osbuild/store/cache": common.ToPtr(6),
|
||||
"/boot": common.ToPtr(7),
|
||||
"/boot/efi": common.ToPtr(8),
|
||||
},
|
||||
trie: &PathTrie{
|
||||
Name: []string{},
|
||||
Payload: common.IntToPtr(1),
|
||||
Payload: common.ToPtr(1),
|
||||
Paths: []*PathTrie{
|
||||
{
|
||||
Name: []string{"boot"},
|
||||
Payload: common.IntToPtr(7),
|
||||
Payload: common.ToPtr(7),
|
||||
Paths: []*PathTrie{
|
||||
{
|
||||
Name: []string{"efi"},
|
||||
Payload: common.IntToPtr(8),
|
||||
Payload: common.ToPtr(8),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: []string{"var"},
|
||||
Payload: common.IntToPtr(2),
|
||||
Payload: common.ToPtr(2),
|
||||
Paths: []*PathTrie{
|
||||
{
|
||||
Name: []string{"lib", "chrony"},
|
||||
Payload: common.IntToPtr(3),
|
||||
Payload: common.ToPtr(3),
|
||||
Paths: []*PathTrie{
|
||||
{
|
||||
Name: []string{"logs"},
|
||||
Payload: common.IntToPtr(4),
|
||||
Payload: common.ToPtr(4),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: []string{"lib", "osbuild"},
|
||||
Payload: common.IntToPtr(5),
|
||||
Payload: common.ToPtr(5),
|
||||
Paths: []*PathTrie{
|
||||
{
|
||||
Name: []string{"store", "cache"},
|
||||
Payload: common.IntToPtr(6),
|
||||
Payload: common.ToPtr(6),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ var (
|
|||
installerPkgsKey: iotInstallerPackageSet,
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
EnabledServices: iotServices,
|
||||
},
|
||||
rpmOstree: true,
|
||||
|
|
@ -157,7 +157,7 @@ var (
|
|||
mimeType: "application/xz",
|
||||
packageSets: map[string]packageSetFunc{},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
},
|
||||
defaultSize: 10 * common.GibiByte,
|
||||
rpmOstree: true,
|
||||
|
|
@ -177,7 +177,7 @@ var (
|
|||
osPkgsKey: qcow2CommonPackageSet,
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
EnabledServices: []string{
|
||||
"cloud-init.service",
|
||||
"cloud-config.service",
|
||||
|
|
@ -203,11 +203,11 @@ var (
|
|||
osPkgsKey: vhdCommonPackageSet,
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
EnabledServices: []string{
|
||||
"sshd",
|
||||
},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
DisabledServices: []string{
|
||||
"proc-sys-fs-binfmt_misc.mount",
|
||||
"loadmodules.service",
|
||||
|
|
@ -232,7 +232,7 @@ var (
|
|||
osPkgsKey: vmdkCommonPackageSet,
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
EnabledServices: []string{
|
||||
"cloud-init.service",
|
||||
"cloud-config.service",
|
||||
|
|
@ -258,7 +258,7 @@ var (
|
|||
osPkgsKey: openstackCommonPackageSet,
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
EnabledServices: []string{
|
||||
"cloud-init.service",
|
||||
"cloud-config.service",
|
||||
|
|
@ -278,7 +278,7 @@ var (
|
|||
|
||||
// default EC2 images config (common for all architectures)
|
||||
defaultEc2ImageConfig = &distro.ImageConfig{
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
}
|
||||
|
||||
amiImgType = imageType{
|
||||
|
|
@ -308,10 +308,10 @@ var (
|
|||
osPkgsKey: containerPackageSet,
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
NoSElinux: common.BoolToPtr(true),
|
||||
ExcludeDocs: common.BoolToPtr(true),
|
||||
Locale: common.StringToPtr("C.UTF-8"),
|
||||
Timezone: common.StringToPtr("Etc/UTC"),
|
||||
NoSElinux: common.ToPtr(true),
|
||||
ExcludeDocs: common.ToPtr(true),
|
||||
Locale: common.ToPtr("C.UTF-8"),
|
||||
Timezone: common.ToPtr("Etc/UTC"),
|
||||
},
|
||||
image: containerImage,
|
||||
bootable: false,
|
||||
|
|
@ -336,8 +336,8 @@ type distribution struct {
|
|||
|
||||
// Fedora based OS image configuration defaults
|
||||
var defaultDistroImageConfig = &distro.ImageConfig{
|
||||
Timezone: common.StringToPtr("UTC"),
|
||||
Locale: common.StringToPtr("en_US"),
|
||||
Timezone: common.ToPtr("UTC"),
|
||||
Locale: common.ToPtr("en_US"),
|
||||
}
|
||||
|
||||
func getDistro(version int) distribution {
|
||||
|
|
|
|||
|
|
@ -3,9 +3,10 @@ package distro
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestImageConfigInheritFrom(t *testing.T) {
|
||||
|
|
@ -18,17 +19,17 @@ func TestImageConfigInheritFrom(t *testing.T) {
|
|||
{
|
||||
name: "inheritance with overridden values",
|
||||
distroConfig: &ImageConfig{
|
||||
Timezone: common.StringToPtr("America/New_York"),
|
||||
Timezone: common.ToPtr("America/New_York"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{{Hostname: "127.0.0.1"}},
|
||||
},
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
},
|
||||
EnabledServices: []string{"sshd"},
|
||||
DisabledServices: []string{"named"},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
Sysconfig: []*osbuild.SysconfigStageOptions{
|
||||
{
|
||||
Kernel: &osbuild.SysconfigKernelOptions{
|
||||
|
|
@ -44,11 +45,11 @@ func TestImageConfigInheritFrom(t *testing.T) {
|
|||
"eth0": {
|
||||
Device: "eth0",
|
||||
Bootproto: osbuild.IfcfgBootprotoDHCP,
|
||||
OnBoot: common.BoolToPtr(true),
|
||||
OnBoot: common.ToPtr(true),
|
||||
Type: osbuild.IfcfgTypeEthernet,
|
||||
UserCtl: common.BoolToPtr(true),
|
||||
PeerDNS: common.BoolToPtr(true),
|
||||
IPv6Init: common.BoolToPtr(false),
|
||||
UserCtl: common.ToPtr(true),
|
||||
PeerDNS: common.ToPtr(true),
|
||||
IPv6Init: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -56,41 +57,41 @@ func TestImageConfigInheritFrom(t *testing.T) {
|
|||
},
|
||||
},
|
||||
imageConfig: &ImageConfig{
|
||||
Timezone: common.StringToPtr("UTC"),
|
||||
Timezone: common.ToPtr("UTC"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{
|
||||
{
|
||||
Hostname: "169.254.169.123",
|
||||
Prefer: common.BoolToPtr(true),
|
||||
Iburst: common.BoolToPtr(true),
|
||||
Minpoll: common.IntToPtr(4),
|
||||
Maxpoll: common.IntToPtr(4),
|
||||
Prefer: common.ToPtr(true),
|
||||
Iburst: common.ToPtr(true),
|
||||
Minpoll: common.ToPtr(4),
|
||||
Maxpoll: common.ToPtr(4),
|
||||
},
|
||||
},
|
||||
LeapsecTz: common.StringToPtr(""),
|
||||
LeapsecTz: common.ToPtr(""),
|
||||
},
|
||||
},
|
||||
expectedConfig: &ImageConfig{
|
||||
Timezone: common.StringToPtr("UTC"),
|
||||
Timezone: common.ToPtr("UTC"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{
|
||||
{
|
||||
Hostname: "169.254.169.123",
|
||||
Prefer: common.BoolToPtr(true),
|
||||
Iburst: common.BoolToPtr(true),
|
||||
Minpoll: common.IntToPtr(4),
|
||||
Maxpoll: common.IntToPtr(4),
|
||||
Prefer: common.ToPtr(true),
|
||||
Iburst: common.ToPtr(true),
|
||||
Minpoll: common.ToPtr(4),
|
||||
Maxpoll: common.ToPtr(4),
|
||||
},
|
||||
},
|
||||
LeapsecTz: common.StringToPtr(""),
|
||||
LeapsecTz: common.ToPtr(""),
|
||||
},
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
},
|
||||
EnabledServices: []string{"sshd"},
|
||||
DisabledServices: []string{"named"},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
Sysconfig: []*osbuild.SysconfigStageOptions{
|
||||
{
|
||||
Kernel: &osbuild.SysconfigKernelOptions{
|
||||
|
|
@ -106,11 +107,11 @@ func TestImageConfigInheritFrom(t *testing.T) {
|
|||
"eth0": {
|
||||
Device: "eth0",
|
||||
Bootproto: osbuild.IfcfgBootprotoDHCP,
|
||||
OnBoot: common.BoolToPtr(true),
|
||||
OnBoot: common.ToPtr(true),
|
||||
Type: osbuild.IfcfgTypeEthernet,
|
||||
UserCtl: common.BoolToPtr(true),
|
||||
PeerDNS: common.BoolToPtr(true),
|
||||
IPv6Init: common.BoolToPtr(false),
|
||||
UserCtl: common.ToPtr(true),
|
||||
PeerDNS: common.ToPtr(true),
|
||||
IPv6Init: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -121,91 +122,91 @@ func TestImageConfigInheritFrom(t *testing.T) {
|
|||
{
|
||||
name: "empty image type configuration",
|
||||
distroConfig: &ImageConfig{
|
||||
Timezone: common.StringToPtr("America/New_York"),
|
||||
Timezone: common.ToPtr("America/New_York"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{{Hostname: "127.0.0.1"}},
|
||||
},
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
},
|
||||
EnabledServices: []string{"sshd"},
|
||||
DisabledServices: []string{"named"},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
},
|
||||
imageConfig: &ImageConfig{},
|
||||
expectedConfig: &ImageConfig{
|
||||
Timezone: common.StringToPtr("America/New_York"),
|
||||
Timezone: common.ToPtr("America/New_York"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{{Hostname: "127.0.0.1"}},
|
||||
},
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
},
|
||||
EnabledServices: []string{"sshd"},
|
||||
DisabledServices: []string{"named"},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "empty distro configuration",
|
||||
distroConfig: &ImageConfig{},
|
||||
imageConfig: &ImageConfig{
|
||||
Timezone: common.StringToPtr("America/New_York"),
|
||||
Timezone: common.ToPtr("America/New_York"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{{Hostname: "127.0.0.1"}},
|
||||
},
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
},
|
||||
EnabledServices: []string{"sshd"},
|
||||
DisabledServices: []string{"named"},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
},
|
||||
expectedConfig: &ImageConfig{
|
||||
Timezone: common.StringToPtr("America/New_York"),
|
||||
Timezone: common.ToPtr("America/New_York"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{{Hostname: "127.0.0.1"}},
|
||||
},
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
},
|
||||
EnabledServices: []string{"sshd"},
|
||||
DisabledServices: []string{"named"},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "empty distro configuration",
|
||||
distroConfig: nil,
|
||||
imageConfig: &ImageConfig{
|
||||
Timezone: common.StringToPtr("America/New_York"),
|
||||
Timezone: common.ToPtr("America/New_York"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{{Hostname: "127.0.0.1"}},
|
||||
},
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
},
|
||||
EnabledServices: []string{"sshd"},
|
||||
DisabledServices: []string{"named"},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
},
|
||||
expectedConfig: &ImageConfig{
|
||||
Timezone: common.StringToPtr("America/New_York"),
|
||||
Timezone: common.ToPtr("America/New_York"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{{Hostname: "127.0.0.1"}},
|
||||
},
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
},
|
||||
EnabledServices: []string{"sshd"},
|
||||
DisabledServices: []string{"named"},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ func vhdPipelines(compress bool) pipelinesFunc {
|
|||
qemufile = t.filename
|
||||
}
|
||||
|
||||
qemuPipeline := qemuPipeline(imagePipeline.Name, diskfile, qemufile, osbuild.QEMUFormatVPC, osbuild.VPCOptions{ForceSize: common.BoolToPtr(false)})
|
||||
qemuPipeline := qemuPipeline(imagePipeline.Name, diskfile, qemufile, osbuild.QEMUFormatVPC, osbuild.VPCOptions{ForceSize: common.ToPtr(false)})
|
||||
pipelines = append(pipelines, *qemuPipeline)
|
||||
|
||||
if compress {
|
||||
|
|
@ -228,8 +228,8 @@ var azureRhuiImgType = imageType{
|
|||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
Timezone: common.StringToPtr("Etc/UTC"),
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Timezone: common.ToPtr("Etc/UTC"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
GPGKeyFiles: []string{
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-microsoft-azure-release",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
|
||||
|
|
@ -259,7 +259,7 @@ var azureRhuiImgType = imageType{
|
|||
},
|
||||
SshdConfig: &osbuild.SshdConfigStageOptions{
|
||||
Config: osbuild.SshdConfigConfig{
|
||||
ClientAliveInterval: common.IntToPtr(180),
|
||||
ClientAliveInterval: common.ToPtr(180),
|
||||
},
|
||||
},
|
||||
Modprobe: []*osbuild.ModprobeStageOptions{
|
||||
|
|
@ -300,7 +300,7 @@ var azureRhuiImgType = imageType{
|
|||
Filename: "06_logging_override.cfg",
|
||||
Config: osbuild.CloudInitConfigFile{
|
||||
Output: &osbuild.CloudInitConfigOutput{
|
||||
All: common.StringToPtr("| tee -a /var/log/cloud-init-output.log"),
|
||||
All: common.ToPtr("| tee -a /var/log/cloud-init-output.log"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -333,18 +333,18 @@ var azureRhuiImgType = imageType{
|
|||
},
|
||||
PwQuality: &osbuild.PwqualityConfStageOptions{
|
||||
Config: osbuild.PwqualityConfConfig{
|
||||
Minlen: common.IntToPtr(6),
|
||||
Minclass: common.IntToPtr(3),
|
||||
Dcredit: common.IntToPtr(0),
|
||||
Ucredit: common.IntToPtr(0),
|
||||
Lcredit: common.IntToPtr(0),
|
||||
Ocredit: common.IntToPtr(0),
|
||||
Minlen: common.ToPtr(6),
|
||||
Minclass: common.ToPtr(3),
|
||||
Dcredit: common.ToPtr(0),
|
||||
Ucredit: common.ToPtr(0),
|
||||
Lcredit: common.ToPtr(0),
|
||||
Ocredit: common.ToPtr(0),
|
||||
},
|
||||
},
|
||||
WAAgentConfig: &osbuild.WAAgentConfStageOptions{
|
||||
Config: osbuild.WAAgentConfig{
|
||||
RDFormat: common.BoolToPtr(false),
|
||||
RDEnableSwap: common.BoolToPtr(false),
|
||||
RDFormat: common.ToPtr(false),
|
||||
RDEnableSwap: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
RHSMConfig: map[distro.RHSMSubscriptionStatus]*osbuild.RHSMStageOptions{
|
||||
|
|
@ -356,17 +356,17 @@ var azureRhuiImgType = imageType{
|
|||
},
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
Rhsm: &osbuild.SubManConfigRHSMSection{
|
||||
ManageRepos: common.BoolToPtr(false),
|
||||
ManageRepos: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
distro.RHSMConfigWithSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
@ -401,7 +401,7 @@ var azureRhuiImgType = imageType{
|
|||
},
|
||||
YumConfig: &osbuild.YumConfigStageOptions{
|
||||
Config: &osbuild.YumConfigConfig{
|
||||
HttpCaching: common.StringToPtr("packages"),
|
||||
HttpCaching: common.ToPtr("packages"),
|
||||
},
|
||||
Plugins: &osbuild.YumConfigPlugins{
|
||||
Langpacks: &osbuild.YumConfigPluginsLangpacks{
|
||||
|
|
@ -409,7 +409,7 @@ var azureRhuiImgType = imageType{
|
|||
},
|
||||
},
|
||||
},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
},
|
||||
kernelOptions: "ro crashkernel=auto console=tty1 console=ttyS0 earlyprintk=ttyS0 rootdelay=300 scsi_mod.use_blk_mq=y",
|
||||
bootable: true,
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ const (
|
|||
|
||||
// RHEL-based OS image configuration defaults
|
||||
var defaultDistroImageConfig = &distro.ImageConfig{
|
||||
Timezone: common.StringToPtr("America/New_York"),
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Timezone: common.ToPtr("America/New_York"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
GPGKeyFiles: []string{
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ var qcow2ImgType = imageType{
|
|||
osPkgsKey: qcow2CommonPackageSet,
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
Sysconfig: []*osbuild.SysconfigStageOptions{
|
||||
{
|
||||
Kernel: &osbuild.SysconfigKernelOptions{
|
||||
|
|
@ -119,11 +119,11 @@ var qcow2ImgType = imageType{
|
|||
"eth0": {
|
||||
Device: "eth0",
|
||||
Bootproto: osbuild.IfcfgBootprotoDHCP,
|
||||
OnBoot: common.BoolToPtr(true),
|
||||
OnBoot: common.ToPtr(true),
|
||||
Type: osbuild.IfcfgTypeEthernet,
|
||||
UserCtl: common.BoolToPtr(true),
|
||||
PeerDNS: common.BoolToPtr(true),
|
||||
IPv6Init: common.BoolToPtr(false),
|
||||
UserCtl: common.ToPtr(true),
|
||||
PeerDNS: common.ToPtr(true),
|
||||
IPv6Init: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ func selinuxStageOptions(labelcp bool) *osbuild.SELinuxStageOptions {
|
|||
"/usr/bin/tar": "system_u:object_r:install_exec_t:s0",
|
||||
}
|
||||
} else {
|
||||
options.ForceAutorelabel = common.BoolToPtr(true)
|
||||
options.ForceAutorelabel = common.ToPtr(true)
|
||||
}
|
||||
return options
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,8 +302,8 @@ func vhdPipelines(compress bool) pipelinesFunc {
|
|||
var defaultAzureKernelOptions = "ro crashkernel=auto console=tty1 console=ttyS0 earlyprintk=ttyS0 rootdelay=300"
|
||||
|
||||
var defaultAzureImageConfig = &distro.ImageConfig{
|
||||
Timezone: common.StringToPtr("Etc/UTC"),
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Timezone: common.ToPtr("Etc/UTC"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
X11Keymap: &osbuild.X11KeymapOptions{
|
||||
|
|
@ -332,7 +332,7 @@ var defaultAzureImageConfig = &distro.ImageConfig{
|
|||
},
|
||||
SshdConfig: &osbuild.SshdConfigStageOptions{
|
||||
Config: osbuild.SshdConfigConfig{
|
||||
ClientAliveInterval: common.IntToPtr(180),
|
||||
ClientAliveInterval: common.ToPtr(180),
|
||||
},
|
||||
},
|
||||
Modprobe: []*osbuild.ModprobeStageOptions{
|
||||
|
|
@ -398,18 +398,18 @@ var defaultAzureImageConfig = &distro.ImageConfig{
|
|||
},
|
||||
PwQuality: &osbuild.PwqualityConfStageOptions{
|
||||
Config: osbuild.PwqualityConfConfig{
|
||||
Minlen: common.IntToPtr(6),
|
||||
Minclass: common.IntToPtr(3),
|
||||
Dcredit: common.IntToPtr(0),
|
||||
Ucredit: common.IntToPtr(0),
|
||||
Lcredit: common.IntToPtr(0),
|
||||
Ocredit: common.IntToPtr(0),
|
||||
Minlen: common.ToPtr(6),
|
||||
Minclass: common.ToPtr(3),
|
||||
Dcredit: common.ToPtr(0),
|
||||
Ucredit: common.ToPtr(0),
|
||||
Lcredit: common.ToPtr(0),
|
||||
Ocredit: common.ToPtr(0),
|
||||
},
|
||||
},
|
||||
WAAgentConfig: &osbuild.WAAgentConfStageOptions{
|
||||
Config: osbuild.WAAgentConfig{
|
||||
RDFormat: common.BoolToPtr(false),
|
||||
RDEnableSwap: common.BoolToPtr(false),
|
||||
RDFormat: common.ToPtr(false),
|
||||
RDEnableSwap: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
Grub2Config: &osbuild.GRUB2Config{
|
||||
|
|
@ -449,7 +449,7 @@ var defaultAzureImageConfig = &distro.ImageConfig{
|
|||
},
|
||||
},
|
||||
},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
}
|
||||
|
||||
// Azure non-RHEL image type
|
||||
|
|
@ -485,7 +485,7 @@ var defaultAzureByosImageConfig = &distro.ImageConfig{
|
|||
distro.RHSMConfigNoSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// Don't disable RHSM redhat.repo management on the GCE
|
||||
// image, which is BYOS and does not use RHUI for content.
|
||||
|
|
@ -499,7 +499,7 @@ var defaultAzureByosImageConfig = &distro.ImageConfig{
|
|||
distro.RHSMConfigWithSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
@ -547,17 +547,17 @@ var defaultAzureRhuiImageConfig = &distro.ImageConfig{
|
|||
},
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
Rhsm: &osbuild.SubManConfigRHSMSection{
|
||||
ManageRepos: common.BoolToPtr(false),
|
||||
ManageRepos: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
distro.RHSMConfigWithSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ type distribution struct {
|
|||
|
||||
// RHEL-based OS image configuration defaults
|
||||
var defaultDistroImageConfig = &distro.ImageConfig{
|
||||
Timezone: common.StringToPtr("America/New_York"),
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Timezone: common.ToPtr("America/New_York"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Sysconfig: []*osbuild.SysconfigStageOptions{
|
||||
{
|
||||
Kernel: &osbuild.SysconfigKernelOptions{
|
||||
|
|
@ -932,7 +932,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
RHSMConfig: map[distro.RHSMSubscriptionStatus]*osbuild.RHSMStageOptions{
|
||||
distro.RHSMConfigNoSubscription: {
|
||||
DnfPlugins: &osbuild.RHSMStageOptionsDnfPlugins{
|
||||
|
|
@ -999,19 +999,19 @@ func newDistro(distroName string) distro.Distro {
|
|||
|
||||
// default EC2 images config (common for all architectures)
|
||||
defaultEc2ImageConfig := &distro.ImageConfig{
|
||||
Timezone: common.StringToPtr("UTC"),
|
||||
Timezone: common.ToPtr("UTC"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{
|
||||
{
|
||||
Hostname: "169.254.169.123",
|
||||
Prefer: common.BoolToPtr(true),
|
||||
Iburst: common.BoolToPtr(true),
|
||||
Minpoll: common.IntToPtr(4),
|
||||
Maxpoll: common.IntToPtr(4),
|
||||
Prefer: common.ToPtr(true),
|
||||
Iburst: common.ToPtr(true),
|
||||
Minpoll: common.ToPtr(4),
|
||||
Maxpoll: common.ToPtr(4),
|
||||
},
|
||||
},
|
||||
// empty string will remove any occurrences of the option from the configuration
|
||||
LeapsecTz: common.StringToPtr(""),
|
||||
LeapsecTz: common.ToPtr(""),
|
||||
},
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
|
|
@ -1030,7 +1030,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
"cloud-final",
|
||||
"reboot.target",
|
||||
},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
Sysconfig: []*osbuild.SysconfigStageOptions{
|
||||
{
|
||||
Kernel: &osbuild.SysconfigKernelOptions{
|
||||
|
|
@ -1046,11 +1046,11 @@ func newDistro(distroName string) distro.Distro {
|
|||
"eth0": {
|
||||
Device: "eth0",
|
||||
Bootproto: osbuild.IfcfgBootprotoDHCP,
|
||||
OnBoot: common.BoolToPtr(true),
|
||||
OnBoot: common.ToPtr(true),
|
||||
Type: osbuild.IfcfgTypeEthernet,
|
||||
UserCtl: common.BoolToPtr(true),
|
||||
PeerDNS: common.BoolToPtr(true),
|
||||
IPv6Init: common.BoolToPtr(false),
|
||||
UserCtl: common.ToPtr(true),
|
||||
PeerDNS: common.ToPtr(true),
|
||||
IPv6Init: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -1061,10 +1061,10 @@ func newDistro(distroName string) distro.Distro {
|
|||
// RHBZ#1932802
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
Rhsm: &osbuild.SubManConfigRHSMSection{
|
||||
ManageRepos: common.BoolToPtr(false),
|
||||
ManageRepos: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -1072,7 +1072,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
// RHBZ#1932802
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
@ -1085,7 +1085,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
Config: osbuild.SystemdLogindConfigDropin{
|
||||
|
||||
Login: osbuild.SystemdLogindConfigLoginSection{
|
||||
NAutoVTs: common.IntToPtr(0),
|
||||
NAutoVTs: common.ToPtr(0),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -1142,7 +1142,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
},
|
||||
SshdConfig: &osbuild.SshdConfigStageOptions{
|
||||
Config: osbuild.SshdConfigConfig{
|
||||
PasswordAuthentication: common.BoolToPtr(false),
|
||||
PasswordAuthentication: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1179,7 +1179,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
// RHBZ#1932802
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// Don't disable RHSM redhat.repo management on the AMI
|
||||
// image, which is BYOS and does not use RHUI for content.
|
||||
|
|
@ -1194,7 +1194,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
// RHBZ#1932802
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
@ -1346,7 +1346,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
|
||||
// GCE BYOS image
|
||||
defaultGceByosImageConfig := &distro.ImageConfig{
|
||||
Timezone: common.StringToPtr("UTC"),
|
||||
Timezone: common.ToPtr("UTC"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{{Hostname: "metadata.google.internal"}},
|
||||
},
|
||||
|
|
@ -1362,8 +1362,8 @@ func newDistro(distroName string) distro.Distro {
|
|||
"sshd-keygen@",
|
||||
"reboot.target",
|
||||
},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
},
|
||||
|
|
@ -1379,7 +1379,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
DNFAutomaticConfig: &osbuild.DNFAutomaticConfigStageOptions{
|
||||
Config: &osbuild.DNFAutomaticConfig{
|
||||
Commands: &osbuild.DNFAutomaticConfigCommands{
|
||||
ApplyUpdates: common.BoolToPtr(true),
|
||||
ApplyUpdates: common.ToPtr(true),
|
||||
UpgradeType: osbuild.DNFAutomaticUpgradeTypeSecurity,
|
||||
},
|
||||
},
|
||||
|
|
@ -1392,9 +1392,9 @@ func newDistro(distroName string) distro.Distro {
|
|||
Id: "google-compute-engine",
|
||||
Name: "Google Compute Engine",
|
||||
BaseURL: []string{"https://packages.cloud.google.com/yum/repos/google-compute-engine-el8-x86_64-stable"},
|
||||
Enabled: common.BoolToPtr(true),
|
||||
GPGCheck: common.BoolToPtr(true),
|
||||
RepoGPGCheck: common.BoolToPtr(false),
|
||||
Enabled: common.ToPtr(true),
|
||||
GPGCheck: common.ToPtr(true),
|
||||
RepoGPGCheck: common.ToPtr(false),
|
||||
GPGKey: []string{
|
||||
"https://packages.cloud.google.com/yum/doc/yum-key.gpg",
|
||||
"https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg",
|
||||
|
|
@ -1407,7 +1407,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
distro.RHSMConfigNoSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// Don't disable RHSM redhat.repo management on the GCE
|
||||
// image, which is BYOS and does not use RHUI for content.
|
||||
|
|
@ -1421,7 +1421,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
distro.RHSMConfigWithSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
@ -1430,8 +1430,8 @@ func newDistro(distroName string) distro.Distro {
|
|||
},
|
||||
SshdConfig: &osbuild.SshdConfigStageOptions{
|
||||
Config: osbuild.SshdConfigConfig{
|
||||
PasswordAuthentication: common.BoolToPtr(false),
|
||||
ClientAliveInterval: common.IntToPtr(420),
|
||||
PasswordAuthentication: common.ToPtr(false),
|
||||
ClientAliveInterval: common.ToPtr(420),
|
||||
PermitRootLogin: osbuild.PermitRootLoginValueNo,
|
||||
},
|
||||
},
|
||||
|
|
@ -1455,7 +1455,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
ConfigScope: osbuild.GcpGuestAgentConfigScopeDistro,
|
||||
Config: &osbuild.GcpGuestAgentConfig{
|
||||
InstanceSetup: &osbuild.GcpGuestAgentConfigInstanceSetup{
|
||||
SetBotoConfig: common.BoolToPtr(false),
|
||||
SetBotoConfig: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -1502,17 +1502,17 @@ func newDistro(distroName string) distro.Distro {
|
|||
distro.RHSMConfigNoSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
Rhsm: &osbuild.SubManConfigRHSMSection{
|
||||
ManageRepos: common.BoolToPtr(false),
|
||||
ManageRepos: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
distro.RHSMConfigWithSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
|
|||
|
|
@ -177,9 +177,9 @@ func gcePipelines(t *imageType, customizations *blueprint.Customizations, option
|
|||
Format: osbuild.TarArchiveFormatOldgnu,
|
||||
RootNode: osbuild.TarRootNodeOmit,
|
||||
// import of the image to GCP fails in case the options below are enabled, which is the default
|
||||
ACLs: common.BoolToPtr(false),
|
||||
SELinux: common.BoolToPtr(false),
|
||||
Xattrs: common.BoolToPtr(false),
|
||||
ACLs: common.ToPtr(false),
|
||||
SELinux: common.ToPtr(false),
|
||||
Xattrs: common.ToPtr(false),
|
||||
})
|
||||
pipelines = append(pipelines, *archivePipeline)
|
||||
|
||||
|
|
@ -392,7 +392,7 @@ func osPipeline(t *imageType,
|
|||
if pt == nil || pt.FindMountable("/boot") == nil {
|
||||
p.AddStage(osbuild.NewFixBLSStage(&osbuild.FixBLSStageOptions{}))
|
||||
} else {
|
||||
p.AddStage(osbuild.NewFixBLSStage(&osbuild.FixBLSStageOptions{Prefix: common.StringToPtr("")}))
|
||||
p.AddStage(osbuild.NewFixBLSStage(&osbuild.FixBLSStageOptions{Prefix: common.ToPtr("")}))
|
||||
}
|
||||
|
||||
if len(containers) > 0 {
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ func nginxConfigStageOptions(path, htmlRoot, listen string) *osbuild.NginxConfig
|
|||
cfg := &osbuild.NginxConfig{
|
||||
Listen: listen,
|
||||
Root: htmlRoot,
|
||||
Daemon: common.BoolToPtr(false),
|
||||
Daemon: common.ToPtr(false),
|
||||
PID: "/tmp/nginx.pid",
|
||||
}
|
||||
return &osbuild.NginxConfigStageOptions{
|
||||
|
|
@ -315,7 +315,7 @@ func ostreeConfigStageOptions(repo string, readOnly bool) *osbuild.OSTreeConfigS
|
|||
Repo: repo,
|
||||
Config: &osbuild.OSTreeConfig{
|
||||
Sysroot: &osbuild.SysrootOptions{
|
||||
ReadOnly: common.BoolToPtr(readOnly),
|
||||
ReadOnly: common.ToPtr(readOnly),
|
||||
Bootloader: "none",
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -146,20 +146,20 @@ var (
|
|||
// default EC2 images config (common for all architectures)
|
||||
func baseEc2ImageConfig() *distro.ImageConfig {
|
||||
return &distro.ImageConfig{
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Timezone: common.StringToPtr("UTC"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Timezone: common.ToPtr("UTC"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{
|
||||
{
|
||||
Hostname: "169.254.169.123",
|
||||
Prefer: common.BoolToPtr(true),
|
||||
Iburst: common.BoolToPtr(true),
|
||||
Minpoll: common.IntToPtr(4),
|
||||
Maxpoll: common.IntToPtr(4),
|
||||
Prefer: common.ToPtr(true),
|
||||
Iburst: common.ToPtr(true),
|
||||
Minpoll: common.ToPtr(4),
|
||||
Maxpoll: common.ToPtr(4),
|
||||
},
|
||||
},
|
||||
// empty string will remove any occurrences of the option from the configuration
|
||||
LeapsecTz: common.StringToPtr(""),
|
||||
LeapsecTz: common.ToPtr(""),
|
||||
},
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
|
|
@ -179,7 +179,7 @@ func baseEc2ImageConfig() *distro.ImageConfig {
|
|||
"reboot.target",
|
||||
"tuned",
|
||||
},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
Sysconfig: []*osbuild.SysconfigStageOptions{
|
||||
{
|
||||
Kernel: &osbuild.SysconfigKernelOptions{
|
||||
|
|
@ -195,11 +195,11 @@ func baseEc2ImageConfig() *distro.ImageConfig {
|
|||
"eth0": {
|
||||
Device: "eth0",
|
||||
Bootproto: osbuild.IfcfgBootprotoDHCP,
|
||||
OnBoot: common.BoolToPtr(true),
|
||||
OnBoot: common.ToPtr(true),
|
||||
Type: osbuild.IfcfgTypeEthernet,
|
||||
UserCtl: common.BoolToPtr(true),
|
||||
PeerDNS: common.BoolToPtr(true),
|
||||
IPv6Init: common.BoolToPtr(false),
|
||||
UserCtl: common.ToPtr(true),
|
||||
PeerDNS: common.ToPtr(true),
|
||||
IPv6Init: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -211,7 +211,7 @@ func baseEc2ImageConfig() *distro.ImageConfig {
|
|||
Config: osbuild.SystemdLogindConfigDropin{
|
||||
|
||||
Login: osbuild.SystemdLogindConfigLoginSection{
|
||||
NAutoVTs: common.IntToPtr(0),
|
||||
NAutoVTs: common.ToPtr(0),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -268,7 +268,7 @@ func baseEc2ImageConfig() *distro.ImageConfig {
|
|||
},
|
||||
SshdConfig: &osbuild.SshdConfigStageOptions{
|
||||
Config: osbuild.SshdConfigConfig{
|
||||
PasswordAuthentication: common.BoolToPtr(false),
|
||||
PasswordAuthentication: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -280,7 +280,7 @@ func defaultEc2ImageConfig(osVersion string, rhsm bool) *distro.ImageConfig {
|
|||
ic = appendRHSM(ic)
|
||||
// Disable RHSM redhat.repo management
|
||||
rhsmConf := ic.RHSMConfig[distro.RHSMConfigNoSubscription]
|
||||
rhsmConf.SubMan.Rhsm = &osbuild.SubManConfigRHSMSection{ManageRepos: common.BoolToPtr(false)}
|
||||
rhsmConf.SubMan.Rhsm = &osbuild.SubManConfigRHSMSection{ManageRepos: common.ToPtr(false)}
|
||||
ic.RHSMConfig[distro.RHSMConfigNoSubscription] = rhsmConf
|
||||
}
|
||||
return ic
|
||||
|
|
@ -455,7 +455,7 @@ func appendRHSM(ic *distro.ImageConfig) *distro.ImageConfig {
|
|||
// RHBZ#1932802
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// Don't disable RHSM redhat.repo management on the AMI
|
||||
// image, which is BYOS and does not use RHUI for content.
|
||||
|
|
@ -470,7 +470,7 @@ func appendRHSM(ic *distro.ImageConfig) *distro.ImageConfig {
|
|||
// RHBZ#1932802
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
|
|||
|
|
@ -396,8 +396,8 @@ var azureRhuiBasePartitionTables = distro.BasePartitionTableMap{
|
|||
var defaultAzureKernelOptions = "ro console=tty1 console=ttyS0 earlyprintk=ttyS0 rootdelay=300"
|
||||
|
||||
var defaultAzureImageConfig = &distro.ImageConfig{
|
||||
Timezone: common.StringToPtr("Etc/UTC"),
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Timezone: common.ToPtr("Etc/UTC"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
X11Keymap: &osbuild.X11KeymapOptions{
|
||||
|
|
@ -425,7 +425,7 @@ var defaultAzureImageConfig = &distro.ImageConfig{
|
|||
},
|
||||
SshdConfig: &osbuild.SshdConfigStageOptions{
|
||||
Config: osbuild.SshdConfigConfig{
|
||||
ClientAliveInterval: common.IntToPtr(180),
|
||||
ClientAliveInterval: common.ToPtr(180),
|
||||
},
|
||||
},
|
||||
Modprobe: []*osbuild.ModprobeStageOptions{
|
||||
|
|
@ -479,18 +479,18 @@ var defaultAzureImageConfig = &distro.ImageConfig{
|
|||
},
|
||||
PwQuality: &osbuild.PwqualityConfStageOptions{
|
||||
Config: osbuild.PwqualityConfConfig{
|
||||
Minlen: common.IntToPtr(6),
|
||||
Minclass: common.IntToPtr(3),
|
||||
Dcredit: common.IntToPtr(0),
|
||||
Ucredit: common.IntToPtr(0),
|
||||
Lcredit: common.IntToPtr(0),
|
||||
Ocredit: common.IntToPtr(0),
|
||||
Minlen: common.ToPtr(6),
|
||||
Minclass: common.ToPtr(3),
|
||||
Dcredit: common.ToPtr(0),
|
||||
Ucredit: common.ToPtr(0),
|
||||
Lcredit: common.ToPtr(0),
|
||||
Ocredit: common.ToPtr(0),
|
||||
},
|
||||
},
|
||||
WAAgentConfig: &osbuild.WAAgentConfStageOptions{
|
||||
Config: osbuild.WAAgentConfig{
|
||||
RDFormat: common.BoolToPtr(false),
|
||||
RDEnableSwap: common.BoolToPtr(false),
|
||||
RDFormat: common.ToPtr(false),
|
||||
RDEnableSwap: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
Grub2Config: &osbuild.GRUB2Config{
|
||||
|
|
@ -530,7 +530,7 @@ var defaultAzureImageConfig = &distro.ImageConfig{
|
|||
},
|
||||
},
|
||||
},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
}
|
||||
|
||||
// Diff of the default Image Config compare to the `defaultAzureImageConfig`
|
||||
|
|
@ -542,7 +542,7 @@ var defaultAzureByosImageConfig = &distro.ImageConfig{
|
|||
distro.RHSMConfigNoSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// Don't disable RHSM redhat.repo management on the GCE
|
||||
// image, which is BYOS and does not use RHUI for content.
|
||||
|
|
@ -556,7 +556,7 @@ var defaultAzureByosImageConfig = &distro.ImageConfig{
|
|||
distro.RHSMConfigWithSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
@ -580,17 +580,17 @@ var defaultAzureRhuiImageConfig = &distro.ImageConfig{
|
|||
},
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
Rhsm: &osbuild.SubManConfigRHSMSection{
|
||||
ManageRepos: common.BoolToPtr(false),
|
||||
ManageRepos: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
distro.RHSMConfigWithSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ type distribution struct {
|
|||
|
||||
// CentOS- and RHEL-based OS image configuration defaults
|
||||
var defaultDistroImageConfig = &distro.ImageConfig{
|
||||
Timezone: common.StringToPtr("America/New_York"),
|
||||
Locale: common.StringToPtr("C.UTF-8"),
|
||||
Timezone: common.ToPtr("America/New_York"),
|
||||
Locale: common.ToPtr("C.UTF-8"),
|
||||
Sysconfig: []*osbuild.SysconfigStageOptions{
|
||||
{
|
||||
Kernel: &osbuild.SysconfigKernelOptions{
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ var (
|
|||
mimeType: "application/xz",
|
||||
packageSets: nil,
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
},
|
||||
defaultSize: 10 * common.GibiByte,
|
||||
rpmOstree: true,
|
||||
|
|
@ -89,7 +89,7 @@ var (
|
|||
installerPkgsKey: edgeInstallerPackageSet,
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
EnabledServices: edgeServices,
|
||||
},
|
||||
rpmOstree: true,
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ func mkGCERHUIImageType(rhsm bool) imageType {
|
|||
|
||||
func baseGCEImageConfig(rhsm bool) *distro.ImageConfig {
|
||||
ic := &distro.ImageConfig{
|
||||
Timezone: common.StringToPtr("UTC"),
|
||||
Timezone: common.ToPtr("UTC"),
|
||||
TimeSynchronization: &osbuild.ChronyStageOptions{
|
||||
Servers: []osbuild.ChronyConfigServer{{Hostname: "metadata.google.internal"}},
|
||||
},
|
||||
|
|
@ -83,8 +83,8 @@ func baseGCEImageConfig(rhsm bool) *distro.ImageConfig {
|
|||
"sshd-keygen@",
|
||||
"reboot.target",
|
||||
},
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
Keyboard: &osbuild.KeymapStageOptions{
|
||||
Keymap: "us",
|
||||
},
|
||||
|
|
@ -100,7 +100,7 @@ func baseGCEImageConfig(rhsm bool) *distro.ImageConfig {
|
|||
DNFAutomaticConfig: &osbuild.DNFAutomaticConfigStageOptions{
|
||||
Config: &osbuild.DNFAutomaticConfig{
|
||||
Commands: &osbuild.DNFAutomaticConfigCommands{
|
||||
ApplyUpdates: common.BoolToPtr(true),
|
||||
ApplyUpdates: common.ToPtr(true),
|
||||
UpgradeType: osbuild.DNFAutomaticUpgradeTypeSecurity,
|
||||
},
|
||||
},
|
||||
|
|
@ -113,11 +113,11 @@ func baseGCEImageConfig(rhsm bool) *distro.ImageConfig {
|
|||
Id: "google-compute-engine",
|
||||
Name: "Google Compute Engine",
|
||||
BaseURL: []string{"https://packages.cloud.google.com/yum/repos/google-compute-engine-el9-x86_64-stable"},
|
||||
Enabled: common.BoolToPtr(true),
|
||||
Enabled: common.ToPtr(true),
|
||||
// TODO: enable GPG check once Google stops using SHA-1 in their keys
|
||||
// https://issuetracker.google.com/issues/223626963
|
||||
GPGCheck: common.BoolToPtr(false),
|
||||
RepoGPGCheck: common.BoolToPtr(false),
|
||||
GPGCheck: common.ToPtr(false),
|
||||
RepoGPGCheck: common.ToPtr(false),
|
||||
GPGKey: []string{
|
||||
"https://packages.cloud.google.com/yum/doc/yum-key.gpg",
|
||||
"https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg",
|
||||
|
|
@ -128,8 +128,8 @@ func baseGCEImageConfig(rhsm bool) *distro.ImageConfig {
|
|||
},
|
||||
SshdConfig: &osbuild.SshdConfigStageOptions{
|
||||
Config: osbuild.SshdConfigConfig{
|
||||
PasswordAuthentication: common.BoolToPtr(false),
|
||||
ClientAliveInterval: common.IntToPtr(420),
|
||||
PasswordAuthentication: common.ToPtr(false),
|
||||
ClientAliveInterval: common.ToPtr(420),
|
||||
PermitRootLogin: osbuild.PermitRootLoginValueNo,
|
||||
},
|
||||
},
|
||||
|
|
@ -153,7 +153,7 @@ func baseGCEImageConfig(rhsm bool) *distro.ImageConfig {
|
|||
ConfigScope: osbuild.GcpGuestAgentConfigScopeDistro,
|
||||
Config: &osbuild.GcpGuestAgentConfig{
|
||||
InstanceSetup: &osbuild.GcpGuestAgentConfigInstanceSetup{
|
||||
SetBotoConfig: common.BoolToPtr(false),
|
||||
SetBotoConfig: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -164,7 +164,7 @@ func baseGCEImageConfig(rhsm bool) *distro.ImageConfig {
|
|||
distro.RHSMConfigNoSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// Don't disable RHSM redhat.repo management on the GCE
|
||||
// image, which is BYOS and does not use RHUI for content.
|
||||
|
|
@ -178,7 +178,7 @@ func baseGCEImageConfig(rhsm bool) *distro.ImageConfig {
|
|||
distro.RHSMConfigWithSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
@ -195,17 +195,17 @@ func defaultGceRhuiImageConfig(rhsm bool) *distro.ImageConfig {
|
|||
distro.RHSMConfigNoSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
Rhsm: &osbuild.SubManConfigRHSMSection{
|
||||
ManageRepos: common.BoolToPtr(false),
|
||||
ManageRepos: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
distro.RHSMConfigWithSubscription: {
|
||||
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||
AutoRegistration: common.BoolToPtr(true),
|
||||
AutoRegistration: common.ToPtr(true),
|
||||
},
|
||||
// do not disable the redhat.repo management if the user
|
||||
// explicitly request the system to be subscribed
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ var (
|
|||
osPkgsKey: openstackCommonPackageSet,
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
},
|
||||
kernelOptions: "ro net.ifnames=0",
|
||||
bootable: true,
|
||||
|
|
@ -129,7 +129,7 @@ func openstackCommonPackageSet(t *imageType) rpmmd.PackageSet {
|
|||
|
||||
func qcowImageConfig(d distribution) *distro.ImageConfig {
|
||||
ic := &distro.ImageConfig{
|
||||
DefaultTarget: common.StringToPtr("multi-user.target"),
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
}
|
||||
if d.isRHEL() {
|
||||
ic.RHSMConfig = map[distro.RHSMSubscriptionStatus]*osbuild.RHSMStageOptions{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ var vmdkImgType = imageType{
|
|||
osPkgsKey: vmdkCommonPackageSet,
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
Locale: common.StringToPtr("en_US.UTF-8"),
|
||||
Locale: common.ToPtr("en_US.UTF-8"),
|
||||
},
|
||||
kernelOptions: "ro net.ifnames=0",
|
||||
bootable: true,
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ func (img *LiveImage) InstantiateManifest(m *manifest.Manifest,
|
|||
archivePipeline.Format = osbuild.TarArchiveFormatOldgnu
|
||||
archivePipeline.RootNode = osbuild.TarRootNodeOmit
|
||||
// these are required to successfully import the image to GCP
|
||||
archivePipeline.ACLs = common.BoolToPtr(false)
|
||||
archivePipeline.SELinux = common.BoolToPtr(false)
|
||||
archivePipeline.Xattrs = common.BoolToPtr(false)
|
||||
archivePipeline.ACLs = common.ToPtr(false)
|
||||
archivePipeline.SELinux = common.ToPtr(false)
|
||||
archivePipeline.Xattrs = common.ToPtr(false)
|
||||
archivePipeline.Filename = img.Filename // filename extension will determine compression
|
||||
default:
|
||||
panic("invalid image format for image kind")
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
|
|||
userOptions := &osbuild.UsersStageOptions{
|
||||
Users: map[string]osbuild.UsersStageOptionsUser{
|
||||
"root": {
|
||||
Password: common.StringToPtr("!locked"), // this is treated as crypted and locks/disables the password
|
||||
Password: common.ToPtr("!locked"), // this is treated as crypted and locks/disables the password
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ func nginxConfigStageOptions(path, htmlRoot, listen string) *osbuild.NginxConfig
|
|||
cfg := &osbuild.NginxConfig{
|
||||
Listen: listen,
|
||||
Root: htmlRoot,
|
||||
Daemon: common.BoolToPtr(false),
|
||||
Daemon: common.ToPtr(false),
|
||||
PID: "/tmp/nginx.pid",
|
||||
}
|
||||
return &osbuild.NginxConfigStageOptions{
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import (
|
|||
// operating system independently of where and how it is integrated and what
|
||||
// workload it is running.
|
||||
// TODO: move out kernel/bootloader/cloud-init/... to other
|
||||
//
|
||||
// abstractions, this should ideally only contain things that
|
||||
// can always be applied.
|
||||
type OSCustomizations struct {
|
||||
|
|
@ -274,7 +275,7 @@ func (p *OS) serialize() osbuild.Pipeline {
|
|||
}
|
||||
rpmOptions.GPGKeysFromTree = p.GPGKeyFiles
|
||||
if p.OSTreeRef != "" {
|
||||
rpmOptions.OSTreeBooted = common.BoolToPtr(true)
|
||||
rpmOptions.OSTreeBooted = common.ToPtr(true)
|
||||
rpmOptions.DBPath = "/usr/share/rpm"
|
||||
}
|
||||
pipeline.AddStage(osbuild.NewRPMStage(rpmOptions, osbuild.NewRpmStageSourceFilesInputs(p.packageSpecs)))
|
||||
|
|
@ -283,7 +284,7 @@ func (p *OS) serialize() osbuild.Pipeline {
|
|||
if p.PartitionTable == nil || p.PartitionTable.FindMountable("/boot") == nil {
|
||||
pipeline.AddStage(osbuild.NewFixBLSStage(&osbuild.FixBLSStageOptions{}))
|
||||
} else {
|
||||
pipeline.AddStage(osbuild.NewFixBLSStage(&osbuild.FixBLSStageOptions{Prefix: common.StringToPtr("")}))
|
||||
pipeline.AddStage(osbuild.NewFixBLSStage(&osbuild.FixBLSStageOptions{Prefix: common.ToPtr("")}))
|
||||
}
|
||||
|
||||
if len(p.Containers) > 0 {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewCloudInitStage(t *testing.T) {
|
||||
|
|
@ -190,7 +191,7 @@ func TestCloudInitStage_UnmarshalJSON(t *testing.T) {
|
|||
Filename: "06_logging_override.cfg",
|
||||
Config: CloudInitConfigFile{
|
||||
Output: &CloudInitConfigOutput{
|
||||
All: common.StringToPtr(">> /var/log/cloud-init-all.log"),
|
||||
All: common.ToPtr(">> /var/log/cloud-init-all.log"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ package osbuild
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewDNFAutomaticConfigStage(t *testing.T) {
|
||||
|
|
@ -33,7 +34,7 @@ func TestDNFAutomaticConfigStageOptionsValidate(t *testing.T) {
|
|||
options: DNFAutomaticConfigStageOptions{
|
||||
Config: &DNFAutomaticConfig{
|
||||
Commands: &DNFAutomaticConfigCommands{
|
||||
ApplyUpdates: common.BoolToPtr(true),
|
||||
ApplyUpdates: common.ToPtr(true),
|
||||
UpgradeType: "invalid",
|
||||
},
|
||||
},
|
||||
|
|
@ -45,7 +46,7 @@ func TestDNFAutomaticConfigStageOptionsValidate(t *testing.T) {
|
|||
options: DNFAutomaticConfigStageOptions{
|
||||
Config: &DNFAutomaticConfig{
|
||||
Commands: &DNFAutomaticConfigCommands{
|
||||
ApplyUpdates: common.BoolToPtr(true),
|
||||
ApplyUpdates: common.ToPtr(true),
|
||||
UpgradeType: DNFAutomaticUpgradeTypeDefault,
|
||||
},
|
||||
},
|
||||
|
|
@ -57,7 +58,7 @@ func TestDNFAutomaticConfigStageOptionsValidate(t *testing.T) {
|
|||
options: DNFAutomaticConfigStageOptions{
|
||||
Config: &DNFAutomaticConfig{
|
||||
Commands: &DNFAutomaticConfigCommands{
|
||||
ApplyUpdates: common.BoolToPtr(false),
|
||||
ApplyUpdates: common.ToPtr(false),
|
||||
UpgradeType: DNFAutomaticUpgradeTypeSecurity,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@ import (
|
|||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewGrub2InstStage(t *testing.T) {
|
||||
|
|
@ -24,7 +25,7 @@ func TestNewGrub2InstStage(t *testing.T) {
|
|||
Number: 1,
|
||||
Path: "/boot/grub2",
|
||||
},
|
||||
SectorSize: common.Uint64ToPtr(512),
|
||||
SectorSize: common.ToPtr(uint64(512)),
|
||||
}
|
||||
|
||||
expectedStage := &Stage{
|
||||
|
|
@ -53,7 +54,7 @@ func TestMarshalGrub2InstStage(t *testing.T) {
|
|||
Number: 1,
|
||||
Path: "/boot/grub2",
|
||||
},
|
||||
SectorSize: common.Uint64ToPtr(512),
|
||||
SectorSize: common.ToPtr(uint64(512)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ func (GRUB2LegacyStageOptions) isStageOptions() {}
|
|||
func MakeGrub2MenuEntries(id string, kernelVer string, product GRUB2Product, rescue bool) []GRUB2MenuEntry {
|
||||
entries := []GRUB2MenuEntry{
|
||||
{
|
||||
Default: common.BoolToPtr(true),
|
||||
Default: common.ToPtr(true),
|
||||
Id: id,
|
||||
Product: product,
|
||||
Kernel: kernelVer,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package osbuild
|
|||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/disk"
|
||||
|
|
@ -113,7 +114,7 @@ func NewGrub2StageOptionsUnified(pt *disk.PartitionTable,
|
|||
stageOptions := GRUB2StageOptions{
|
||||
RootFilesystemUUID: uuid.MustParse(rootFs.GetFSSpec().UUID),
|
||||
Legacy: legacy,
|
||||
WriteCmdLine: common.BoolToPtr(false),
|
||||
WriteCmdLine: common.ToPtr(false),
|
||||
}
|
||||
|
||||
bootFs := pt.FindMountable("/boot")
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewMkfsStage(t *testing.T) {
|
||||
|
|
@ -13,7 +14,7 @@ func TestNewMkfsStage(t *testing.T) {
|
|||
Filename: "file.img",
|
||||
Start: 0,
|
||||
Size: 1024,
|
||||
SectorSize: common.Uint64ToPtr(512),
|
||||
SectorSize: common.ToPtr(uint64(512)),
|
||||
}
|
||||
device := NewLoopbackDevice(&devOpts)
|
||||
|
||||
|
|
@ -48,7 +49,7 @@ func TestNewMkfsStage(t *testing.T) {
|
|||
fatOptions := &MkfsFATStageOptions{
|
||||
VolID: "7B7795E7",
|
||||
Label: "test",
|
||||
FATSize: common.IntToPtr(12),
|
||||
FATSize: common.ToPtr(12),
|
||||
}
|
||||
mkfat := NewMkfsFATStage(fatOptions, devices)
|
||||
mkfatExpected := &Stage{
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewPwqualityConfStage(t *testing.T) {
|
||||
|
|
@ -22,9 +23,9 @@ func TestJsonPwqualityConfStage(t *testing.T) {
|
|||
// First test that the JSON can be parsed into the expected structure.
|
||||
expectedOptions := PwqualityConfStageOptions{
|
||||
Config: PwqualityConfConfig{
|
||||
Minlen: common.IntToPtr(9),
|
||||
Minclass: common.IntToPtr(0),
|
||||
Dcredit: common.IntToPtr(1),
|
||||
Minlen: common.ToPtr(9),
|
||||
Minclass: common.ToPtr(0),
|
||||
Dcredit: common.ToPtr(1),
|
||||
},
|
||||
}
|
||||
inputString := `{
|
||||
|
|
@ -43,8 +44,8 @@ func TestJsonPwqualityConfStage(t *testing.T) {
|
|||
// for those parameters that the user didn't specify.
|
||||
inputOptions = PwqualityConfStageOptions{
|
||||
Config: PwqualityConfConfig{
|
||||
Minlen: common.IntToPtr(9),
|
||||
Minclass: common.IntToPtr(0),
|
||||
Minlen: common.ToPtr(9),
|
||||
Minclass: common.ToPtr(0),
|
||||
},
|
||||
}
|
||||
expectedString := `{"config":{"minlen":9,"minclass":0}}`
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewQemuStage(t *testing.T) {
|
||||
|
|
@ -138,13 +139,13 @@ func TestNewQEMUStageOptions(t *testing.T) {
|
|||
Filename: "image.vpc",
|
||||
Format: QEMUFormatVPC,
|
||||
FormatOptions: VPCOptions{
|
||||
ForceSize: common.BoolToPtr(false),
|
||||
ForceSize: common.ToPtr(false),
|
||||
},
|
||||
ExpectedOptions: &QEMUStageOptions{
|
||||
Filename: "image.vpc",
|
||||
Format: VPCOptions{
|
||||
Type: QEMUFormatVPC,
|
||||
ForceSize: common.BoolToPtr(false),
|
||||
ForceSize: common.ToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ import (
|
|||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestStageResult_UnmarshalJSON(t *testing.T) {
|
||||
|
|
@ -256,7 +257,7 @@ func TestWrite(t *testing.T) {
|
|||
Name: "vim-minimal",
|
||||
Version: "8.0.1763",
|
||||
Release: "15.el8",
|
||||
Epoch: common.StringToPtr("2"),
|
||||
Epoch: common.ToPtr("2"),
|
||||
Arch: "x86_64",
|
||||
SigMD5: "4b3ddc56cbb1be95e0973b4a98047820",
|
||||
SigPGP: "8902150305005ed77b28199e2f91fd431d510108a4141000995156bc9f610ad386ee49c42ab31c864fc605cae26592ba58f973fe97b54ea12b42c8e7ee2d716162714fe815de63b60cadb7400a0c71aa56dd3b0af656c6ea413eaaada53374e2e910e556d90e4d157a5b41a6540e355a0176fb3879bf17d90533d1aa3b3d23f06a99a42ad80f17498af2c321193b7be5a504f5dc759d6787a180f9fb3c1903be75f448429537eb0abeb96bb2e73cdc5fe91465c3d54154f6717ffd0a1b42a178e5093500d475639ef60ee483a1ec0d3148d23e0c2ab7bde7c68e5dfdd1103f8e9da7d53ec637c057bc1496d0504fe92760942f9f6de7382fbdef481489c7f6f943bf7fb8c8aadb6484569a6a8f074db78f84579dbaccc86c1eb49379b47033a9eca2577df00d60b353b08bc3850d852365792f194dd8b2b9ba4a1ad5c103afd4db853382520a64ecc362339f3642f4f1ad4e52d8f67b2e731b8d10cef29cb3ed05837245bfca37335f3760f3fb64cbf7acae7e18916a3d4272b0d1589320ab963123649eb9722c8c0e444952900caf39caa371fa77bec8a0e4b010f370eab3d4fe5653a38d88a5a4a415a89f917a31da856a4616ae07ce5749d90ac84bb9189263b162e0cf54ba58a8012d64c89196abae9113e0cda60b4e86879e23d8693691a234784ad3e161733798a0aa41416c045feeb8e2f5859a8a64272298da3d2c1ece675ee802fe8cb273e0b3c1b0f00960d3da09adbdbc531e",
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ package osbuild
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewSkopeoSource(t *testing.T) {
|
||||
|
|
@ -13,14 +14,14 @@ func TestNewSkopeoSource(t *testing.T) {
|
|||
|
||||
source := NewSkopeoSource()
|
||||
|
||||
source.AddItem("name", testDigest, imageID, common.BoolToPtr(false))
|
||||
source.AddItem("name", testDigest, imageID, common.ToPtr(false))
|
||||
assert.Len(t, source.Items, 1)
|
||||
|
||||
item, ok := source.Items[imageID]
|
||||
assert.True(t, ok)
|
||||
assert.Equal(t, item.Image.Name, "name")
|
||||
assert.Equal(t, item.Image.Digest, testDigest)
|
||||
assert.Equal(t, item.Image.TLSVerify, common.BoolToPtr(false))
|
||||
assert.Equal(t, item.Image.TLSVerify, common.ToPtr(false))
|
||||
|
||||
testDigest = "sha256:d49eebefb6c7ce5505594bef652bd4adc36f413861bd44209d9b9486310b1264"
|
||||
imageID = "sha256:d2ab8fea7f08a22f03b30c13c6ea443121f25e87202a7496e93736efa6fe345a"
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewSshdConfigStage(t *testing.T) {
|
||||
|
|
@ -22,9 +23,9 @@ func TestJsonSshdConfigStage(t *testing.T) {
|
|||
// First test that the JSON can be parsed into the expected structure.
|
||||
expectedOptions := SshdConfigStageOptions{
|
||||
Config: SshdConfigConfig{
|
||||
PasswordAuthentication: common.BoolToPtr(false),
|
||||
ChallengeResponseAuthentication: common.BoolToPtr(false),
|
||||
ClientAliveInterval: common.IntToPtr(180),
|
||||
PasswordAuthentication: common.ToPtr(false),
|
||||
ChallengeResponseAuthentication: common.ToPtr(false),
|
||||
ClientAliveInterval: common.ToPtr(180),
|
||||
PermitRootLogin: PermitRootLoginValueProhibitPassword,
|
||||
},
|
||||
}
|
||||
|
|
@ -45,7 +46,7 @@ func TestJsonSshdConfigStage(t *testing.T) {
|
|||
// for those parameters that the user didn't specify.
|
||||
inputOptions = SshdConfigStageOptions{
|
||||
Config: SshdConfigConfig{
|
||||
PasswordAuthentication: common.BoolToPtr(true),
|
||||
PasswordAuthentication: common.ToPtr(true),
|
||||
},
|
||||
}
|
||||
expectedString := `{"config":{"PasswordAuthentication":true}}`
|
||||
|
|
|
|||
|
|
@ -5,9 +5,10 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewYumConfigStage(t *testing.T) {
|
||||
|
|
@ -22,7 +23,7 @@ func TestNewYumConfigStage(t *testing.T) {
|
|||
func TestJsonYumConfigStage(t *testing.T) {
|
||||
expectedOptions := YumConfigStageOptions{
|
||||
Config: &YumConfigConfig{
|
||||
HttpCaching: common.StringToPtr("packages"),
|
||||
HttpCaching: common.ToPtr("packages"),
|
||||
},
|
||||
Plugins: &YumConfigPlugins{
|
||||
&YumConfigPluginsLangpacks{
|
||||
|
|
@ -47,7 +48,7 @@ func TestJsonYumConfigStage(t *testing.T) {
|
|||
|
||||
inputOptions = YumConfigStageOptions{
|
||||
Config: &YumConfigConfig{
|
||||
HttpCaching: common.StringToPtr("packages"),
|
||||
HttpCaching: common.ToPtr("packages"),
|
||||
},
|
||||
}
|
||||
expectedString := `{"config":{"http_caching":"packages"}}`
|
||||
|
|
@ -88,7 +89,7 @@ func TestYumConfigValidate(t *testing.T) {
|
|||
{
|
||||
YumConfigStageOptions{
|
||||
Config: &YumConfigConfig{
|
||||
HttpCaching: common.StringToPtr(""),
|
||||
HttpCaching: common.ToPtr(""),
|
||||
},
|
||||
},
|
||||
false,
|
||||
|
|
@ -96,7 +97,7 @@ func TestYumConfigValidate(t *testing.T) {
|
|||
{
|
||||
YumConfigStageOptions{
|
||||
Config: &YumConfigConfig{
|
||||
HttpCaching: common.StringToPtr("all"),
|
||||
HttpCaching: common.ToPtr("all"),
|
||||
},
|
||||
},
|
||||
true,
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ package osbuild
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
func TestNewYumReposStage(t *testing.T) {
|
||||
|
|
@ -125,12 +126,12 @@ func TestYumReposStageOptionsValidate(t *testing.T) {
|
|||
Repos: []YumRepository{
|
||||
{
|
||||
Id: "cool-id",
|
||||
Cost: common.IntToPtr(0),
|
||||
Enabled: common.BoolToPtr(false),
|
||||
ModuleHotfixes: common.BoolToPtr(false),
|
||||
Cost: common.ToPtr(0),
|
||||
Enabled: common.ToPtr(false),
|
||||
ModuleHotfixes: common.ToPtr(false),
|
||||
Name: "c@@l-name",
|
||||
GPGCheck: common.BoolToPtr(true),
|
||||
RepoGPGCheck: common.BoolToPtr(true),
|
||||
GPGCheck: common.ToPtr(true),
|
||||
RepoGPGCheck: common.ToPtr(true),
|
||||
BaseURL: []string{"http://example.org/repo"},
|
||||
GPGKey: []string{"secretkey"},
|
||||
},
|
||||
|
|
@ -145,12 +146,12 @@ func TestYumReposStageOptionsValidate(t *testing.T) {
|
|||
Repos: []YumRepository{
|
||||
{
|
||||
Id: "cool-id",
|
||||
Cost: common.IntToPtr(200),
|
||||
Enabled: common.BoolToPtr(true),
|
||||
ModuleHotfixes: common.BoolToPtr(true),
|
||||
Cost: common.ToPtr(200),
|
||||
Enabled: common.ToPtr(true),
|
||||
ModuleHotfixes: common.ToPtr(true),
|
||||
Name: "c@@l-name",
|
||||
GPGCheck: common.BoolToPtr(false),
|
||||
RepoGPGCheck: common.BoolToPtr(false),
|
||||
GPGCheck: common.ToPtr(false),
|
||||
RepoGPGCheck: common.ToPtr(false),
|
||||
Mirrorlist: "http://example.org/mirrorlist",
|
||||
GPGKey: []string{"secretkey"},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@ import (
|
|||
"sort"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestRPMDeduplication(t *testing.T) {
|
||||
|
|
@ -54,7 +55,7 @@ func TestRPMDeduplication(t *testing.T) {
|
|||
Name: "package-with-epoch",
|
||||
Version: "0.1",
|
||||
Release: "a",
|
||||
Epoch: common.StringToPtr("8"),
|
||||
Epoch: common.ToPtr("8"),
|
||||
Arch: "x86_64",
|
||||
SigMD5: "*",
|
||||
SigPGP: "*",
|
||||
|
|
@ -70,7 +71,7 @@ func TestRPMDeduplication(t *testing.T) {
|
|||
Name: "vim-minimal",
|
||||
Version: "8.0.1763",
|
||||
Release: "15.el8",
|
||||
Epoch: common.StringToPtr("2"),
|
||||
Epoch: common.ToPtr("2"),
|
||||
Arch: "x86_64",
|
||||
SigMD5: "v",
|
||||
SigPGP: "v",
|
||||
|
|
@ -80,7 +81,7 @@ func TestRPMDeduplication(t *testing.T) {
|
|||
Name: "vim-minimal",
|
||||
Version: "8.0.1763",
|
||||
Release: "15.el8",
|
||||
Epoch: common.StringToPtr("2"),
|
||||
Epoch: common.ToPtr("2"),
|
||||
Arch: "x86_64",
|
||||
SigMD5: "v",
|
||||
SigPGP: "v",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import (
|
|||
"github.com/osbuild/osbuild-composer/internal/target"
|
||||
)
|
||||
|
||||
//struct for sharing state between tests
|
||||
// struct for sharing state between tests
|
||||
type storeTest struct {
|
||||
suite.Suite
|
||||
dir string
|
||||
|
|
@ -41,7 +41,7 @@ type storeTest struct {
|
|||
myPackages []rpmmd.PackageSpec
|
||||
}
|
||||
|
||||
//func to initialize some default values before the suite is ran
|
||||
// func to initialize some default values before the suite is ran
|
||||
func (suite *storeTest) SetupSuite() {
|
||||
suite.myRepoConfig = []rpmmd.RepoConfig{rpmmd.RepoConfig{
|
||||
Name: "testRepo",
|
||||
|
|
@ -93,7 +93,7 @@ func (suite *storeTest) SetupSuite() {
|
|||
{
|
||||
Source: "https://registry.example.com/container",
|
||||
Name: "example-container",
|
||||
TLSVerify: common.BoolToPtr(true),
|
||||
TLSVerify: common.ToPtr(true),
|
||||
},
|
||||
},
|
||||
Customizations: &suite.myCustomizations,
|
||||
|
|
@ -137,7 +137,7 @@ func (suite *storeTest) SetupSuite() {
|
|||
|
||||
}
|
||||
|
||||
//setup before each test
|
||||
// setup before each test
|
||||
func (suite *storeTest) SetupTest() {
|
||||
distro := test_distro.New()
|
||||
_, err := distro.GetArch(test_distro.TestArchName)
|
||||
|
|
@ -153,7 +153,7 @@ func (suite *storeTest) TestRandomSHA1String() {
|
|||
suite.Len(hash, 40)
|
||||
}
|
||||
|
||||
//Check initial state of fields
|
||||
// Check initial state of fields
|
||||
func (suite *storeTest) TestNewEmpty() {
|
||||
suite.Empty(suite.myStore.blueprints)
|
||||
suite.Empty(suite.myStore.workspace)
|
||||
|
|
@ -164,7 +164,7 @@ func (suite *storeTest) TestNewEmpty() {
|
|||
suite.Equal(&suite.dir, suite.myStore.stateDir)
|
||||
}
|
||||
|
||||
//Push a blueprint
|
||||
// Push a blueprint
|
||||
func (suite *storeTest) TestPushBlueprint() {
|
||||
suite.myStore.PushBlueprint(suite.myBP, "testing commit")
|
||||
suite.Equal(suite.myBP, suite.myStore.blueprints["testBP"])
|
||||
|
|
@ -173,13 +173,13 @@ func (suite *storeTest) TestPushBlueprint() {
|
|||
suite.Equal("0.0.2", suite.myStore.blueprints["testBP"].Version)
|
||||
}
|
||||
|
||||
//List the blueprint
|
||||
// List the blueprint
|
||||
func (suite *storeTest) TestListBlueprints() {
|
||||
suite.myStore.blueprints["testBP"] = suite.myBP
|
||||
suite.Equal([]string{"testBP"}, suite.myStore.ListBlueprints())
|
||||
}
|
||||
|
||||
//Push a blueprint to workspace
|
||||
// Push a blueprint to workspace
|
||||
func (suite *storeTest) TestPushBlueprintToWorkspace() {
|
||||
suite.NoError(suite.myStore.PushBlueprintToWorkspace(suite.myBP))
|
||||
suite.Equal(suite.myBP, suite.myStore.workspace["testBP"])
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@ func TestBlueprintsCustomizationInfoToml(t *testing.T) {
|
|||
},
|
||||
},
|
||||
Customizations: &blueprint.Customizations{
|
||||
Hostname: common.StringToPtr("custombase"),
|
||||
Hostname: common.ToPtr("custombase"),
|
||||
Kernel: &blueprint.KernelCustomization{
|
||||
Append: "nosmt=force",
|
||||
},
|
||||
|
|
@ -556,12 +556,12 @@ func TestBlueprintsCustomizationInfoToml(t *testing.T) {
|
|||
User: []blueprint.UserCustomization{
|
||||
blueprint.UserCustomization{
|
||||
Name: "admin",
|
||||
Description: common.StringToPtr("Widget admin account"),
|
||||
Password: common.StringToPtr("$6$CHO2$3rN8eviE2t50lmVyBYihTgVRHcaecmeCk31LeOUleVK/R/aeWVHVZDi26zAH.o0ywBKH9Tc0/wm7sW/q39uyd1"),
|
||||
Home: common.StringToPtr("/srv/widget/"),
|
||||
Shell: common.StringToPtr("/usr/bin/bash"),
|
||||
Description: common.ToPtr("Widget admin account"),
|
||||
Password: common.ToPtr("$6$CHO2$3rN8eviE2t50lmVyBYihTgVRHcaecmeCk31LeOUleVK/R/aeWVHVZDi26zAH.o0ywBKH9Tc0/wm7sW/q39uyd1"),
|
||||
Home: common.ToPtr("/srv/widget/"),
|
||||
Shell: common.ToPtr("/usr/bin/bash"),
|
||||
Groups: []string{"widget", "users", "students"},
|
||||
UID: common.IntToPtr(1200),
|
||||
UID: common.ToPtr(1200),
|
||||
},
|
||||
},
|
||||
Group: []blueprint.GroupCustomization{
|
||||
|
|
@ -573,12 +573,12 @@ func TestBlueprintsCustomizationInfoToml(t *testing.T) {
|
|||
},
|
||||
},
|
||||
Timezone: &blueprint.TimezoneCustomization{
|
||||
Timezone: common.StringToPtr("US/Eastern"),
|
||||
Timezone: common.ToPtr("US/Eastern"),
|
||||
NTPServers: []string{"0.north-america.pool.ntp.org", "1.north-america.pool.ntp.org"},
|
||||
},
|
||||
Locale: &blueprint.LocaleCustomization{
|
||||
Languages: []string{"en_US.UTF-8"},
|
||||
Keyboard: common.StringToPtr("us"),
|
||||
Keyboard: common.ToPtr("us"),
|
||||
},
|
||||
Firewall: &blueprint.FirewallCustomization{
|
||||
Ports: []string{"22:tcp", "80:tcp", "imap:tcp", "53:tcp", "53:udp"},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue