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
0082bd00
Commit
0082bd00
authored
Sep 22, 2017
by
Suraj Narwade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up unused functions in /pkg/controller/deployment/util
parent
9793bb30
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
67 deletions
+0
-67
deployment_util.go
pkg/controller/deployment/util/deployment_util.go
+0
-7
deployment_util_test.go
pkg/controller/deployment/util/deployment_util_test.go
+0
-60
No files found.
pkg/controller/deployment/util/deployment_util.go
View file @
0082bd00
...
@@ -548,13 +548,6 @@ func RsListFromClient(c extensionsv1beta1.ExtensionsV1beta1Interface) RsListFunc
...
@@ -548,13 +548,6 @@ func RsListFromClient(c extensionsv1beta1.ExtensionsV1beta1Interface) RsListFunc
}
}
}
}
// podListFromClient returns a podListFunc that wraps the given client.
func
podListFromClient
(
c
clientset
.
Interface
)
podListFunc
{
return
func
(
namespace
string
,
options
metav1
.
ListOptions
)
(
*
v1
.
PodList
,
error
)
{
return
c
.
Core
()
.
Pods
(
namespace
)
.
List
(
options
)
}
}
// TODO: switch this to full namespacers
// TODO: switch this to full namespacers
type
RsListFunc
func
(
string
,
metav1
.
ListOptions
)
([]
*
extensions
.
ReplicaSet
,
error
)
type
RsListFunc
func
(
string
,
metav1
.
ListOptions
)
([]
*
extensions
.
ReplicaSet
,
error
)
type
podListFunc
func
(
string
,
metav1
.
ListOptions
)
(
*
v1
.
PodList
,
error
)
type
podListFunc
func
(
string
,
metav1
.
ListOptions
)
(
*
v1
.
PodList
,
error
)
...
...
pkg/controller/deployment/util/deployment_util_test.go
View file @
0082bd00
...
@@ -85,64 +85,6 @@ func addUpdatePodsReactor(fakeClient *fake.Clientset) *fake.Clientset {
...
@@ -85,64 +85,6 @@ func addUpdatePodsReactor(fakeClient *fake.Clientset) *fake.Clientset {
return
fakeClient
return
fakeClient
}
}
func
newPod
(
now
time
.
Time
,
ready
bool
,
beforeSec
int
)
v1
.
Pod
{
conditionStatus
:=
v1
.
ConditionFalse
if
ready
{
conditionStatus
=
v1
.
ConditionTrue
}
return
v1
.
Pod
{
Status
:
v1
.
PodStatus
{
Conditions
:
[]
v1
.
PodCondition
{
{
Type
:
v1
.
PodReady
,
LastTransitionTime
:
metav1
.
NewTime
(
now
.
Add
(
-
1
*
time
.
Duration
(
beforeSec
)
*
time
.
Second
)),
Status
:
conditionStatus
,
},
},
},
}
}
func
newRSControllerRef
(
rs
*
extensions
.
ReplicaSet
)
*
metav1
.
OwnerReference
{
isController
:=
true
return
&
metav1
.
OwnerReference
{
APIVersion
:
"extensions/v1beta1"
,
Kind
:
"ReplicaSet"
,
Name
:
rs
.
GetName
(),
UID
:
rs
.
GetUID
(),
Controller
:
&
isController
,
}
}
// generatePodFromRS creates a pod, with the input ReplicaSet's selector and its template
func
generatePodFromRS
(
rs
extensions
.
ReplicaSet
)
v1
.
Pod
{
return
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Labels
:
rs
.
Labels
,
OwnerReferences
:
[]
metav1
.
OwnerReference
{
*
newRSControllerRef
(
&
rs
)},
},
Spec
:
rs
.
Spec
.
Template
.
Spec
,
}
}
func
generatePod
(
labels
map
[
string
]
string
,
image
string
)
v1
.
Pod
{
return
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Labels
:
labels
,
},
Spec
:
v1
.
PodSpec
{
Containers
:
[]
v1
.
Container
{
{
Name
:
image
,
Image
:
image
,
ImagePullPolicy
:
v1
.
PullAlways
,
TerminationMessagePath
:
v1
.
TerminationMessagePathDefault
,
},
},
},
}
}
func
generateRSWithLabel
(
labels
map
[
string
]
string
,
image
string
)
extensions
.
ReplicaSet
{
func
generateRSWithLabel
(
labels
map
[
string
]
string
,
image
string
)
extensions
.
ReplicaSet
{
return
extensions
.
ReplicaSet
{
return
extensions
.
ReplicaSet
{
ObjectMeta
:
metav1
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
...
@@ -822,8 +764,6 @@ func TestGetCondition(t *testing.T) {
...
@@ -822,8 +764,6 @@ func TestGetCondition(t *testing.T) {
status
extensions
.
DeploymentStatus
status
extensions
.
DeploymentStatus
condType
extensions
.
DeploymentConditionType
condType
extensions
.
DeploymentConditionType
condStatus
v1
.
ConditionStatus
condReason
string
expected
bool
expected
bool
}{
}{
...
...
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