Skip to content

Commit

Permalink
clean from Target.Append() function
Browse files Browse the repository at this point in the history
  • Loading branch information
kuritka committed Jun 24, 2022
1 parent 69fda1a commit e6ef1dc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 70 deletions.
6 changes: 0 additions & 6 deletions controllers/providers/assistant/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,3 @@ func (t Targets) GetIPs() (ips []string) {
}
return ips
}

func (t Targets) Append(targets Targets) {
for k, v := range targets {
t[k] = v
}
}
64 changes: 0 additions & 64 deletions controllers/weight_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,64 +34,6 @@ limitations under the License.
Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
*/

//
// {
// name: "eu100-us0-za0",
// injectWeights: true,
// data: map[string]wrr{
// "eu": {weight: "100%", targets: []string{"10.10.0.1", "10.10.0.2"}},
// "us": {weight: "0%", targets: []string{"10.0.0.1", "10.0.0.2"}},
// "za": {weight: "0%", targets: []string{"10.22.0.1", "10.22.0.2", "10.22.1.1"}},
// },
// annotation: `{"eu":{"weight":100,"targets":["10.10.0.1","10.10.0.2"]},` +
// `"us":{"weight":0,"targets":["10.0.0.1","10.0.0.2"]},` +
// `"za":{"weight":0,"targets":["10.22.0.1","10.22.0.2","10.22.1.1"]}}`,
// },
// {
// name: "weights-without-external-targets",
// injectWeights: true,
// data: map[string]wrr{
// "eu": {weight: "25%", targets: []string{}},
// "us": {weight: "75%", targets: []string{}},
// "za": {weight: "0%", targets: []string{}},
// },
// annotation: `{"eu":{"weight":25,"targets":[]},` +
// `"us":{"weight":75,"targets":[]},` +
// `"za":{"weight":0,"targets":[]}}`,
// },
//
// {
// name: "no weights without external targets",
// injectWeights: false,
// data: map[string]wrr{},
// },
//
// {
// name: "no weights with external targets",
// injectWeights: false,
// data: map[string]wrr{
// "eu": {weight: "100%", targets: []string{"10.10.0.1", "10.10.0.2"}},
// "us": {weight: "0%", targets: []string{"10.0.0.1", "10.0.0.2"}},
// "za": {weight: "0%", targets: []string{"10.22.0.1", "10.22.0.2", "10.22.1.1"}},
// },
// },
//
// {
// name: "us100",
// injectWeights: true,
// data: map[string]wrr{
// "us": {weight: "100%", targets: []string{"10.0.0.1", "10.0.0.2"}},
// },
// annotation: `{"us":{"weight":100,"targets":["10.0.0.1","10.0.0.2"]}}`,
// },
//
// {
// name: "Empty weights",
// injectWeights: true,
// data: map[string]wrr{},
// },
// }

func TestWeight(t *testing.T) {
// arrange
type wrr struct {
Expand Down Expand Up @@ -169,7 +111,6 @@ func TestWeight(t *testing.T) {
"weight-za-0-0": "",
},
},

{
name: "no weights without external targets",
injectWeights: false,
Expand All @@ -178,7 +119,6 @@ func TestWeight(t *testing.T) {
"strategy": depresolver.RoundRobinStrategy,
},
},

{
name: "no weights with external targets",
injectWeights: false,
Expand All @@ -191,7 +131,6 @@ func TestWeight(t *testing.T) {
"strategy": depresolver.RoundRobinStrategy,
},
},

{
name: "empty weights",
injectWeights: true,
Expand Down Expand Up @@ -254,11 +193,8 @@ func TestWeight(t *testing.T) {

// act, assert
_, _ = settings.reconciler.Reconcile(context.TODO(), settings.request)

})
}
// assert

}

// TODO: test pro vicero endpointu, bez weights, vicero endpointu, nejake maji weights
Expand Down

0 comments on commit e6ef1dc

Please sign in to comment.