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

Improve UX around setting Proxy configurations in the spec #69

Merged
merged 13 commits into from
Oct 19, 2024

Conversation

maci3jka
Copy link
Contributor

@maci3jka maci3jka commented Oct 11, 2024

This PR introduces httpProxy, httpsProxy, noProxy parameters that adds support for proxy settings for contained in k8s. Provides functionality mentioned in k8s docs.
KU-1801

@maci3jka maci3jka force-pushed the KU-1801/containerd-poxy-settings branch from 28aa139 to a0b9e29 Compare October 11, 2024 15:33
@maci3jka maci3jka marked this pull request as ready for review October 12, 2024 14:05
@maci3jka maci3jka requested a review from a team as a code owner October 12, 2024 14:05
Copy link
Member

@berkayoz berkayoz left a comment

Choose a reason for hiding this comment

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

LGTM overall, I have one nit/question.

@bschimke95 Should we follow the k8s-operator approach of adding these variables to /etc/environment instead? If not we should make the variables reflect this is only for containerd.

bootstrap/api/v1beta2/ck8sconfig_types.go Show resolved Hide resolved
@maci3jka maci3jka force-pushed the KU-1801/containerd-poxy-settings branch from 214cc8f to a7db9a6 Compare October 16, 2024 17:37
@maci3jka maci3jka requested a review from berkayoz October 16, 2024 17:37
Copy link
Contributor

@eaudetcobello eaudetcobello left a comment

Choose a reason for hiding this comment

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

Looking good. Please apply my comments to the tests we added. We don't need to duplicate all the lines that are already tested by other tests, instead let's only check for the fields we know are relevant to containerd proxy configuration

pkg/cloudinit/controlplane_join_test.go Outdated Show resolved Hide resolved
pkg/cloudinit/controlplane_join_test.go Outdated Show resolved Hide resolved
Copy link
Member

@berkayoz berkayoz left a comment

Choose a reason for hiding this comment

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

Thank you, we're almost there some final comments

pkg/cloudinit/controlplane_init_test.go Show resolved Hide resolved
pkg/cloudinit/common.go Outdated Show resolved Hide resolved
@maci3jka maci3jka requested a review from berkayoz October 17, 2024 15:07
Copy link
Member

@berkayoz berkayoz left a comment

Choose a reason for hiding this comment

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

LGTM overall, one small nit before merging.

})
}

if len(files) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

I think this is unnecessary, zero value of a slice is nil already.
https://go.dev/tour/moretypes/12

Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 10 to 31



if [ -f ${HTTP_PROXY_FILE} ]; then
HTTP_PROXY=$(cat ${HTTP_PROXY_FILE})
echo "http_proxy=${HTTP_PROXY}" >> "${ENVIRONMENT_FILE}"
echo "HTTP_PROXY=${HTTP_PROXY}" >> "${ENVIRONMENT_FILE}"
fi


if [ -f ${HTTPS_PROXY_FILE} ]; then
HTTPS_PROXY=$(cat ${HTTPS_PROXY_FILE})
echo "https_proxy=${HTTPS_PROXY}" >> "${ENVIRONMENT_FILE}"
echo "HTTPS_PROXY=${HTTPS_PROXY}" >> "${ENVIRONMENT_FILE}"
fi


if [ -f ${NO_PROXY_FILE} ]; then
NO_PROXY=$(cat ${NO_PROXY_FILE})
echo "no_proxy=${NO_PROXY}" >> "${ENVIRONMENT_FILE}"
echo "NO_PROXY=${NO_PROXY}" >> "${ENVIRONMENT_FILE}"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make it so there are only 1 line between the if's? Same thing between lines 9 and 13.

@maci3jka maci3jka merged commit cefee4c into main Oct 19, 2024
7 of 8 checks passed
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.

4 participants