Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Kstone
Commits
2dce0cff
Commit
2dce0cff
authored
3 years ago
by
engowzhou
Committed by
tangcong
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix: failed to add/remove member if affinity and toleration is nil
parent
0473ac34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/clusterprovider/providers/kstone/kstone.go
+8
-2
pkg/clusterprovider/providers/kstone/kstone.go
with
8 additions
and
2 deletions
+8
-2
pkg/clusterprovider/providers/kstone/kstone.go
+
8
-
2
View file @
2dce0cff
...
...
@@ -423,13 +423,19 @@ func (c *EtcdClusterKstone) generateEtcdSpec(cluster *kstonev1alpha2.EtcdCluster
spec
[
"repository"
]
=
cluster
.
Annotations
[
"repository"
]
}
affinity
:=
&
cluster
.
Spec
.
Affinity
// TODO: Use struct to replace
affinity
:=
make
(
map
[
string
]
interface
{})
affinityBytes
,
_
:=
json
.
Marshal
(
cluster
.
Spec
.
Affinity
)
_
=
json
.
Unmarshal
(
affinityBytes
,
&
affinity
)
if
affinity
!=
nil
{
spec
[
"template"
]
.
(
map
[
string
]
interface
{})[
"affinity"
]
=
affinity
}
if
cluster
.
Spec
.
Tolerations
!=
nil
&&
len
(
cluster
.
Spec
.
Tolerations
)
>
0
{
spec
[
"template"
]
.
(
map
[
string
]
interface
{})[
"tolerations"
]
=
cluster
.
Spec
.
Tolerations
tolerations
:=
make
([]
interface
{},
0
)
tolerationsBytes
,
_
:=
json
.
Marshal
(
cluster
.
Spec
.
Tolerations
)
_
=
json
.
Unmarshal
(
tolerationsBytes
,
&
tolerations
)
spec
[
"template"
]
.
(
map
[
string
]
interface
{})[
"tolerations"
]
=
tolerations
}
return
spec
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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