Skip to content

runtime: add static layer case to loader impl#7932

Merged
mattklein123 merged 5 commits intoenvoyproxy:masterfrom
asraa:unsupportedstatic
Aug 15, 2019
Merged

runtime: add static layer case to loader impl#7932
mattklein123 merged 5 commits intoenvoyproxy:masterfrom
asraa:unsupportedstatic

Conversation

@asraa
Copy link
Copy Markdown
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
Copy Markdown
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>

// 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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