Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
47b8d809
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
47b8d809
编写于
12月 31, 2019
作者:
惊
惊奇脆片饼干
提交者:
Gitee
12月 31, 2019
浏览文件
操作
浏览文件
下载
差异文件
!5 adapt K8S
Merge pull request !5 from openeuler-basic/master
上级
28b3fd02
951d7f3b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
2 addition
and
72 deletion
+2
-72
src/services/cri/cri_helpers.cc
src/services/cri/cri_helpers.cc
+0
-4
src/services/cri/cri_helpers.h
src/services/cri/cri_helpers.h
+0
-1
src/services/cri/cri_sandbox.cc
src/services/cri/cri_sandbox.cc
+2
-67
未找到文件。
src/services/cri/cri_helpers.cc
浏览文件 @
47b8d809
...
...
@@ -705,8 +705,4 @@ out:
free_cri_checkpoint
(
criCheckpoint
);
}
std
::
string
DeterminePodIPBySandboxID
(
const
std
::
string
&
podSandboxID
)
{
return
""
;
}
}
// namespace CRIHelpers
src/services/cri/cri_helpers.h
浏览文件 @
47b8d809
...
...
@@ -110,7 +110,6 @@ std::string CreateCheckpoint(cri::PodSandboxCheckpoint &checkpoint, Errors &erro
void
GetCheckpoint
(
const
std
::
string
&
jsonCheckPoint
,
cri
::
PodSandboxCheckpoint
&
checkpoint
,
Errors
&
error
);
std
::
string
DeterminePodIPBySandboxID
(
const
std
::
string
&
podSandboxID
);
};
// namespace CRIHelpers
#endif
/* _CRI_HELPERS_H_ */
src/services/cri/cri_sandbox.cc
浏览文件 @
47b8d809
...
...
@@ -35,7 +35,6 @@
#include "container_custom_config.h"
#include "checkpoint_handler.h"
#include "cri_security_context.h"
#include "cxxutils.h"
runtime
::
v1alpha2
::
NamespaceMode
CRIRuntimeServiceImpl
::
SharesHostNetwork
(
container_inspect
*
inspect
)
{
...
...
@@ -967,72 +966,8 @@ void CRIRuntimeServiceImpl::SetSandboxStatusNetwork(container_inspect *inspect,
std
::
unique_ptr
<
runtime
::
v1alpha2
::
PodSandboxStatus
>
&
podStatus
,
Errors
&
error
)
{
if
(
podStatus
->
annotations_size
()
==
0
)
{
return
;
}
std
::
vector
<
std
::
string
>
ipInfo
;
std
::
string
IP
;
size_t
len
=
0
;
auto
networks
=
CRIHelpers
::
GetNetworkPlaneFromPodAnno
(
*
podStatus
->
mutable_annotations
(),
&
len
,
error
);
if
(
error
.
NotEmpty
())
{
ERROR
(
"Couldn't get network plane from pod annotations: %s"
,
error
.
GetCMessage
());
return
;
}
bool
isDefaultNetDisable
=
false
;
for
(
size_t
i
=
0
;
i
<
len
;
i
++
)
{
if
(
networks
[
i
]
->
name
==
nullptr
)
{
ERROR
(
"Invalid network config, do not have name"
);
error
.
SetError
(
"Invalid networks config"
);
goto
free_out
;
}
if
(
std
::
string
(
networks
[
i
]
->
name
)
==
Network
::
POD_DISABLE_DEFAULT_NET_ANNOTATION_KEY
)
{
isDefaultNetDisable
=
true
;
}
}
IP
=
CRIHelpers
::
DeterminePodIPBySandboxID
(
podSandboxID
);
if
(
IP
.
empty
()
&&
!
isDefaultNetDisable
)
{
if
(
len
>
SIZE_MAX
/
sizeof
(
cri_pod_network_element
*
)
-
1
)
{
ERROR
(
"Too many cri pod network elements!"
);
goto
free_out
;
}
size_t
new_size
=
(
len
+
1
)
*
sizeof
(
cri_pod_network_element
*
);
size_t
old_size
=
len
*
sizeof
(
cri_pod_network_element
*
);
cri_pod_network_element
**
new_networks
;
if
(
mem_realloc
((
void
**
)(
&
new_networks
),
new_size
,
(
void
*
)
networks
,
old_size
)
!=
0
)
{
ERROR
(
"Failed to realloc memory for append cri pod network element"
);
goto
free_out
;
}
networks
=
new_networks
;
cri_pod_network_element
*
new_element
=
(
cri_pod_network_element
*
)
util_common_calloc_s
(
sizeof
(
cri_pod_network_element
));
if
(
new_element
==
NULL
)
{
ERROR
(
"Out of memory"
);
goto
free_out
;
}
new_element
->
interface
=
util_strdup_s
(
Network
::
GetInterfaceName
().
c_str
());
networks
[
len
]
=
new_element
;
len
++
;
}
for
(
size_t
i
=
0
;
i
<
len
;
i
++
)
{
std
::
string
iterfaceName
{
networks
[
i
]
->
interface
!=
nullptr
?
networks
[
i
]
->
interface
:
""
};
std
::
string
interfaceIP
=
GetIP
(
podSandboxID
,
inspect
,
iterfaceName
,
error
);
if
(
error
.
NotEmpty
())
{
WARN
(
"get default ip failed: %s"
,
error
.
GetCMessage
());
error
.
Clear
();
}
ipInfo
.
push_back
(
iterfaceName
+
":"
+
interfaceIP
);
}
podStatus
->
mutable_network
()
->
set_ip
(
CXXUtils
::
StringsJoin
(
ipInfo
,
";"
));
free_out:
for
(
size_t
i
=
0
;
i
<
len
;
i
++
)
{
free_cri_pod_network_element
(
networks
[
i
]);
networks
[
i
]
=
nullptr
;
}
free
(
networks
);
std
::
string
interfaceIP
=
GetIP
(
podSandboxID
,
inspect
,
Network
::
DEFAULT_NETWORK_INTERFACE_NAME
,
error
);
podStatus
->
mutable_network
()
->
set_ip
(
interfaceIP
);
}
void
CRIRuntimeServiceImpl
::
PodSandboxStatusToGRPC
(
container_inspect
*
inspect
,
const
std
::
string
&
podSandboxID
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录