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
e1586eac
Commit
e1586eac
authored
Feb 06, 2018
by
Mike Danese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
svcacct: default expiration of TokenRequest
* default expiration seconds to 1 hour
parent
d594a13d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
defaulting_test.go
pkg/api/testing/defaulting_test.go
+1
-0
defaults.go
pkg/apis/authentication/v1/defaults.go
+8
-0
zz_generated.defaults.go
pkg/apis/authentication/v1/zz_generated.defaults.go
+6
-0
No files found.
pkg/api/testing/defaulting_test.go
View file @
e1586eac
...
...
@@ -143,6 +143,7 @@ func TestDefaulting(t *testing.T) {
{
Group
:
"storage.k8s.io"
,
Version
:
"v1beta1"
,
Kind
:
"StorageClassList"
}
:
{},
{
Group
:
"storage.k8s.io"
,
Version
:
"v1"
,
Kind
:
"StorageClass"
}
:
{},
{
Group
:
"storage.k8s.io"
,
Version
:
"v1"
,
Kind
:
"StorageClassList"
}
:
{},
{
Group
:
"authentication.k8s.io"
,
Version
:
"v1"
,
Kind
:
"TokenRequest"
}
:
{},
}
f
:=
fuzz
.
New
()
.
NilChance
(
.5
)
.
NumElements
(
1
,
1
)
.
RandSource
(
rand
.
NewSource
(
1
))
...
...
pkg/apis/authentication/v1/defaults.go
View file @
e1586eac
...
...
@@ -17,9 +17,17 @@ limitations under the License.
package
v1
import
(
authenticationv1
"k8s.io/api/authentication/v1"
"k8s.io/apimachinery/pkg/runtime"
)
func
addDefaultingFuncs
(
scheme
*
runtime
.
Scheme
)
error
{
return
RegisterDefaults
(
scheme
)
}
func
SetDefaults_TokenRequestSpec
(
obj
*
authenticationv1
.
TokenRequestSpec
)
{
if
obj
.
ExpirationSeconds
==
nil
{
hour
:=
int64
(
60
*
60
)
obj
.
ExpirationSeconds
=
&
hour
}
}
pkg/apis/authentication/v1/zz_generated.defaults.go
View file @
e1586eac
...
...
@@ -21,6 +21,7 @@ limitations under the License.
package
v1
import
(
v1
"k8s.io/api/authentication/v1"
runtime
"k8s.io/apimachinery/pkg/runtime"
)
...
...
@@ -28,5 +29,10 @@ import (
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func
RegisterDefaults
(
scheme
*
runtime
.
Scheme
)
error
{
scheme
.
AddTypeDefaultingFunc
(
&
v1
.
TokenRequest
{},
func
(
obj
interface
{})
{
SetObjectDefaults_TokenRequest
(
obj
.
(
*
v1
.
TokenRequest
))
})
return
nil
}
func
SetObjectDefaults_TokenRequest
(
in
*
v1
.
TokenRequest
)
{
SetDefaults_TokenRequestSpec
(
&
in
.
Spec
)
}
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