Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

app-admin/*-wrapper: Only set arguments that weren't set #426

Merged
merged 1 commit into from
Jun 17, 2020

Conversation

pothos
Copy link
Contributor

@pothos pothos commented Jun 16, 2020

When 788f328 introduced pulling from
docker by default, "--insecure-options=image" was added for all
docker registries. However, when the user also needs to set "http" as
in "--insecure-options=image,http" it will not be used because the
other argument is added as last disregarding the option was already
set by the user.
Check if the option was set by the user and only add it if it is not
provided. If the user forgets to add "image" then rkt will simply
fail and tell that this option is needed; thus no complex logic of
appending and detecting only "image" is needed. Do the same for the
"--trust-keys-from-https" option to be consistent in allowing to
overwrite it with "--trust-keys-from-https=false".

How to use/test

sudo KUBELET_IMAGE_TAG=v1.9.6_coreos.2 RKT_RUN_ARGS="--insecure-options=image,http" /usr/lib64/flatcar/kubelet-wrapper
+ exec /usr/bin/rkt run --insecure-options=image,http […]
sudo KUBELET_IMAGE_TAG=v1.9.6_coreos.2 ./kubelet-wrapper
+ exec /usr/bin/rkt run --insecure-options=image […]

Note: Pick for all channels

When 788f328 introduced pulling from
docker by default, "--insecure-options=image" was added for all
docker registries. However, when the user also needs to set "http" as
in "--insecure-options=image,http" it will not be used because the
other argument is added as last disregarding the option was already
set by the user.
Check if the option was set by the user and only add it if it is not
provided. If the user forgets to add "image" then rkt will simply
fail and tell that this option is needed; thus no complex logic of
appending and detecting only "image" is needed. Do the same for the
"--trust-keys-from-https" option to be consistent in allowing to
overwrite it with "--trust-keys-from-https=false".
@pothos pothos force-pushed the kai/fix-rkt-run-args branch from 24e775a to 2a38092 Compare June 17, 2020 11:35
Copy link
Contributor

@margamanterola margamanterola left a comment

Choose a reason for hiding this comment

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

LGTM

@pothos pothos merged commit 6e02a25 into flatcar-master Jun 17, 2020
@pothos pothos deleted the kai/fix-rkt-run-args branch June 17, 2020 12:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants