Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions controllers/object_controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,13 @@ var rootUID = ptr.To(int64(0))

// RepoConfigPathMap indicates standard OS specific paths for repository configuration files
var RepoConfigPathMap = map[string]string{
"centos": "/etc/yum.repos.d",
"debian": "/etc/apt/sources.list.d",
"ubuntu": "/etc/apt/sources.list.d",
"rhcos": "/etc/yum.repos.d",
"rhel": "/etc/yum.repos.d",
"centos": "/etc/yum.repos.d",
"debian": "/etc/apt/sources.list.d",
"ubuntu": "/etc/apt/sources.list.d",
"rhcos": "/etc/yum.repos.d",
"rhel": "/etc/yum.repos.d",
"sles": "/etc/zypp/repos.d",
"sl-micro": "/etc/zypp/repos.d",
}

// CertConfigPathMap indicates standard OS specific paths for ssl keys/certificates.
Expand Down
16 changes: 16 additions & 0 deletions controllers/object_controls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1479,3 +1479,19 @@ func TestCertConfigPathMap(t *testing.T) {
require.Equal(t, expectedPath, path, "Incorrect path for OS %s", os)
}
}

func TestRepoConfigPathMap(t *testing.T) {
expected := map[string]string{
"ubuntu": "/etc/apt/sources.list.d",
"rhcos": "/etc/yum.repos.d",
"rhel": "/etc/yum.repos.d",
"sles": "/etc/zypp/repos.d",
"sl-micro": "/etc/zypp/repos.d",
}

for os, path := range expected {
val, ok := RepoConfigPathMap[os]
require.True(t, ok, "Expected %s to be in RepoConfigPathMap", os)
require.Equal(t, path, val, "Expected path for %s to be %s", os, path)
}
}
12 changes: 7 additions & 5 deletions internal/state/driver_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ import (

// RepoConfigPathMap indicates standard OS specific paths for repository configuration files
var RepoConfigPathMap = map[string]string{
"centos": "/etc/yum.repos.d",
"debian": "/etc/apt/sources.list.d",
"ubuntu": "/etc/apt/sources.list.d",
"rhcos": "/etc/yum.repos.d",
"rhel": "/etc/yum.repos.d",
"centos": "/etc/yum.repos.d",
"debian": "/etc/apt/sources.list.d",
"ubuntu": "/etc/apt/sources.list.d",
"rhcos": "/etc/yum.repos.d",
"rhel": "/etc/yum.repos.d",
"sles": "/etc/zypp/repos.d",
"sl-micro": "/etc/zypp/repos.d",
}

// CertConfigPathMap indicates standard OS specific paths for ssl keys/certificates.
Expand Down