Skip to content

Commit

Permalink
docs: remove outdated todo comments (#743)
Browse files Browse the repository at this point in the history
Signed-off-by: Miaha Cybersec <[email protected]>
  • Loading branch information
MiahaCybersec authored Aug 19, 2024
1 parent f0cb34a commit 9e83f83
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion pkg/patch/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ func patchWithContext(ctx context.Context, ch chan error, image, reportFile, pat
}

// Export the patched image state to Docker
// TODO: Add support for other output modes as buildctl does.
patchedImageState, errPkgs, err := manager.InstallUpdates(ctx, updates, ignoreError)
if err != nil {
ch <- err
Expand Down
5 changes: 0 additions & 5 deletions pkg/pkgmgr/apk.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,7 @@ func (am *apkManager) InstallUpdates(ctx context.Context, manifest *unversioned.
// Patch a regular alpine image with:
// - sh and apk installed on the image
// - valid apk db state on the image
//
// TODO: support "distroless" Alpine images (e.g. APKO images)
// Still assumes that APK exists in the target image and is pathed, which can be addressed by
// mounting a copy of apk-tools-static into the image and invoking apk-static directly.
func (am *apkManager) upgradePackages(ctx context.Context, updates unversioned.UpdatePackages, ignoreErrors bool) (*llb.State, []byte, error) {
// TODO: Add support for custom APK config
apkUpdated := am.config.ImageState.Run(llb.Shlex("apk update"), llb.WithProxy(utils.GetProxy()), llb.IgnoreCache).Root()

// If updating all packages, check for upgrades before proceeding with patch
Expand Down
10 changes: 1 addition & 9 deletions pkg/pkgmgr/dpkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ func getAPTImageName(manifest *unversioned.UpdateManifest, osVersion string) str
osType = manifest.Metadata.OS.Type
}

// TODO: support qualifying image name with designated repository
log.Debugf("Using %s:%s as basis for tooling image", osType, version)
return fmt.Sprintf("%s:%s", osType, version)
}
Expand Down Expand Up @@ -302,15 +301,8 @@ func GetPackageInfo(file string) (string, string, error) {
// - sh and apt installed on the image
// - valid dpkg status on the image
//
// Images Images with neither (i.e. Google Debian Distroless) should be patched with unpackAndMergeUpdates
//
// TODO: Support Debian images with valid dpkg status but missing tools. No current examples exist in test set
// i.e. extra RunOption to mount a copy of busybox-static or full apt install into the image and invoking that.
// Images with neither (i.e. Google Debian Distroless) should be patched with unpackAndMergeUpdates.
func (dm *dpkgManager) installUpdates(ctx context.Context, updates unversioned.UpdatePackages, ignoreErrors bool) (*llb.State, []byte, error) {
// TODO: Add support for custom APT config and gpg key injection
// Since this takes place in the target container, it can interfere with install actions
// such as the installation of the updated debian-archive-keyring package, so it's probably best
// to separate it out to an explicit container edit command or opt-in before patching.
aptUpdated := dm.config.ImageState.Run(
llb.Shlex("apt update"),
llb.WithProxy(utils.GetProxy()),
Expand Down
3 changes: 0 additions & 3 deletions pkg/pkgmgr/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,6 @@ func parseManifestFile(file string) (map[string]string, error) {
// Patch a regular RPM-based image with:
// - sh and an appropriate tool installed on the image (yum, dnf, microdnf)
// - valid rpm database on the image
//
// TODO: Support RPM-based images with valid rpm status but missing tools. (e.g. calico images > v3.21.0)
// i.e. extra RunOption to mount a copy of rpm tools installed into the image and invoking that.
func (rm *rpmManager) installUpdates(ctx context.Context, updates unversioned.UpdatePackages, ignoreErrors bool) (*llb.State, []byte, error) {
pkgs := ""

Expand Down

0 comments on commit 9e83f83

Please sign in to comment.