Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Cluster-autoscaler: cloud provider interface implementation for GCE #1323

Merged
merged 1 commit into from
Jul 7, 2016

Conversation

mwielgus
Copy link
Contributor

@mwielgus mwielgus commented Jul 6, 2016


// AddNodeGroup adds node group defined in string spec. Format:
// minNodes:maxNodes:migUrl
func (gce *GceCloudProvider) AddNodeGroup(spec string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be passed in a constructor? Do you have any use case for adding NodeGroup in flight?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

}

// Url builds GCE url for the MIG.
func (mig *Mig) Url() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this? It's equivalent to Id().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mwielgus mwielgus force-pushed the gce-provider branch 2 times, most recently from 94e886a to 4d22a72 Compare July 7, 2016 10:44
// IncreaseSize increases Mig size
func (mig *Mig) IncreaseSize(delta int) error {
if delta <= 0 {
return fmt.Errorf("size increase must be positive")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so why not making delta uint?

Copy link
Contributor Author

@mwielgus mwielgus Jul 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suppose that someone has -1 in an int variable. Stupid int->uint conversion would make it some huge number that added to the current size couple lines below would effectively mean -1. In this way -1 would pass through the checks.

@mwielgus mwielgus force-pushed the gce-provider branch 3 times, most recently from fe08aef to 678951d Compare July 7, 2016 11:52
@piosz
Copy link
Contributor

piosz commented Jul 7, 2016

LGTM

@piosz piosz added the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2016
@mwielgus mwielgus merged commit 711a03a into kubernetes-retired:master Jul 7, 2016
}

// Belongs retruns true if the given node belongs to the NodeGroup.
func (mig *Mig) Belongs(node *kube_api.Node) (bool, error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwielgus Does this method need to be exported?

mwielgus added a commit to kubernetes/autoscaler that referenced this pull request Apr 18, 2017
…provider

Cluster-autoscaler: cloud provider interface implementation for GCE
mwielgus added a commit to kubernetes/autoscaler that referenced this pull request Apr 18, 2017
…provider

Cluster-autoscaler: cloud provider interface implementation for GCE
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/autoscaler lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants