feat(edges): add support for canonical service labels #2804
feat(edges): add support for canonical service labels #2804istio-testing merged 7 commits intoistio:masterfrom
Conversation
729677d to
937f756
Compare
|
/test test_proxy |
bianpengyuan
left a comment
There was a problem hiding this comment.
Can we add the new field into integration test?
Sorry, missed the file. Should be there now. |
| FB_ASSIGN(source_canonical_revision, rev->value()); | ||
| } else { | ||
| instance[source_canonical_revision] = "latest"; | ||
| instance[source_canonical_revision] = ::Wasm::Common::kLatest.data(); |
There was a problem hiding this comment.
This is expecting a string. Can you just pass a string view to avoid the scan? The compiler should auto convert from string_view to string.
There was a problem hiding this comment.
extensions/stats/plugin.cc:84:45: error: no viable overloaded '='
instance[source_canonical_revision] = ::Wasm::Common::kLatest;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/basic_string.h:665:7: note: candidate function not viable: no known conversion from 'const absl::string_view' to 'const std::__cxx11::basic_string<char>' for 1st argument
operator=(const basic_string& __str)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/basic_string.h:704:7: note: candidate function not viable: no known conversion from 'const absl::string_view' to 'const char *' for 1st argument
operator=(const _CharT* __s)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/basic_string.h:715:7: note: candidate function not viable: no known conversion from 'const absl::string_view' to 'char' for 1st argument
operator=(_CharT __c)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/basic_string.h:732:7: note: candidate function not viable: no known conversion from 'const absl::string_view' to 'std::__cxx11::basic_string<char>' for 1st argument
operator=(basic_string&& __str)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/basic_string.h:795:7: note: candidate function not viable: no known conversion from 'const absl::string_view' to 'initializer_list<char>' for 1st argument
operator=(initializer_list<_CharT> __l)
There was a problem hiding this comment.
I'm beginning to have concerns about absl::string_view as it requires .data() calls when using with FlatBuffers (as far as I can tell).
From the docs:
Note that
string_view::data()may contain embedded nul
// characters, but the returned buffer may or may not be NUL-terminated;
// therefore, do not passdata()to a routine that expects a NUL-terminated
// string.
I think we should use char[] here.
There was a problem hiding this comment.
Not a big deal. It'll get much cleaner with C++17.
There was a problem hiding this comment.
sorry, what do you think we need here to get this in?
WorkloadInstancehas been updated to support the canonical service labels server-side.This PR updates the client definition and adds logic to populate that information. It will be used in Topology views related to canonical services.
As part of this PR, a few related consts are pulled out to a common location.