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
2eab9cfb
Commit
2eab9cfb
authored
Jul 26, 2017
by
jianglingxia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replicaset fix typo
parent
744455c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
replica_set_utils.go
pkg/controller/replicaset/replica_set_utils.go
+6
-7
No files found.
pkg/controller/replicaset/replica_set_utils.go
View file @
2eab9cfb
...
...
@@ -126,7 +126,7 @@ func calculateStatus(rs *extensions.ReplicaSet, filteredPods []*v1.Pod, manageRe
return
newStatus
}
// NewReplicaSetCondition creates a new replica
set condition.
// NewReplicaSetCondition creates a new replicaset condition.
func
NewReplicaSetCondition
(
condType
extensions
.
ReplicaSetConditionType
,
status
v1
.
ConditionStatus
,
reason
,
msg
string
)
extensions
.
ReplicaSetCondition
{
return
extensions
.
ReplicaSetCondition
{
Type
:
condType
,
...
...
@@ -137,10 +137,9 @@ func NewReplicaSetCondition(condType extensions.ReplicaSetConditionType, status
}
}
// GetCondition returns a replica
set condition with the provided type if it exists.
// GetCondition returns a replicaset condition with the provided type if it exists.
func
GetCondition
(
status
extensions
.
ReplicaSetStatus
,
condType
extensions
.
ReplicaSetConditionType
)
*
extensions
.
ReplicaSetCondition
{
for
i
:=
range
status
.
Conditions
{
c
:=
status
.
Conditions
[
i
]
for
_
,
c
:=
range
status
.
Conditions
{
if
c
.
Type
==
condType
{
return
&
c
}
...
...
@@ -148,7 +147,7 @@ func GetCondition(status extensions.ReplicaSetStatus, condType extensions.Replic
return
nil
}
// SetCondition adds/replaces the given condition in the replica
set status. If the condition that we
// SetCondition adds/replaces the given condition in the replicaset status. If the condition that we
// are about to add already exists and has the same status and reason then we are not going to update.
func
SetCondition
(
status
*
extensions
.
ReplicaSetStatus
,
condition
extensions
.
ReplicaSetCondition
)
{
currentCond
:=
GetCondition
(
*
status
,
condition
.
Type
)
...
...
@@ -159,12 +158,12 @@ func SetCondition(status *extensions.ReplicaSetStatus, condition extensions.Repl
status
.
Conditions
=
append
(
newConditions
,
condition
)
}
// RemoveCondition removes the condition with the provided type from the replica
set status.
// RemoveCondition removes the condition with the provided type from the replicaset status.
func
RemoveCondition
(
status
*
extensions
.
ReplicaSetStatus
,
condType
extensions
.
ReplicaSetConditionType
)
{
status
.
Conditions
=
filterOutCondition
(
status
.
Conditions
,
condType
)
}
// filterOutCondition returns a new slice of replica
set conditions without conditions with the provided type.
// filterOutCondition returns a new slice of replicaset conditions without conditions with the provided type.
func
filterOutCondition
(
conditions
[]
extensions
.
ReplicaSetCondition
,
condType
extensions
.
ReplicaSetConditionType
)
[]
extensions
.
ReplicaSetCondition
{
var
newConditions
[]
extensions
.
ReplicaSetCondition
for
_
,
c
:=
range
conditions
{
...
...
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