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

runtime: add static layer case to loader impl #7932

Merged
merged 5 commits into from
Aug 15, 2019

Conversation

asraa
Copy link
Contributor

@asraa asraa commented Aug 15, 2019

When using a static layer, Envoy should catch the case instead of falling through to an unsupported layer specifier.

Risk Level: Low
Fixes Issues #7919
istio/istio#16083

Signed-off-by: Asra Ali asraa@google.com

Signed-off-by: Asra Ali <asraa@google.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks is it possible to have some test that covers this? You can use EXPECT_LOG_CONTAINS to test the presence/absence of the warning.

/wait

Signed-off-by: Asra Ali <asraa@google.com>
@@ -496,6 +497,11 @@ TEST_F(StaticLoaderImplTest, All) {
testNewOverrides(*loader_, store_);
}

// Validate that Static Layer does not log as unsupported.
TEST_F(StaticLoaderImplTest, NoUnsupportedStaticLog) {
EXPECT_LOG_NOT_CONTAINS("warning", "Skipping unsupported runtime layer", setup());
Copy link
Member

Choose a reason for hiding this comment

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

While you are in here can you add a test for the warning also? Thank you!

/wait

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, we actually shouldn't be able to get to this condition ever since there's a proto constraint that validates that we specify one of static/disk/admin/rtds. It'd run in to a proto validation error first. I suppose the warning would only come up if a new layered_runtime was added without support in LoaderImpl.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah if there is a constraint, just remove the warning instead and use NOT_REACHED

Copy link
Member

Choose a reason for hiding this comment

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

I don't think this test is useful anymore. Can you revert these changes? Thank you!

/wait

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that, should just be the NOT_REACHED case now (with proto validator).

Signed-off-by: Asra Ali <asraa@google.com>
Signed-off-by: Asra Ali <asraa@google.com>
Signed-off-by: Asra Ali <asraa@google.com>
Copy link
Member

@mattklein123 mattklein123 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!

@mattklein123 mattklein123 merged commit 4f0fc2d into envoyproxy:master Aug 15, 2019
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.

2 participants