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
0deb4ef3
Commit
0deb4ef3
authored
Jun 28, 2017
by
Irfan Ur Rehman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Federation] Make arguments to scheduling type adapter methods generic
parent
4103f40f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
38 deletions
+42
-38
deployment.go
federation/pkg/federatedtypes/deployment.go
+8
-7
replicaset.go
federation/pkg/federatedtypes/replicaset.go
+8
-7
scheduling.go
federation/pkg/federatedtypes/scheduling.go
+19
-18
controller.go
federation/pkg/federation-controller/sync/controller.go
+6
-5
controller_test.go
federation/pkg/federation-controller/sync/controller_test.go
+1
-1
No files found.
federation/pkg/federatedtypes/deployment.go
View file @
0deb4ef3
...
@@ -47,15 +47,16 @@ type DeploymentAdapter struct {
...
@@ -47,15 +47,16 @@ type DeploymentAdapter struct {
func
NewDeploymentAdapter
(
client
federationclientset
.
Interface
,
config
*
restclient
.
Config
)
FederatedTypeAdapter
{
func
NewDeploymentAdapter
(
client
federationclientset
.
Interface
,
config
*
restclient
.
Config
)
FederatedTypeAdapter
{
schedulingAdapter
:=
schedulingAdapter
{
schedulingAdapter
:=
schedulingAdapter
{
preferencesAnnotationName
:
FedDeploymentPreferencesAnnotation
,
preferencesAnnotationName
:
FedDeploymentPreferencesAnnotation
,
updateStatusFunc
:
func
(
obj
pkgruntime
.
Object
,
status
SchedulingStatus
)
error
{
updateStatusFunc
:
func
(
obj
pkgruntime
.
Object
,
status
interface
{}
)
error
{
deployment
:=
obj
.
(
*
extensionsv1
.
Deployment
)
deployment
:=
obj
.
(
*
extensionsv1
.
Deployment
)
if
status
.
Replicas
!=
deployment
.
Status
.
Replicas
||
status
.
UpdatedReplicas
!=
deployment
.
Status
.
UpdatedReplicas
||
typedStatus
:=
status
.
(
ReplicaSchedulingStatus
)
status
.
ReadyReplicas
!=
deployment
.
Status
.
ReadyReplicas
||
status
.
AvailableReplicas
!=
deployment
.
Status
.
AvailableReplicas
{
if
typedStatus
.
Replicas
!=
deployment
.
Status
.
Replicas
||
typedStatus
.
UpdatedReplicas
!=
deployment
.
Status
.
UpdatedReplicas
||
typedStatus
.
ReadyReplicas
!=
deployment
.
Status
.
ReadyReplicas
||
typedStatus
.
AvailableReplicas
!=
deployment
.
Status
.
AvailableReplicas
{
deployment
.
Status
=
extensionsv1
.
DeploymentStatus
{
deployment
.
Status
=
extensionsv1
.
DeploymentStatus
{
Replicas
:
s
tatus
.
Replicas
,
Replicas
:
typedS
tatus
.
Replicas
,
UpdatedReplicas
:
s
tatus
.
UpdatedReplicas
,
UpdatedReplicas
:
typedS
tatus
.
UpdatedReplicas
,
ReadyReplicas
:
s
tatus
.
ReadyReplicas
,
ReadyReplicas
:
typedS
tatus
.
ReadyReplicas
,
AvailableReplicas
:
s
tatus
.
AvailableReplicas
,
AvailableReplicas
:
typedS
tatus
.
AvailableReplicas
,
}
}
_
,
err
:=
client
.
Extensions
()
.
Deployments
(
deployment
.
Namespace
)
.
UpdateStatus
(
deployment
)
_
,
err
:=
client
.
Extensions
()
.
Deployments
(
deployment
.
Namespace
)
.
UpdateStatus
(
deployment
)
return
err
return
err
...
...
federation/pkg/federatedtypes/replicaset.go
View file @
0deb4ef3
...
@@ -47,15 +47,16 @@ type ReplicaSetAdapter struct {
...
@@ -47,15 +47,16 @@ type ReplicaSetAdapter struct {
func
NewReplicaSetAdapter
(
client
federationclientset
.
Interface
,
config
*
restclient
.
Config
)
FederatedTypeAdapter
{
func
NewReplicaSetAdapter
(
client
federationclientset
.
Interface
,
config
*
restclient
.
Config
)
FederatedTypeAdapter
{
schedulingAdapter
:=
schedulingAdapter
{
schedulingAdapter
:=
schedulingAdapter
{
preferencesAnnotationName
:
FedReplicaSetPreferencesAnnotation
,
preferencesAnnotationName
:
FedReplicaSetPreferencesAnnotation
,
updateStatusFunc
:
func
(
obj
pkgruntime
.
Object
,
status
SchedulingStatus
)
error
{
updateStatusFunc
:
func
(
obj
pkgruntime
.
Object
,
status
interface
{}
)
error
{
rs
:=
obj
.
(
*
extensionsv1
.
ReplicaSet
)
rs
:=
obj
.
(
*
extensionsv1
.
ReplicaSet
)
if
status
.
Replicas
!=
rs
.
Status
.
Replicas
||
status
.
FullyLabeledReplicas
!=
rs
.
Status
.
FullyLabeledReplicas
||
typedStatus
:=
status
.
(
ReplicaSchedulingStatus
)
status
.
ReadyReplicas
!=
rs
.
Status
.
ReadyReplicas
||
status
.
AvailableReplicas
!=
rs
.
Status
.
AvailableReplicas
{
if
typedStatus
.
Replicas
!=
rs
.
Status
.
Replicas
||
typedStatus
.
FullyLabeledReplicas
!=
rs
.
Status
.
FullyLabeledReplicas
||
typedStatus
.
ReadyReplicas
!=
rs
.
Status
.
ReadyReplicas
||
typedStatus
.
AvailableReplicas
!=
rs
.
Status
.
AvailableReplicas
{
rs
.
Status
=
extensionsv1
.
ReplicaSetStatus
{
rs
.
Status
=
extensionsv1
.
ReplicaSetStatus
{
Replicas
:
s
tatus
.
Replicas
,
Replicas
:
typedS
tatus
.
Replicas
,
FullyLabeledReplicas
:
s
tatus
.
Replicas
,
FullyLabeledReplicas
:
typedS
tatus
.
Replicas
,
ReadyReplicas
:
s
tatus
.
ReadyReplicas
,
ReadyReplicas
:
typedS
tatus
.
ReadyReplicas
,
AvailableReplicas
:
s
tatus
.
AvailableReplicas
,
AvailableReplicas
:
typedS
tatus
.
AvailableReplicas
,
}
}
_
,
err
:=
client
.
Extensions
()
.
ReplicaSets
(
rs
.
Namespace
)
.
UpdateStatus
(
rs
)
_
,
err
:=
client
.
Extensions
()
.
ReplicaSets
(
rs
.
Namespace
)
.
UpdateStatus
(
rs
)
return
err
return
err
...
...
federation/pkg/federatedtypes/scheduling.go
View file @
0deb4ef3
...
@@ -37,9 +37,9 @@ import (
...
@@ -37,9 +37,9 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
)
)
//
SchedulingStatus contains the status of the objects that are being
//
ReplicaSchedulingStatus contains the status of the replica type objects (rs or deployment)
// scheduled into joined clusters.
//
that are being
scheduled into joined clusters.
type
SchedulingStatus
struct
{
type
Replica
SchedulingStatus
struct
{
Replicas
int32
Replicas
int32
UpdatedReplicas
int32
UpdatedReplicas
int32
FullyLabeledReplicas
int32
FullyLabeledReplicas
int32
...
@@ -47,19 +47,19 @@ type SchedulingStatus struct {
...
@@ -47,19 +47,19 @@ type SchedulingStatus struct {
AvailableReplicas
int32
AvailableReplicas
int32
}
}
//
SchedulingInfo wraps the information that a SchedulingAdapter needs
//
ReplicaSchedulingInfo wraps the information that a replica type (rs or deployment)
// to update objects per a schedule.
//
SchedulingAdapter needs
to update objects per a schedule.
type
SchedulingInfo
struct
{
type
Replica
SchedulingInfo
struct
{
Schedule
map
[
string
]
int64
Schedule
map
[
string
]
int64
Status
SchedulingStatus
Status
Replica
SchedulingStatus
}
}
// SchedulingAdapter defines operations for interacting with a
// SchedulingAdapter defines operations for interacting with a
// federated type that requires more complex synchronization logic.
// federated type that requires more complex synchronization logic.
type
SchedulingAdapter
interface
{
type
SchedulingAdapter
interface
{
GetSchedule
(
obj
pkgruntime
.
Object
,
key
string
,
clusters
[]
*
federationapi
.
Cluster
,
informer
fedutil
.
FederatedInformer
)
(
*
SchedulingInfo
,
error
)
GetSchedule
(
obj
pkgruntime
.
Object
,
key
string
,
clusters
[]
*
federationapi
.
Cluster
,
informer
fedutil
.
FederatedInformer
)
(
interface
{}
,
error
)
ScheduleObject
(
cluster
*
federationapi
.
Cluster
,
clusterObj
pkgruntime
.
Object
,
federationObjCopy
pkgruntime
.
Object
,
schedulingInfo
*
SchedulingInfo
)
(
pkgruntime
.
Object
,
bool
,
error
)
ScheduleObject
(
cluster
*
federationapi
.
Cluster
,
clusterObj
pkgruntime
.
Object
,
federationObjCopy
pkgruntime
.
Object
,
schedulingInfo
interface
{}
)
(
pkgruntime
.
Object
,
bool
,
error
)
UpdateFederatedStatus
(
obj
pkgruntime
.
Object
,
status
SchedulingStatus
)
error
UpdateFederatedStatus
(
obj
pkgruntime
.
Object
,
status
interface
{}
)
error
// EquivalentIgnoringSchedule returns whether obj1 and obj2 are
// EquivalentIgnoringSchedule returns whether obj1 and obj2 are
// equivalent ignoring differences due to scheduling.
// equivalent ignoring differences due to scheduling.
...
@@ -70,14 +70,14 @@ type SchedulingAdapter interface {
...
@@ -70,14 +70,14 @@ type SchedulingAdapter interface {
// workload scheduling.
// workload scheduling.
type
schedulingAdapter
struct
{
type
schedulingAdapter
struct
{
preferencesAnnotationName
string
preferencesAnnotationName
string
updateStatusFunc
func
(
pkgruntime
.
Object
,
SchedulingStatus
)
error
updateStatusFunc
func
(
pkgruntime
.
Object
,
interface
{}
)
error
}
}
func
(
a
*
schedulingAdapter
)
IsSchedulingAdapter
()
bool
{
func
(
a
*
schedulingAdapter
)
IsSchedulingAdapter
()
bool
{
return
true
return
true
}
}
func
(
a
*
schedulingAdapter
)
GetSchedule
(
obj
pkgruntime
.
Object
,
key
string
,
clusters
[]
*
federationapi
.
Cluster
,
informer
fedutil
.
FederatedInformer
)
(
*
SchedulingInfo
,
error
)
{
func
(
a
*
schedulingAdapter
)
GetSchedule
(
obj
pkgruntime
.
Object
,
key
string
,
clusters
[]
*
federationapi
.
Cluster
,
informer
fedutil
.
FederatedInformer
)
(
interface
{}
,
error
)
{
var
clusterNames
[]
string
var
clusterNames
[]
string
for
_
,
cluster
:=
range
clusters
{
for
_
,
cluster
:=
range
clusters
{
clusterNames
=
append
(
clusterNames
,
cluster
.
Name
)
clusterNames
=
append
(
clusterNames
,
cluster
.
Name
)
...
@@ -122,14 +122,15 @@ func (a *schedulingAdapter) GetSchedule(obj pkgruntime.Object, key string, clust
...
@@ -122,14 +122,15 @@ func (a *schedulingAdapter) GetSchedule(obj pkgruntime.Object, key string, clust
plnr
:=
planner
.
NewPlanner
(
fedPref
)
plnr
:=
planner
.
NewPlanner
(
fedPref
)
return
&
SchedulingInfo
{
return
&
Replica
SchedulingInfo
{
Schedule
:
schedule
(
plnr
,
obj
,
key
,
clusterNames
,
currentReplicasPerCluster
,
estimatedCapacity
),
Schedule
:
schedule
(
plnr
,
obj
,
key
,
clusterNames
,
currentReplicasPerCluster
,
estimatedCapacity
),
Status
:
SchedulingStatus
{},
Status
:
Replica
SchedulingStatus
{},
},
nil
},
nil
}
}
func
(
a
*
schedulingAdapter
)
ScheduleObject
(
cluster
*
federationapi
.
Cluster
,
clusterObj
pkgruntime
.
Object
,
federationObjCopy
pkgruntime
.
Object
,
schedulingInfo
*
SchedulingInfo
)
(
pkgruntime
.
Object
,
bool
,
error
)
{
func
(
a
*
schedulingAdapter
)
ScheduleObject
(
cluster
*
federationapi
.
Cluster
,
clusterObj
pkgruntime
.
Object
,
federationObjCopy
pkgruntime
.
Object
,
schedulingInfo
interface
{})
(
pkgruntime
.
Object
,
bool
,
error
)
{
replicas
,
ok
:=
schedulingInfo
.
Schedule
[
cluster
.
Name
]
typedSchedulingInfo
:=
schedulingInfo
.
(
*
ReplicaSchedulingInfo
)
replicas
,
ok
:=
typedSchedulingInfo
.
Schedule
[
cluster
.
Name
]
if
!
ok
{
if
!
ok
{
replicas
=
0
replicas
=
0
}
}
...
@@ -138,7 +139,7 @@ func (a *schedulingAdapter) ScheduleObject(cluster *federationapi.Cluster, clust
...
@@ -138,7 +139,7 @@ func (a *schedulingAdapter) ScheduleObject(cluster *federationapi.Cluster, clust
reflect
.
ValueOf
(
federationObjCopy
)
.
Elem
()
.
FieldByName
(
"Spec"
)
.
FieldByName
(
"Replicas"
)
.
Set
(
reflect
.
ValueOf
(
&
specReplicas
))
reflect
.
ValueOf
(
federationObjCopy
)
.
Elem
()
.
FieldByName
(
"Spec"
)
.
FieldByName
(
"Replicas"
)
.
Set
(
reflect
.
ValueOf
(
&
specReplicas
))
if
clusterObj
!=
nil
{
if
clusterObj
!=
nil
{
schedulingStatusVal
:=
reflect
.
ValueOf
(
s
chedulingInfo
)
.
Elem
()
.
FieldByName
(
"Status"
)
schedulingStatusVal
:=
reflect
.
ValueOf
(
typedS
chedulingInfo
)
.
Elem
()
.
FieldByName
(
"Status"
)
objStatusVal
:=
reflect
.
ValueOf
(
clusterObj
)
.
Elem
()
.
FieldByName
(
"Status"
)
objStatusVal
:=
reflect
.
ValueOf
(
clusterObj
)
.
Elem
()
.
FieldByName
(
"Status"
)
for
i
:=
0
;
i
<
schedulingStatusVal
.
NumField
();
i
++
{
for
i
:=
0
;
i
<
schedulingStatusVal
.
NumField
();
i
++
{
schedulingStatusField
:=
schedulingStatusVal
.
Field
(
i
)
schedulingStatusField
:=
schedulingStatusVal
.
Field
(
i
)
...
@@ -154,7 +155,7 @@ func (a *schedulingAdapter) ScheduleObject(cluster *federationapi.Cluster, clust
...
@@ -154,7 +155,7 @@ func (a *schedulingAdapter) ScheduleObject(cluster *federationapi.Cluster, clust
return
federationObjCopy
,
replicas
>
0
,
nil
return
federationObjCopy
,
replicas
>
0
,
nil
}
}
func
(
a
*
schedulingAdapter
)
UpdateFederatedStatus
(
obj
pkgruntime
.
Object
,
status
SchedulingStatus
)
error
{
func
(
a
*
schedulingAdapter
)
UpdateFederatedStatus
(
obj
pkgruntime
.
Object
,
status
interface
{}
)
error
{
return
a
.
updateStatusFunc
(
obj
,
status
)
return
a
.
updateStatusFunc
(
obj
,
status
)
}
}
...
...
federation/pkg/federation-controller/sync/controller.go
View file @
0deb4ef3
...
@@ -366,7 +366,7 @@ func (s *FederationSyncController) reconcile(qualifiedName federatedtypes.Qualif
...
@@ -366,7 +366,7 @@ func (s *FederationSyncController) reconcile(qualifiedName federatedtypes.Qualif
return
statusError
return
statusError
}
}
operationsAccessor
:=
func
(
adapter
federatedtypes
.
FederatedTypeAdapter
,
selectedClusters
[]
*
federationapi
.
Cluster
,
unselectedClusters
[]
*
federationapi
.
Cluster
,
obj
pkgruntime
.
Object
,
schedulingInfo
*
federatedtypes
.
SchedulingInfo
)
([]
util
.
FederatedOperation
,
error
)
{
operationsAccessor
:=
func
(
adapter
federatedtypes
.
FederatedTypeAdapter
,
selectedClusters
[]
*
federationapi
.
Cluster
,
unselectedClusters
[]
*
federationapi
.
Cluster
,
obj
pkgruntime
.
Object
,
schedulingInfo
interface
{}
)
([]
util
.
FederatedOperation
,
error
)
{
operations
,
err
:=
clusterOperations
(
adapter
,
selectedClusters
,
unselectedClusters
,
obj
,
key
,
schedulingInfo
,
func
(
clusterName
string
)
(
interface
{},
bool
,
error
)
{
operations
,
err
:=
clusterOperations
(
adapter
,
selectedClusters
,
unselectedClusters
,
obj
,
key
,
schedulingInfo
,
func
(
clusterName
string
)
(
interface
{},
bool
,
error
)
{
return
s
.
informer
.
GetTargetStore
()
.
GetByKey
(
clusterName
,
key
)
return
s
.
informer
.
GetTargetStore
()
.
GetByKey
(
clusterName
,
key
)
})
})
...
@@ -445,7 +445,7 @@ func (s *FederationSyncController) delete(obj pkgruntime.Object, kind string, qu
...
@@ -445,7 +445,7 @@ func (s *FederationSyncController) delete(obj pkgruntime.Object, kind string, qu
}
}
type
clustersAccessorFunc
func
()
([]
*
federationapi
.
Cluster
,
error
)
type
clustersAccessorFunc
func
()
([]
*
federationapi
.
Cluster
,
error
)
type
operationsFunc
func
(
federatedtypes
.
FederatedTypeAdapter
,
[]
*
federationapi
.
Cluster
,
[]
*
federationapi
.
Cluster
,
pkgruntime
.
Object
,
*
federatedtypes
.
SchedulingInfo
)
([]
util
.
FederatedOperation
,
error
)
type
operationsFunc
func
(
federatedtypes
.
FederatedTypeAdapter
,
[]
*
federationapi
.
Cluster
,
[]
*
federationapi
.
Cluster
,
pkgruntime
.
Object
,
interface
{}
)
([]
util
.
FederatedOperation
,
error
)
type
clusterSelectorFunc
func
(
*
metav1
.
ObjectMeta
,
func
(
map
[
string
]
string
,
map
[
string
]
string
)
(
bool
,
error
),
[]
*
federationapi
.
Cluster
)
([]
*
federationapi
.
Cluster
,
[]
*
federationapi
.
Cluster
,
error
)
type
clusterSelectorFunc
func
(
*
metav1
.
ObjectMeta
,
func
(
map
[
string
]
string
,
map
[
string
]
string
)
(
bool
,
error
),
[]
*
federationapi
.
Cluster
)
([]
*
federationapi
.
Cluster
,
[]
*
federationapi
.
Cluster
,
error
)
type
executionFunc
func
([]
util
.
FederatedOperation
)
error
type
executionFunc
func
([]
util
.
FederatedOperation
)
error
...
@@ -467,7 +467,7 @@ func syncToClusters(clustersAccessor clustersAccessorFunc, operationsAccessor op
...
@@ -467,7 +467,7 @@ func syncToClusters(clustersAccessor clustersAccessorFunc, operationsAccessor op
return
statusError
return
statusError
}
}
var
schedulingInfo
*
federatedtypes
.
SchedulingInfo
var
schedulingInfo
interface
{}
if
adapter
.
IsSchedulingAdapter
()
{
if
adapter
.
IsSchedulingAdapter
()
{
schedulingAdapter
,
ok
:=
adapter
.
(
federatedtypes
.
SchedulingAdapter
)
schedulingAdapter
,
ok
:=
adapter
.
(
federatedtypes
.
SchedulingAdapter
)
if
!
ok
{
if
!
ok
{
...
@@ -490,7 +490,8 @@ func syncToClusters(clustersAccessor clustersAccessorFunc, operationsAccessor op
...
@@ -490,7 +490,8 @@ func syncToClusters(clustersAccessor clustersAccessorFunc, operationsAccessor op
if
!
ok
{
if
!
ok
{
glog
.
Fatalf
(
"Adapter for kind %q does not properly implement SchedulingAdapter."
,
kind
)
glog
.
Fatalf
(
"Adapter for kind %q does not properly implement SchedulingAdapter."
,
kind
)
}
}
err
=
schedulingAdapter
.
UpdateFederatedStatus
(
obj
,
schedulingInfo
.
Status
)
typedScheduleInfo
:=
schedulingInfo
.
(
*
federatedtypes
.
ReplicaSchedulingInfo
)
err
=
schedulingAdapter
.
UpdateFederatedStatus
(
obj
,
typedScheduleInfo
.
Status
)
if
err
!=
nil
{
if
err
!=
nil
{
runtime
.
HandleError
(
fmt
.
Errorf
(
"adapter.UpdateFinished() failed on adapter for %s %q: %v"
,
kind
,
key
,
err
))
runtime
.
HandleError
(
fmt
.
Errorf
(
"adapter.UpdateFinished() failed on adapter for %s %q: %v"
,
kind
,
key
,
err
))
return
statusError
return
statusError
...
@@ -532,7 +533,7 @@ func selectedClusters(objMeta *metav1.ObjectMeta, selector func(map[string]strin
...
@@ -532,7 +533,7 @@ func selectedClusters(objMeta *metav1.ObjectMeta, selector func(map[string]strin
type
clusterObjectAccessorFunc
func
(
clusterName
string
)
(
interface
{},
bool
,
error
)
type
clusterObjectAccessorFunc
func
(
clusterName
string
)
(
interface
{},
bool
,
error
)
// clusterOperations returns the list of operations needed to synchronize the state of the given object to the provided clusters
// clusterOperations returns the list of operations needed to synchronize the state of the given object to the provided clusters
func
clusterOperations
(
adapter
federatedtypes
.
FederatedTypeAdapter
,
selectedClusters
[]
*
federationapi
.
Cluster
,
unselectedClusters
[]
*
federationapi
.
Cluster
,
obj
pkgruntime
.
Object
,
key
string
,
schedulingInfo
*
federatedtypes
.
SchedulingInfo
,
accessor
clusterObjectAccessorFunc
)
([]
util
.
FederatedOperation
,
error
)
{
func
clusterOperations
(
adapter
federatedtypes
.
FederatedTypeAdapter
,
selectedClusters
[]
*
federationapi
.
Cluster
,
unselectedClusters
[]
*
federationapi
.
Cluster
,
obj
pkgruntime
.
Object
,
key
string
,
schedulingInfo
interface
{}
,
accessor
clusterObjectAccessorFunc
)
([]
util
.
FederatedOperation
,
error
)
{
operations
:=
make
([]
util
.
FederatedOperation
,
0
)
operations
:=
make
([]
util
.
FederatedOperation
,
0
)
kind
:=
adapter
.
Kind
()
kind
:=
adapter
.
Kind
()
...
...
federation/pkg/federation-controller/sync/controller_test.go
View file @
0deb4ef3
...
@@ -75,7 +75,7 @@ func TestSyncToClusters(t *testing.T) {
...
@@ -75,7 +75,7 @@ func TestSyncToClusters(t *testing.T) {
}
}
return
nil
,
nil
return
nil
,
nil
},
},
func
(
federatedtypes
.
FederatedTypeAdapter
,
[]
*
federationapi
.
Cluster
,
[]
*
federationapi
.
Cluster
,
pkgruntime
.
Object
,
*
federatedtypes
.
SchedulingInfo
)
([]
util
.
FederatedOperation
,
error
)
{
func
(
federatedtypes
.
FederatedTypeAdapter
,
[]
*
federationapi
.
Cluster
,
[]
*
federationapi
.
Cluster
,
pkgruntime
.
Object
,
interface
{}
)
([]
util
.
FederatedOperation
,
error
)
{
if
testCase
.
operationsError
{
if
testCase
.
operationsError
{
return
nil
,
awfulError
return
nil
,
awfulError
}
}
...
...
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