Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch k9s source from GitHub to use openSUSE #294

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

mallardduck
Copy link
Member

Per title, this is 1/3 steps to address: #286

@mallardduck mallardduck requested a review from a team as a code owner November 18, 2024 17:54
@mallardduck
Copy link
Member Author

I've added @macedogm and @pjbgf as reviewers mainly as a sanity check for our team. I'm hoping one of you can verify that this will be a good method as far as security concerns.

package/Dockerfile Outdated Show resolved Hide resolved
hack/make/deps.mk Outdated Show resolved Hide resolved
mallardduck and others added 2 commits November 18, 2024 15:36
Co-authored-by: Paulo Gomes <[email protected]>
Co-authored-by: Paulo Gomes <[email protected]>
@mallardduck
Copy link
Member Author

Thank you very much @pjbgf! I've accepted both changes.

@mallardduck mallardduck requested a review from pjbgf November 18, 2024 20:37
package/Dockerfile Outdated Show resolved Hide resolved
package/Dockerfile Outdated Show resolved Hide resolved
package/Dockerfile Show resolved Hide resolved
Comment on lines 54 to 56
RUN zypper --non-interactive ar https://download.opensuse.org/repositories/devel:kubic/15.6/devel:kubic.repo \
&& zypper --non-interactive ar https://download.opensuse.org/repositories/devel:/kubic/openSUSE_Factory_ARM/ devel_kubic_arm \
&& zypper --non-interactive ar https://download.opensuse.org/repositories/devel:/kubic/openSUSE_Factory_zSystems/ devel_kubic_zed \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't do this. You are adding a repository for SLE/Leap 15.6 and Factory to the same image. This is going to cause so many subtle dependency issues, it'll bite you down the road. Also, you are adding unmaintained community repositories! Do you really want your image to be based on something that might just as well be broken?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcermak - I'm not very familiar with how SLE/Leap repos interact. Ultimately the goal was to fix CVEs and better at dog-fooding in one go. I wasn't able to find how to access these packages another way.

Ultimately it sounds like "official SLES" support for k9s (and with x64, arm64, maybe s390x) isn't something we provide? Since I agree this would be a big concern:

you are adding unmaintained community repositories!

Seems likely I'll close this PR since this is a major blocker for the concept. Which is rather unfortunate since compared to the upstream k9s this had far less CVEs when I scanned the image.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcermak - I'm not very familiar with how SLE/Leap repos interact. Ultimately the goal was to fix CVEs and better at dog-fooding in one go. I wasn't able to find how to access these packages another way.

Leap and SLES are essentially the same, so that's not a big problem. The bigger issue is throwing in repositories for Factory i.e. Tumbleweed. That's a completely different distribution at this point and mixing it with Leap or SLES will end badly.

Ultimately it sounds like "official SLES" support for k9s (and with x64, arm64, maybe s390x) isn't something we provide?

No, we don't.

Seems likely I'll close this PR since this is a major blocker for the concept. Which is rather unfortunate since compared to the upstream k9s this had far less CVEs when I scanned the image.

That would be unfortunate. I would suggest that you or someone else who you deem trustworthy takes over maintenance of k9s and then you can include it in such a container image.

package/Dockerfile Outdated Show resolved Hide resolved
Co-authored-by: Dan Čermák <[email protected]>
Comment on lines 68 to +70
RUN zypper --non-interactive refresh && \
zypper --installroot /chroot -n rm busybox-vi busybox-links && \
zypper --installroot /chroot -n in bash-completion jq vim curl && \
zypper --installroot /chroot clean -a && \
rm -rf /chroot/var/cache/zypp/* /chroot/var/log/zypp/* /chroot/etc/zypp/
zypper --installroot /chroot -n in bash-completion jq vim curl k9s
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand this part, why are you installing k9s into /chroot/ that you copied from the busybox image? What's the advantage of this added complexity, when in the end you copy everything into a scratch image anyway?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcermak The final image is largely a copy of the bci-busybox plus the zypper installed components (and other downloaded/built artefacts).

The copy into scratch avoids redundant layers if this were to be copied into another bci-busybox final image.

Given that bci-busybox does not include zypper, is there a better approach to be able to zipper in on it?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just install everything into the image based on bci-base and copy everything out of it into the scratch image. The intermediate step of running the zypper in in a chroot based on busybox is only asking for trouble, as your shell is now POSIX /bin/sh and not bash, which too many rpm scriptlets do not support.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcermak good point, this is actually a practice we observed in other teams using OBS/IBS. Issues with the rpm scriptlets would make the zypper operation fail or would it be a silent, resulting in potential unexpected behaviours executing the installed app?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failure could be either silent or you could end up with a broken package, it's impossible to tell in advance. You'd probably see a failure in the rpm installation log, but you'd have to inspect them manually.

@mallardduck mallardduck marked this pull request as draft November 22, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants