Skip to content

refactor: remove unused getInitPid function#534

Merged
cmainas merged 2 commits intourunc-dev:main-pr534from
praffq-dev:fix/remove-unused-getInitPid
Mar 18, 2026
Merged

refactor: remove unused getInitPid function#534
cmainas merged 2 commits intourunc-dev:main-pr534from
praffq-dev:fix/remove-unused-getInitPid

Conversation

@praffq-dev
Copy link
Contributor

Remove the dead getInitPid function and its associated tests.

Fixes: #466

Description

Remove the unused getInitPid function and related testcases

Related issues

How was this tested?

getInitPid is not used anywhere, so I rechecked that and remove the code and it's respective test case

LLM usage

No

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

@netlify
Copy link

netlify bot commented Mar 14, 2026

👷 Deploy Preview for urunc processing.

Name Link
🔨 Latest commit 98db186
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/69b52f470c8412000889cb8b

@netlify
Copy link

netlify bot commented Mar 14, 2026

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 4934116
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/69b97e510b5d600008055277

@praffq-dev
Copy link
Contributor Author

I'm using MacOs, so not able to use the make commands, is there any way to run them on mac?

@IrvingMg
Copy link
Contributor

I'm using MacOs, so not able to use the make commands, is there any way to run them on mac?

On mac it is possible to use make, I think it should be included in the xcode-command-line-tools.

However, AFAIK a Linux environment is required, so the number of make targets that can run on macOS will likely be limited, make lint might be one of the few that works.

To set up a development environment on mac, I guess you might need a virtual machine running Linux. Maybe @cmainas knows if there are any limitations when running it in a VM, or if there is a better approach.

@praffq-dev praffq-dev force-pushed the fix/remove-unused-getInitPid branch from 98db186 to 7e3296d Compare March 15, 2026 05:29
@praffq-dev
Copy link
Contributor Author

Thanks for replying @IrvingMg

On mac it is possible to use make, I think it should be included in the xcode-command-line-tools.

feq ($(origin ARCH), undefined)
    UNAME_ARCH := $(shell uname -m)
    ifeq ($(UNAME_ARCH),x86_64)
        ARCH := amd64
    else ifeq ($(UNAME_ARCH),aarch64)
        ARCH := arm64
    else
        $(error Unsupported architecture: $(UNAME_ARCH))
    endif
endif

This part of code blocks running make file commands on macos

@cmainas
Copy link
Contributor

cmainas commented Mar 17, 2026

Thank you @praffq-dev for the removal of the dead code. The changes look good, just add yourself here https://github.com/urunc-dev/urunc/blob/main/.github/contributors.yaml and make sure to rebase over the main branch.

Thank you @praffq-dev for the review and the instructions about mac. Unfortunately, I have no experience with mac and no access to such OS. For a dev environment I would also recommend a Linux VM. There are multiple projects that offer quick and easy steps to create a small Linux VM in any OS. Also, there should be no implications with using nested virtualization.

However, in the case of linting and unit testing I think there will be no problem running them in non-Linux environments and especially mac. The linting takes place through a container, so if you are able to spawn any Linux container in mac, you should be able to execute this. Also, unit testing is based on Go which again I think will not have any issues.

It is clear though that the current format of the Makefile will not successfully detect the architecture and fail under mac. We could update the Makefile to not fail if it can not detect the architecture. After all, the architecture is necessary only for building which I doubt it will work well outside Linux due to the requirement of cgo. As a quick workaround, simply remove the line of Makefile you pasted and you can make lint and make unittest. Please keep in mind that by default, docker will be used for the go linting container.

   Remove the dead getInitPid function and its associated tests.

   Fixes: urunc-dev#466

Signed-off-by: praffq-dev <praffq.dev@gmail.com>
@praffq-dev praffq-dev force-pushed the fix/remove-unused-getInitPid branch from 7e3296d to b14daf2 Compare March 17, 2026 10:08
@praffq-dev
Copy link
Contributor Author

Thanks @cmainas for the explaination, I've made the required changes.

Will try out to run a VM and try to the run the lint and test commands

@cmainas
Copy link
Contributor

cmainas commented Mar 17, 2026

Hello @praffq-dev ,

the commit linter complains because it assumes your name as a spelling mistake. You can squash the commits or add the unknown words here: https://github.com/urunc-dev/urunc/blob/main/.github/linters/urunc-dict.txt

Thanks @cmainas for the explaination, I've made the required changes.

Will try out to run a VM and try to the run the lint and test commands

It is ok for a PR with dead code elimination, but in general please try to test locally your changes.

Signed-off-by: praffq-dev <praffq.dev@gmail.com>
@praffq-dev praffq-dev force-pushed the fix/remove-unused-getInitPid branch from b14daf2 to 4934116 Compare March 17, 2026 16:16
@praffq-dev
Copy link
Contributor Author

Thanks for reviewing, I updated the PR with the required changes

@urunc-bot urunc-bot bot changed the base branch from main to main-pr534 March 18, 2026 12:06
@cmainas cmainas merged commit dbdeddb into urunc-dev:main-pr534 Mar 18, 2026
50 of 52 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 18, 2026
   Remove the dead getInitPid function and its associated tests.

   Fixes: #466

PR: #534
Signed-off-by: praffq-dev <praffq.dev@gmail.com>
Reviewed-by: Irving Mondragón <mirvingr@gmail.com>
github-actions bot pushed a commit that referenced this pull request Mar 18, 2026
PR: #534
Signed-off-by: praffq-dev <praffq.dev@gmail.com>
Reviewed-by: Irving Mondragón <mirvingr@gmail.com>
urunc-bot bot pushed a commit that referenced this pull request Mar 18, 2026
   Remove the dead getInitPid function and its associated tests.

   Fixes: #466

PR: #534
Signed-off-by: praffq-dev <praffq.dev@gmail.com>
Reviewed-by: Irving Mondragón <mirvingr@gmail.com>
urunc-bot bot pushed a commit that referenced this pull request Mar 18, 2026
PR: #534
Signed-off-by: praffq-dev <praffq.dev@gmail.com>
Reviewed-by: Irving Mondragón <mirvingr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getInitPid returns (0, nil) instead of propagating errors

3 participants