Repository: kubernetes/dashboard
Pull request #5189 (2020-05-27 09:19:47)

Bump d3 from 5.15.0 to 5.16.0
Bumps [d3](https://github.com/d3/d3) from 5.15.0 to 5.16.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/d3/d3/releases">d3's releases</a>.</em></p>
<blockquote>
<h2>v5.16.0</h2>
<ul>
<li>Add <a href="https://github.com/d3/d3-geo/blob/master/README.md#projection_reflectX"><em>projection</em>.reflectX</a>.</li>
<li>Add <a href="https://github.com/d3/d3-geo/blob/master/README.md#projection_reflectY"><em>projection</em>.reflectY</a>.</li>
<li>Fix achromatic hexadecimal colors.</li>
</ul>
<h2>v5.15.1</h2>
<ul>
<li>Fix sign of near-zero negative values when using the <code>+</code> sign directive.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/d3/d3/commit/7244e45e68af39c519f76667a03039d5b24dd453"><code>7244e45</code></a> 5.16.0</li>
<li><a href="https://github.com/d3/d3/commit/6be4eaf7dc8bdd9befcdde6c4745594ae79dcb99"><code>6be4eaf</code></a> Update dependencies.</li>
<li><a href="https://github.com/d3/d3/commit/705b98cf4804b50a1540881f286124da5407dfd4"><code>705b98c</code></a> 5.15.1</li>
<li><a href="https://github.com/d3/d3/commit/0021f99ea1f369c4f5024e5e26c916e7e0a75a08"><code>0021f99</code></a> Update d3-format.</li>
<li><a href="https://github.com/d3/d3/commit/3c0359ab75a5464fc1d5aac5a1a33ceb006345e2"><code>3c0359a</code></a> Update README.md</li>
<li><a href="https://github.com/d3/d3/commit/1a8655bdf0a90bae43c9b6946d9da2a1a4ef80d0"><code>1a8655b</code></a> Update README.md</li>
<li>See full diff in <a href="https://github.com/d3/d3/compare/v5.15.0...v5.16.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=d3&package-manager=npm_and_yarn&previous-version=5.15.0&new-version=5.16.0)](https://dependabot.com/compatibility-score/?dependency-name=d3&package-manager=npm_and_yarn&previous-version=5.15.0&new-version=5.16.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

k8s-ci-robot: Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: **Please follow instructions at <https://git.k8s.io/community/CLA.md#the-contributor-license-agreement> to sign the CLA.**

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify.  Thanks.

---

- If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address.  Check your existing CLA data and verify that your [email is set on your git commits](https://help.github.com/articles/setting-your-email-in-git/).
- If you signed the CLA as a corporation, please sign in with your organization's credentials at <https://identity.linuxfoundation.org/projects/cncf> to be authorized.
- If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: <https://support.linuxfoundation.org/>
- Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: login-issues@jira.linuxfoundation.org

<!-- need_sender_cla -->

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
	
k8s-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes/dashboard/pull/5189#" title="Author self-approved">dependabot-preview[bot]</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **maciaszczykm**
You can assign the PR to them by writing `/assign @maciaszczykm` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes%2Fdashboard).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/kubernetes/dashboard/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["maciaszczykm"]} -->
codecov[bot]: # [Codecov](https://codecov.io/gh/kubernetes/dashboard/pull/5189?src=pr&el=h1) Report
> Merging [#5189](https://codecov.io/gh/kubernetes/dashboard/pull/5189?src=pr&el=desc) into [master](https://codecov.io/gh/kubernetes/dashboard/commit/36bddd50f05366d63f682507ce492f84bbc8b88d&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/kubernetes/dashboard/pull/5189/graphs/tree.svg?width=650&height=150&src=pr&token=Wj7jysJ9A5)](https://codecov.io/gh/kubernetes/dashboard/pull/5189?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master    #5189   +/-   ##
=======================================
  Coverage   45.47%   45.47%           
=======================================
  Files         214      214           
  Lines       10094    10094           
  Branches      107      107           
=======================================
  Hits         4590     4590           
  Misses       5238     5238           
  Partials      266      266           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/kubernetes/dashboard/pull/5189?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/kubernetes/dashboard/pull/5189?src=pr&el=footer). Last update [c66240a...65bf14c](https://codecov.io/gh/kubernetes/dashboard/pull/5189?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/package-lock.json b/package-lock.json
index b97ee1c8c..ebfda7073 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8384,9 +8384,9 @@
       }
     },
     "d3": {
-      "version": "5.15.0",
-      "resolved": "https://registry.npmjs.org/d3/-/d3-5.15.0.tgz",
-      "integrity": "sha512-C+E80SL2nLLtmykZ6klwYj5rPqB5nlfN5LdWEAVdWPppqTD8taoJi2PxLZjPeYT8FFRR2yucXq+kBlOnnvZeLg==",
+      "version": "5.16.0",
+      "resolved": "https://registry.npmjs.org/d3/-/d3-5.16.0.tgz",
+      "integrity": "sha512-4PL5hHaHwX4m7Zr1UapXW23apo6pexCgdetdJ5kTmADpG/7T9Gkxw0M0tf/pjoB63ezCCm0u5UaFYy2aMt0Mcw==",
       "requires": {
         "d3-array": "1",
         "d3-axis": "1",
@@ -8558,9 +8558,9 @@
       "integrity": "sha512-TWks25e7t8/cqctxCmxpUuzZN11QxIA7YrMbram94zMQ0PXjE4LVIMe/f6a4+xxL8HQ3OsAFULOINQi1pE62Aw=="
     },
     "d3-geo": {
-      "version": "1.12.0",
-      "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.0.tgz",
-      "integrity": "sha512-NalZVW+6/SpbKcnl+BCO67m8gX+nGeJdo6oGL9H6BRUGUL1e+AtPcP4vE4TwCQ/gl8y5KE7QvBzrLn+HsKIl+w==",
+      "version": "1.12.1",
+      "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz",
+      "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==",
       "requires": {
         "d3-array": "1"
       },
diff --git a/package.json b/package.json
index 915ad37c2..5b642ec0c 100644
--- a/package.json
+++ b/package.json
@@ -119,7 +119,7 @@
     "ansi-to-html": "0.6.14",
     "c3": "0.7.15",
     "core-js": "3.6.4",
-    "d3": "5.15.0",
+    "d3": "5.16.0",
     "file-saver": "2.0.2",
     "highlight.js": "10.0.3",
     "js-yaml": "3.13.1",
diff --git a/src/app/backend/client/api/common.go b/src/app/backend/client/api/common.go
index 83e72cebd..cb34a7dfa 100644
--- a/src/app/backend/client/api/common.go
+++ b/src/app/backend/client/api/common.go
@@ -16,19 +16,23 @@ package api
 
 import (
 	"crypto/rand"
+	"fmt"
+	"strings"
 
 	v1 "k8s.io/api/authorization/v1"
 )
 
 // ToSelfSubjectAccessReview creates kubernetes API object based on provided data.
-func ToSelfSubjectAccessReview(namespace, name, resource, verb string) *v1.SelfSubjectAccessReview {
+func ToSelfSubjectAccessReview(namespace, name, resourceKind, verb string) *v1.SelfSubjectAccessReview {
 	return &v1.SelfSubjectAccessReview{
 		Spec: v1.SelfSubjectAccessReviewSpec{
 			ResourceAttributes: &v1.ResourceAttributes{
 				Namespace: namespace,
 				Name:      name,
-				Resource:  resource,
-				Verb:      verb,
+				// Resource kind name must be in a plural lower-case format,
+				Resource: fmt.Sprintf("%ss", strings.ToLower(resourceKind)),
+				// Let's enforce the same lower-case format for verbs
+				Verb: strings.ToLower(verb),
 			},
 		},
 	}


Test patch:
diff --git a/src/app/backend/client/api/common_test.go b/src/app/backend/client/api/common_test.go
index e3c653de5..2cb7f5724 100644
--- a/src/app/backend/client/api/common_test.go
+++ b/src/app/backend/client/api/common_test.go
@@ -18,8 +18,9 @@ import (
 	"reflect"
 	"testing"
 
-	"github.com/kubernetes/dashboard/src/app/backend/client/api"
 	v1 "k8s.io/api/authorization/v1"
+
+	"github.com/kubernetes/dashboard/src/app/backend/client/api"
 )
 
 func TestToSelfSubjectAccessReview(t *testing.T) {
@@ -32,8 +33,8 @@ func TestToSelfSubjectAccessReview(t *testing.T) {
 			ResourceAttributes: &v1.ResourceAttributes{
 				Namespace: ns,
 				Name:      name,
-				Resource:  resourceName,
-				Verb:      verb,
+				Resource:  "deployments",
+				Verb:      "get",
 			},
 		},
 	}