Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
1dd3cb58
Commit
1dd3cb58
authored
Feb 29, 2016
by
Saad Ali
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22160 from liggitt/token-e2e
Remove short-circuit of token reference cleanup
parents
d1d03639
bd552c99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
tokens_controller.go
pkg/controller/serviceaccount/tokens_controller.go
+0
-5
tokens_controller_test.go
pkg/controller/serviceaccount/tokens_controller_test.go
+4
-2
No files found.
pkg/controller/serviceaccount/tokens_controller.go
View file @
1dd3cb58
...
...
@@ -415,11 +415,6 @@ func (e *TokensController) deleteSecret(secret *api.Secret) error {
// removeSecretReferenceIfNeeded updates the given ServiceAccount to remove a reference to the given secretName if needed.
// Returns whether an update was performed, and any error that occurred
func
(
e
*
TokensController
)
removeSecretReferenceIfNeeded
(
serviceAccount
*
api
.
ServiceAccount
,
secretName
string
)
error
{
// See if the account even referenced the secret
if
!
getSecretReferences
(
serviceAccount
)
.
Has
(
secretName
)
{
return
nil
}
// We don't want to update the cache's copy of the service account
// so remove the secret from a freshly retrieved copy of the service account
serviceAccounts
:=
e
.
client
.
Core
()
.
ServiceAccounts
(
serviceAccount
.
Namespace
)
...
...
pkg/controller/serviceaccount/tokens_controller_test.go
View file @
1dd3cb58
...
...
@@ -492,8 +492,10 @@ func TestTokenCreation(t *testing.T) {
"deleted secret with serviceaccount without reference"
:
{
ExistingServiceAccount
:
serviceAccount
(
emptySecretReferences
()),
DeletedSecret
:
serviceAccountTokenSecret
(),
ExpectedActions
:
[]
core
.
Action
{},
DeletedSecret
:
serviceAccountTokenSecret
(),
ExpectedActions
:
[]
core
.
Action
{
core
.
NewGetAction
(
"serviceaccounts"
,
api
.
NamespaceDefault
,
"default"
),
},
},
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment