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
d002cb1d
Commit
d002cb1d
authored
May 31, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix apiservers crashes
parent
7b4e2552
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
conversion.go
pkg/api/v1/conversion.go
+24
-4
No files found.
pkg/api/v1/conversion.go
View file @
d002cb1d
...
@@ -276,6 +276,12 @@ func Convert_v1_PodStatusResult_To_api_PodStatusResult(in *PodStatusResult, out
...
@@ -276,6 +276,12 @@ func Convert_v1_PodStatusResult_To_api_PodStatusResult(in *PodStatusResult, out
if
err
:=
json
.
Unmarshal
([]
byte
(
value
),
&
values
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
value
),
&
values
);
err
!=
nil
{
return
err
return
err
}
}
// Conversion from external to internal version exists more to
// satisfy the needs of the decoder than it does to be a general
// purpose tool. And Decode always creates an intermediate object
// to decode to. Thus the caller of UnsafeConvertToVersion is
// taking responsibility to ensure mutation of in is not exposed
// back to the caller.
in
.
Status
.
InitContainerStatuses
=
values
in
.
Status
.
InitContainerStatuses
=
values
}
}
...
@@ -327,6 +333,12 @@ func Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in *PodTemplateSpec, out
...
@@ -327,6 +333,12 @@ func Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in *PodTemplateSpec, out
if
err
:=
json
.
Unmarshal
([]
byte
(
value
),
&
values
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
value
),
&
values
);
err
!=
nil
{
return
err
return
err
}
}
// Conversion from external to internal version exists more to
// satisfy the needs of the decoder than it does to be a general
// purpose tool. And Decode always creates an intermediate object
// to decode to. Thus the caller of UnsafeConvertToVersion is
// taking responsibility to ensure mutation of in is not exposed
// back to the caller.
in
.
Spec
.
InitContainers
=
values
in
.
Spec
.
InitContainers
=
values
}
}
...
@@ -510,8 +522,6 @@ func Convert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, s conversion.Scope) error
...
@@ -510,8 +522,6 @@ func Convert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, s conversion.Scope) error
return
err
return
err
}
}
out
.
Annotations
[
PodInitContainersAnnotationKey
]
=
string
(
value
)
out
.
Annotations
[
PodInitContainersAnnotationKey
]
=
string
(
value
)
}
else
{
delete
(
out
.
Annotations
,
PodInitContainersAnnotationKey
)
}
}
if
len
(
out
.
Status
.
InitContainerStatuses
)
>
0
{
if
len
(
out
.
Status
.
InitContainerStatuses
)
>
0
{
value
,
err
:=
json
.
Marshal
(
out
.
Status
.
InitContainerStatuses
)
value
,
err
:=
json
.
Marshal
(
out
.
Status
.
InitContainerStatuses
)
...
@@ -519,8 +529,6 @@ func Convert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, s conversion.Scope) error
...
@@ -519,8 +529,6 @@ func Convert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, s conversion.Scope) error
return
err
return
err
}
}
out
.
Annotations
[
PodInitContainerStatusesAnnotationKey
]
=
string
(
value
)
out
.
Annotations
[
PodInitContainerStatusesAnnotationKey
]
=
string
(
value
)
}
else
{
delete
(
out
.
Annotations
,
PodInitContainerStatusesAnnotationKey
)
}
}
// We need to reset certain fields for mirror pods from pre-v1.1 kubelet
// We need to reset certain fields for mirror pods from pre-v1.1 kubelet
...
@@ -544,6 +552,12 @@ func Convert_v1_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) error
...
@@ -544,6 +552,12 @@ func Convert_v1_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) error
if
err
:=
json
.
Unmarshal
([]
byte
(
value
),
&
values
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
value
),
&
values
);
err
!=
nil
{
return
err
return
err
}
}
// Conversion from external to internal version exists more to
// satisfy the needs of the decoder than it does to be a general
// purpose tool. And Decode always creates an intermediate object
// to decode to. Thus the caller of UnsafeConvertToVersion is
// taking responsibility to ensure mutation of in is not exposed
// back to the caller.
in
.
Spec
.
InitContainers
=
values
in
.
Spec
.
InitContainers
=
values
}
}
if
value
,
ok
:=
in
.
Annotations
[
PodInitContainerStatusesAnnotationKey
];
ok
{
if
value
,
ok
:=
in
.
Annotations
[
PodInitContainerStatusesAnnotationKey
];
ok
{
...
@@ -551,6 +565,12 @@ func Convert_v1_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) error
...
@@ -551,6 +565,12 @@ func Convert_v1_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) error
if
err
:=
json
.
Unmarshal
([]
byte
(
value
),
&
values
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
value
),
&
values
);
err
!=
nil
{
return
err
return
err
}
}
// Conversion from external to internal version exists more to
// satisfy the needs of the decoder than it does to be a general
// purpose tool. And Decode always creates an intermediate object
// to decode to. Thus the caller of UnsafeConvertToVersion is
// taking responsibility to ensure mutation of in is not exposed
// back to the caller.
in
.
Status
.
InitContainerStatuses
=
values
in
.
Status
.
InitContainerStatuses
=
values
}
}
...
...
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