Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Autoscale api model #3586

Merged
merged 18 commits into from
Jul 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
0b17d3f
adding fields to specify that we should autoscale a cluster.
JackQuincy Jul 10, 2018
5a128e7
Merge branch 'master' into autoscale-api-model
JackQuincy Jul 11, 2018
9040946
updating api model to make sure not setting autoscalePool doesn't alw…
JackQuincy Jul 11, 2018
8ea3479
adding unit tests for TestPointerToInt
JackQuincy Jul 11, 2018
72b86b6
adding preview api version
JackQuincy Jul 13, 2018
f34bbd5
Revert "adding unit tests for TestPointerToInt"
JackQuincy Jul 13, 2018
5f7e68b
Revert "updating api model to make sure not setting autoscalePool doe…
JackQuincy Jul 13, 2018
73dc012
Revert "Revert "adding unit tests for TestPointerToInt""
JackQuincy Jul 13, 2018
12b6b04
Revert "adding fields to specify that we should autoscale a cluster."
JackQuincy Jul 13, 2018
ce8683f
Getting ready to move the AKS api model into AKS, by only adding the …
JackQuincy Jul 13, 2018
6a09763
removing preview version
JackQuincy Jul 13, 2018
fccaff4
syncing up with acs-engine method of enabling cluster autoscaler the …
JackQuincy Jul 30, 2018
c8fcf6f
pushing go generate changes into the repo
JackQuincy Jul 30, 2018
663a712
Merge branch 'master' into autoscale-api-model
JackQuincy Jul 30, 2018
2879ac5
pulling in master and running go generate
JackQuincy Jul 30, 2018
44aee5a
Revert "pulling in master and running go generate"
JackQuincy Jul 31, 2018
327d209
removing changes from running go generate
JackQuincy Jul 31, 2018
204fef1
adding back enable on agent pool to opt in each agent pool
JackQuincy Jul 31, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ type AgentPoolProfile struct {
Extensions []Extension `json:"extensions"`
KubernetesConfig *KubernetesConfig `json:"kubernetesConfig,omitempty"`
ImageRef *ImageReference `json:"imageReference,omitempty"`
MaxCount *int `json:"maxCount,omitempty"`
MinCount *int `json:"minCount,omitempty"`
EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"`
}

// AgentPoolProfileRole represents an agent role
Expand Down
6 changes: 6 additions & 0 deletions pkg/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ func PointerToBool(b bool) *bool {
return &p
}

// PointerToInt returns a pointer to a int
func PointerToInt(i int) *int {
p := i
return &p
}

// EqualError is a ni;-safe method which reports whether errors a and b are considered equal.
// They're equal if both are nil, or both are not nil and a.Error() == b.Error().
func EqualError(a, b error) bool {
Expand Down
17 changes: 17 additions & 0 deletions pkg/helpers/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ func TestPointerToBool(t *testing.T) {
}
}

func TestPointerToInt(t *testing.T) {
int1 := 1
int2 := 2
ret1 := PointerToInt(int1)
if *ret1 != int1 {
t.Fatalf("expected PointerToInt(1) to return *1, instead returned %#v", ret1)
}
ret2 := PointerToInt(int2)
if *ret2 != int2 {
t.Fatalf("expected PointerToInt(2) to return *2, instead returned %#v", ret2)
}

if *ret2 <= *ret1 {
t.Fatalf("Pointers to ints messed up their values and made 2 <= 1")
}
}

func TestCreateSSH(t *testing.T) {
rg := rand.New(rand.NewSource(42))

Expand Down