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
6b8f2382
Unverified
Commit
6b8f2382
authored
Oct 11, 2018
by
Davanum Srinivas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test to ensure backward compatability for timestamps
Change-Id: I63650c77e3d0ece06eb29efa5b8898b77db677fb
parent
65da81f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
serialization_test.go
pkg/api/testing/serialization_test.go
+23
-0
No files found.
pkg/api/testing/serialization_test.go
View file @
6b8f2382
...
...
@@ -244,6 +244,29 @@ func TestEncodePtr(t *testing.T) {
}
}
func
TestDecodeTimeStampWithoutQuotes
(
t
*
testing
.
T
)
{
testYAML
:=
[]
byte
(
`
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: 2018-08-30T14:10:58Z
name: test
spec:
containers: null
status: {}`
)
if
obj
,
err
:=
runtime
.
Decode
(
testapi
.
Default
.
Codec
(),
testYAML
);
err
!=
nil
{
t
.
Fatalf
(
"unable to decode yaml: %v"
,
err
)
}
else
{
if
obj2
,
ok
:=
obj
.
(
*
api
.
Pod
);
!
ok
{
t
.
Fatalf
(
"Got wrong type"
)
}
else
{
if
obj2
.
ObjectMeta
.
CreationTimestamp
.
UnixNano
()
!=
parseTimeOrDie
(
"2018-08-30T14:10:58Z"
)
.
UnixNano
()
{
t
.
Fatalf
(
"Time stamps do not match"
)
}
}
}
}
// TestBadJSONRejection establishes that a JSON object without a kind or with
// an unknown kind will not be decoded without error.
func
TestBadJSONRejection
(
t
*
testing
.
T
)
{
...
...
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