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

fix(kuma-cp) fix env #1171

Merged
merged 6 commits into from
Nov 23, 2020
Merged

fix(kuma-cp) fix env #1171

merged 6 commits into from
Nov 23, 2020

Conversation

lobkovilya
Copy link
Contributor

Signed-off-by: Ilya Lobkov ilya.lobkov@konghq.com

Summary

Fix env

Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
@lobkovilya lobkovilya requested a review from a team as a code owner November 18, 2020 15:32
Copy link
Contributor

@nickolaev nickolaev left a comment

Choose a reason for hiding this comment

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

Do we want to expand testing and ensure that loader_test.go has all the env variables checked?

@lobkovilya
Copy link
Contributor Author

Yes, I will expand testing

Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
}

Expect(testEnvs).To(Equal(configEnvs))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

That's amazing 👏

Please add a message like we have in generate tests

Expect(string(actualContents)).To(Equal(string(given.ExpectedContents)), "generated Go code is no longer in sync with the original template files. To re-generate it, run `make generate/kumactl/install/k8s/control-plane`")

Something like

%s config values are not overridden in the test. Add overrides for them with a value that is different than default.

if _, exist, _ := metadata.Annotations(pod.Annotations).GetEnabled(metadata.KumaVirtualProbesAnnotation); !exist {
annotations[metadata.KumaVirtualProbesAnnotation] = metadata.AnnotationEnabled
if err := virtualProbesEnabled(annotations, pod, i.cfg); err != nil {
return nil, err
Copy link
Contributor

Choose a reason for hiding this comment

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

please change the method names. I was confused why it's not returning bool and what is going on. It should be something like setVirtualProbesEnabledAnnotation, setVirtualProbesPortAnnotation

if enabled, exist, _ := metadata.Annotations(pod.Annotations).GetEnabled(metadata.KumaGatewayAnnotation); exist && enabled {
annotations[metadata.KumaVirtualProbesAnnotation] = metadata.AnnotationDisabled
if err := virtualProbesPort(annotations, pod, i.cfg); err != nil {
return nil, err
Copy link
Contributor

Choose a reason for hiding this comment

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

give more context to these errors

@@ -0,0 +1,187 @@
// Copyright (c) 2013 Kelsey Hightower
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this copy paste? Can you also paste the reference here (link to github)?

Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
@lobkovilya lobkovilya merged commit 3d02c39 into master Nov 23, 2020
@lobkovilya lobkovilya deleted the feat/virtual-probes-env branch November 23, 2020 10:03
mergify bot pushed a commit that referenced this pull request Nov 23, 2020
nickolaev pushed a commit that referenced this pull request Nov 23, 2020
(cherry picked from commit 3d02c39)

Co-authored-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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.

3 participants