Print cluster info by setting a flag in backplane config file.#578
Conversation
|
/label tide/merge-method-squash |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #578 +/- ##
==========================================
+ Coverage 45.92% 46.27% +0.35%
==========================================
Files 85 85
Lines 6319 6323 +4
==========================================
+ Hits 2902 2926 +24
+ Misses 3057 3033 -24
- Partials 360 364 +4
🚀 New features to boost your workflow:
|
b962cac to
7f93d99
Compare
eb33e47 to
1edba58
Compare
4b18ba4 to
22ac952
Compare
| globalOpts.Manager = false | ||
| globalOpts.Service = false | ||
| }) | ||
| It("should print a message if DisplayClusterInfo is not set to true", func() { |
There was a problem hiding this comment.
maybe we can change the testing to positive test as well? so it would be should print when is set to true
There was a problem hiding this comment.
Sorry, I am not getting what needs to be changed
It("should print a message if DisplayClusterInfo is set to true", func() {
or the test needs to be changed so it tests when
testData := config.BackplaneConfiguration{ URL: backplaneAPIURI, ProxyURL: new(string), DisplayClusterInfo: true, }
7b3d07b to
7ee3252
Compare
7ae78df to
33e1db4
Compare
|
/retest |
3d85af5 to
dc660e5
Compare
dc660e5 to
28fd387
Compare
| mockClientUtil.EXPECT().MakeRawBackplaneAPIClientWithAccessToken(backplaneAPIURI, testToken).Return(mockClient, nil) | ||
| mockClient.EXPECT().LoginCluster(gomock.Any(), gomock.Eq(trueClusterID)).Return(fakeResp, nil) | ||
|
|
||
| // Redirect standard output and log output to a buffer |
There was a problem hiding this comment.
I think we may not need to check the stdout or stderr here.
I cannot see much value of checking this in a negative test.
There was a problem hiding this comment.
while looking into I've thought about diff scenario when PrintClusterInfo(clusterID) returns an error
28fd387 to
6d8070a
Compare
| JiraConfigForAccessRequests AccessRequestsJiraConfiguration `json:"jira-config-for-access-requests"` | ||
| VPNCheckEndpoint string `json:"vpn-check-endpoint"` | ||
| ProxyCheckEndpoint string `json:"proxy-check-endpoint"` | ||
| DisplayClusterInfo bool `json:"display-cluster-info"` |
There was a problem hiding this comment.
As all the setting flags in the backplane configuration are currently defined as string values, but DisplayClusterInfo is defined as a bool, it would be better to emphasize that end-user should use the boolean value true instead of the string "true" in the README.md.
P.S While this might not be necessary, if you'd like to go a step further, you could implement a small utility function to handle both boolean and string values for display-cluster-info, basically, if the value is mistakenly set as a string ("true" or "false"), it is converted and interpreted as a boolean.
bce6186 to
26da6a3
Compare
26da6a3 to
83e6d65
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bmeng, diakovnec The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@diakovnec: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What type of PR is this?
This is an addition to #561
This PR adds an ability to add a flag in the backplane config and the cluster info will be printed automatically every time without a need to set
--cluster-intoeach timeExample
{ "proxy-url": ["http://squid.corp.redhat.com:3128/","http://proxy2.squi-001.prod.rdu2.dc.redhat.com:3128/"], "display-cluster-info": true }Which Jira/Github issue(s) does this PR fix?
Resolves #