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
944e7f77
Commit
944e7f77
authored
Jul 21, 2016
by
Marcin Wielgus
Committed by
Marcin
Jul 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Internal types for FederatedReplicaSetPreferences
parent
1784e99a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
0 deletions
+70
-0
types.generated.go
federation/apis/federation/types.generated.go
+0
-0
types.go
federation/apis/federation/types.go
+29
-0
zz_generated.deepcopy.go
federation/apis/federation/zz_generated.deepcopy.go
+41
-0
No files found.
federation/apis/federation/types.generated.go
View file @
944e7f77
This diff is collapsed.
Click to expand it.
federation/apis/federation/types.go
View file @
944e7f77
...
@@ -108,3 +108,32 @@ type ClusterList struct {
...
@@ -108,3 +108,32 @@ type ClusterList struct {
// List of Cluster objects.
// List of Cluster objects.
Items
[]
Cluster
`json:"items"`
Items
[]
Cluster
`json:"items"`
}
}
// Temporary/alpha stuctures to support custom replica assignments within FederatedReplicaSet.
// A set of preferences that can be added to federated version of ReplicaSet as a json-serialized annotation.
// The preferences allow the user to express in which culsters he wants to put his replicas within the
// mentiond FederatedReplicaSet.
type
FederatedReplicaSetPreferences
struct
{
// If set to true then already scheduled and running replicas may be moved to other clusters to
// in order to bring cluster replicasets towards a desired state. Otherwise, if set to false,
// up and running replicas will not be moved.
Rebalance
bool
`json:"rebalance,omitempty"`
// A mapping between cluser names and preferences regarding local replicasets in these clusters.
// "*" (if provided) applies to all clusters if an explicit mapping is not provided. If there is no
// "*" that clusters without explicit preferences should not have any replicas scheduled.
Clusters
map
[
string
]
ClusterReplicaSetPreferences
`json:"clusters,omitempty"`
}
// Preferences regarding number of replicas assigned to a cluster replicaset within a federated replicaset.
type
ClusterReplicaSetPreferences
struct
{
// Minimum number of replicas that should be assigned to this Local ReplicaSet. 0 by default.
MinReplicas
int64
`json:"maxReplicas,omitempty"`
// Maximum number of replicas that should be assigned to this Local ReplicaSet. Unbounded if no value provided (default).
MaxReplicas
*
int64
`json:"maxReplicas,omitempty"`
// A number expressing the preference to put an additional replica to this LocalReplicaSet. 0 by default.
Weight
int64
}
federation/apis/federation/zz_generated.deepcopy.go
View file @
944e7f77
...
@@ -31,8 +31,10 @@ func init() {
...
@@ -31,8 +31,10 @@ func init() {
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_Cluster
,
InType
:
reflect
.
TypeOf
(
func
()
*
Cluster
{
var
x
*
Cluster
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_Cluster
,
InType
:
reflect
.
TypeOf
(
func
()
*
Cluster
{
var
x
*
Cluster
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ClusterCondition
,
InType
:
reflect
.
TypeOf
(
func
()
*
ClusterCondition
{
var
x
*
ClusterCondition
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ClusterCondition
,
InType
:
reflect
.
TypeOf
(
func
()
*
ClusterCondition
{
var
x
*
ClusterCondition
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ClusterList
,
InType
:
reflect
.
TypeOf
(
func
()
*
ClusterList
{
var
x
*
ClusterList
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ClusterList
,
InType
:
reflect
.
TypeOf
(
func
()
*
ClusterList
{
var
x
*
ClusterList
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ClusterReplicaSetPreferences
,
InType
:
reflect
.
TypeOf
(
func
()
*
ClusterReplicaSetPreferences
{
var
x
*
ClusterReplicaSetPreferences
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ClusterSpec
,
InType
:
reflect
.
TypeOf
(
func
()
*
ClusterSpec
{
var
x
*
ClusterSpec
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ClusterSpec
,
InType
:
reflect
.
TypeOf
(
func
()
*
ClusterSpec
{
var
x
*
ClusterSpec
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ClusterStatus
,
InType
:
reflect
.
TypeOf
(
func
()
*
ClusterStatus
{
var
x
*
ClusterStatus
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ClusterStatus
,
InType
:
reflect
.
TypeOf
(
func
()
*
ClusterStatus
{
var
x
*
ClusterStatus
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_FederatedReplicaSetPreferences
,
InType
:
reflect
.
TypeOf
(
func
()
*
FederatedReplicaSetPreferences
{
var
x
*
FederatedReplicaSetPreferences
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ServerAddressByClientCIDR
,
InType
:
reflect
.
TypeOf
(
func
()
*
ServerAddressByClientCIDR
{
var
x
*
ServerAddressByClientCIDR
;
return
x
}())},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_federation_ServerAddressByClientCIDR
,
InType
:
reflect
.
TypeOf
(
func
()
*
ServerAddressByClientCIDR
{
var
x
*
ServerAddressByClientCIDR
;
return
x
}())},
);
err
!=
nil
{
);
err
!=
nil
{
// if one of the deep copy functions is malformed, detect it immediately.
// if one of the deep copy functions is malformed, detect it immediately.
...
@@ -93,6 +95,23 @@ func DeepCopy_federation_ClusterList(in interface{}, out interface{}, c *convers
...
@@ -93,6 +95,23 @@ func DeepCopy_federation_ClusterList(in interface{}, out interface{}, c *convers
}
}
}
}
func
DeepCopy_federation_ClusterReplicaSetPreferences
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
{
in
:=
in
.
(
*
ClusterReplicaSetPreferences
)
out
:=
out
.
(
*
ClusterReplicaSetPreferences
)
out
.
MinReplicas
=
in
.
MinReplicas
if
in
.
MaxReplicas
!=
nil
{
in
,
out
:=
&
in
.
MaxReplicas
,
&
out
.
MaxReplicas
*
out
=
new
(
int64
)
**
out
=
**
in
}
else
{
out
.
MaxReplicas
=
nil
}
out
.
Weight
=
in
.
Weight
return
nil
}
}
func
DeepCopy_federation_ClusterSpec
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
func
DeepCopy_federation_ClusterSpec
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
{
{
in
:=
in
.
(
*
ClusterSpec
)
in
:=
in
.
(
*
ClusterSpec
)
...
@@ -144,6 +163,28 @@ func DeepCopy_federation_ClusterStatus(in interface{}, out interface{}, c *conve
...
@@ -144,6 +163,28 @@ func DeepCopy_federation_ClusterStatus(in interface{}, out interface{}, c *conve
}
}
}
}
func
DeepCopy_federation_FederatedReplicaSetPreferences
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
{
in
:=
in
.
(
*
FederatedReplicaSetPreferences
)
out
:=
out
.
(
*
FederatedReplicaSetPreferences
)
out
.
Rebalance
=
in
.
Rebalance
if
in
.
Clusters
!=
nil
{
in
,
out
:=
&
in
.
Clusters
,
&
out
.
Clusters
*
out
=
make
(
map
[
string
]
ClusterReplicaSetPreferences
)
for
key
,
val
:=
range
*
in
{
newVal
:=
new
(
ClusterReplicaSetPreferences
)
if
err
:=
DeepCopy_federation_ClusterReplicaSetPreferences
(
&
val
,
newVal
,
c
);
err
!=
nil
{
return
err
}
(
*
out
)[
key
]
=
*
newVal
}
}
else
{
out
.
Clusters
=
nil
}
return
nil
}
}
func
DeepCopy_federation_ServerAddressByClientCIDR
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
func
DeepCopy_federation_ServerAddressByClientCIDR
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
{
{
in
:=
in
.
(
*
ServerAddressByClientCIDR
)
in
:=
in
.
(
*
ServerAddressByClientCIDR
)
...
...
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