Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Griffin <[email protected]>
  • Loading branch information
prakrit55 committed Oct 11, 2024
1 parent 7825fd1 commit b85b1a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions integration/fixtures/test-images.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"tag": "1.21.6",
"digest": "sha256:2bcabc23b45489fb0885d69a06ba1d648aeda973fae7bb981bafbb884165e514",
"distro": "Debian",
"description": "Valid dpkg/status, apt-get present",
"description": "Valid dpkg/status, apt present",
"ignoreErrors": false
},
{
Expand All @@ -30,23 +30,23 @@
"digest": "sha256:2bcabc23b45489fb0885d69a06ba1d648aeda973fae7bb981bafbb884165e514",
"localName": "local/image:tag",
"distro": "Debian",
"description": "Valid dpkg/status, apt-get present, locally tagged with repo and image name",
"description": "Valid dpkg/status, apt present, locally tagged with repo and image name",
"ignoreErrors": false
},
{
"image": "registry.k8s.io/kube-proxy",
"tag": "v1.23.4",
"digest": "sha256:30116c7218264d95623d3918a50da703675755cae866cd4c324586611fcd50ea",
"distro": "Debian",
"description": "Valid dpkg/status, apt-get present, custom network config",
"description": "Valid dpkg/status, apt present, custom network config",
"ignoreErrors": false
},
{
"image": "registry.k8s.io/kube-proxy",
"tag": "v1.27.2",
"digest": "sha256:1e4f13f5f5c215813fb9c9c6f56da1c0354363f2a69bd12732658f79d585864f",
"distro": "Custom Google Distroless",
"description": "Custom dpkg/status.d with text names, no apt-get, libssl1.1",
"description": "Custom dpkg/status.d with text names, no apt, libssl1.1",
"ignoreErrors": false
},
{
Expand Down
6 changes: 3 additions & 3 deletions pkg/pkgmgr/dpkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
dpkgLibPath = "/var/lib/dpkg"
dpkgStatusPath = dpkgLibPath + "/status"
dpkgStatusFolder = dpkgLibPath + "/status.d"
dpkgDownloadPath = "/var/cache/apt-get/archives"
dpkgDownloadPath = "/var/cache/apt/archives"

statusdOutputFilename = "statusd_type"
)
Expand Down Expand Up @@ -401,7 +401,7 @@ func (dm *dpkgManager) unpackAndMergeUpdates(ctx context.Context, updates unvers
return nil, nil, fmt.Errorf("unable to marshal dm.packageInfo %w", err)
}

updated = updated.Run(
updated = updated.Run(

Check warning on line 404 in pkg/pkgmgr/dpkg.go

View check run for this annotation

Codecov / codecov/patch

pkg/pkgmgr/dpkg.go#L404

Added line #L404 was not covered by tests
llb.AddEnv("PACKAGES_PRESENT", string(jsonPackageData)),
llb.Args([]string{
`bash`, `-c`, `
Expand All @@ -411,7 +411,7 @@ func (dm *dpkgManager) unpackAndMergeUpdates(ctx context.Context, updates unvers
while IFS=':' read -r package version; do
pkg_name=$(echo "$package" | sed 's/^"\(.*\)"$/\1/')
pkg_version=$(echo "$version" | sed 's/^"\(.*\)"$/\1/')
latest_version=$(apt-get show $pkg_name 2>/dev/null | awk -F ': ' '/Version:/{print $2}')
latest_version=$(apt-cache show $pkg_name 2>/dev/null | awk -F ': ' '/Version:/{print $2}')

Check warning on line 414 in pkg/pkgmgr/dpkg.go

View check run for this annotation

Codecov / codecov/patch

pkg/pkgmgr/dpkg.go#L414

Added line #L414 was not covered by tests
if [ "$latest_version" != "$pkg_version" ]; then
update_packages="$update_packages $pkg_name"
Expand Down
2 changes: 1 addition & 1 deletion website/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Experimental: This feature might change without preserving backwards compatibili

:::

Copa does not support replacing the repositories in the package managers with alternatives. Images must already use the intended package repositories. For example, for debian, updating `/etc/apt-get/sources.list` from `http://archive.ubuntu.com/ubuntu/` to a mirror, such as `https://mirrors.wikimedia.org/ubuntu/`.
Copa does not support replacing the repositories in the package managers with alternatives. Images must already use the intended package repositories. For example, for debian, updating `/etc/apt/sources.list` from `http://archive.ubuntu.com/ubuntu/` to a mirror, such as `https://mirrors.wikimedia.org/ubuntu/`.

If you need the tooling image to use a different package repository, you can create a source policy to define a replacement image and/or pin to a digest. For example, the following source policy replaces `docker.io/library/debian:11-slim` image with `foo.io/bar/baz:latest@sha256:42d3e6bc186572245aded5a0be381012adba6d89355fa9486dd81b0c634695b5`:

Expand Down

0 comments on commit b85b1a8

Please sign in to comment.