Skip to content

feat(edges): add support for canonical service labels #2804

Merged
istio-testing merged 7 commits intoistio:masterfrom
douglas-reid:meshtelemetry-canonical-service
Apr 21, 2020
Merged

feat(edges): add support for canonical service labels #2804
istio-testing merged 7 commits intoistio:masterfrom
douglas-reid:meshtelemetry-canonical-service

Conversation

@douglas-reid
Copy link
Copy Markdown
Contributor

WorkloadInstance has 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.

@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Apr 15, 2020
@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Apr 15, 2020
@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-rebase Indicates a PR needs to be rebased before being merged labels Apr 15, 2020
@douglas-reid douglas-reid force-pushed the meshtelemetry-canonical-service branch from 729677d to 937f756 Compare April 20, 2020 22:12
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Apr 20, 2020
@douglas-reid douglas-reid marked this pull request as ready for review April 20, 2020 22:18
@douglas-reid douglas-reid requested review from a team April 20, 2020 22:18
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Apr 20, 2020
@douglas-reid
Copy link
Copy Markdown
Contributor Author

/test test_proxy

Copy link
Copy Markdown
Contributor

@bianpengyuan bianpengyuan left a comment

Choose a reason for hiding this comment

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

Can we add the new field into integration test?

Comment thread extensions/common/context.h Outdated
@istio-testing istio-testing added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 21, 2020
@douglas-reid
Copy link
Copy Markdown
Contributor Author

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();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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.

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)

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.

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 pass data() to a routine that expects a NUL-terminated
// string.

I think we should use char[] here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not a big deal. It'll get much cleaner with C++17.

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, what do you think we need here to get this in?

@istio-testing istio-testing merged commit 770f866 into istio:master Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants