Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom AWS region overrides #1707 #1745

Merged
merged 1 commit into from
Mar 12, 2019

Conversation

jottofar
Copy link

@jottofar jottofar commented Mar 3, 2019

Replicated changes from kubernetes "Add AWS Custom Endpoint capability #70588" into cluster-autoscaler:

  • Modified aws_manager similar to kubernetes aws.
  • Modified kubernetes aws exposing type/methods used by cluster-autoscaler aws_manager.

Closes #1707

Fixes #1707

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 3, 2019
@k8s-ci-robot k8s-ci-robot requested review from piosz and zmerlynn March 3, 2019 23:47
@bskiba
Copy link
Member

bskiba commented Mar 4, 2019

Seems there is an issue with the cloudprovider/aws/aws_manager_test

@bskiba bskiba added area/cluster-autoscaler area/provider/aws Issues or PRs related to aws provider labels Mar 4, 2019
@jottofar
Copy link
Author

jottofar commented Mar 4, 2019

/retest

@@ -595,7 +595,7 @@ type CloudConfig struct {
}
}

func (cfg *CloudConfig) validateOverrides() error {
func (cfg *CloudConfig) ValidateOverrides() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Were all the methods capitalized by syncing the vendored file or by hand?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, that is how I did it to get the change in here quickly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Anything under vendor dir is untouchable. Since anytime autoscaler dependencies are updated, your changes are lost. The original idea was to have every component to implement its own mechanism of overriding the custom endpoints. Once we update all relevant component, we may identify which code is generic enough to be shared among components. Right now, it means to copy paste both validateOverrides and getResolver methods from the vendor dir into cluster-autoscaler/cloudprovider/aws/aws_manager.go.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the input. I replicated the necessary changes from vendor into cluster-autoscaler/cloudprovider/aws/aws_manager.go: CloudConfig struct and validateOverrides and getResolver methods.
Should autoscaler have it's own AWS config file with overrides and not rely on the one necessary for the Openshift install? I assume so to adhere to the original idea of every component implementing it's own mechanism.

Copy link
Contributor

Choose a reason for hiding this comment

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

The intention (as I understand it) is to replicate the same code in here. Share the config struct, but just have another implementation of it here. That's how these are set up for the time being and have behaved historically.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, so I'll change it to reuse the vendor provided CloudConfig struct. I thought the intent may have been to completely remove any dependency on the vendor code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, so I'll change it to reuse the vendor provided CloudConfig struct. I thought the intent may have been to completely remove any dependency on the vendor code.

AWS endpoint customization was merged only into kubernetes master branch. New feature are not usually backported into older releases unless they are proven very useful and important. Given (and please prove me wrong) the autoscaler deps are synced only with the stable versions of kubernetes, it would take some time to fetch the master changes into the vendor directory anyway. So yes, there was no intent to have the AWS endpoint customization to be consumed from the vendor directory.

@jottofar jottofar force-pushed the issue1707 branch 4 times, most recently from be4dc49 to 1b4a286 Compare March 5, 2019 20:39
@jottofar jottofar force-pushed the issue1707 branch 2 times, most recently from 036ecf6 to c359b8f Compare March 6, 2019 17:28
Replicated changes from kubernetes "Add AWS Custom Endpoint capability #70588" into cluster-autoscaler:

- Modified aws_manager snd aws_manager_test similar to kubernetes aws and aws_test.
@ingvagabund
Copy link
Contributor

@aleksandra-malinowska PTAL

@mwielgus mwielgus removed request for zmerlynn and piosz March 11, 2019 21:21
@mwielgus
Copy link
Contributor

@ingvagabund This PR requires LGTM from someone from AWS.

@Jeffwan Ping :).

@Jeffwan
Copy link
Contributor

Jeffwan commented Mar 11, 2019

@mwielgus Miss this PR, I will have a look and leave comments by EOD.

Copy link
Contributor

@Jeffwan Jeffwan left a comment

Choose a reason for hiding this comment

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

This feature will only be compatible with v1.14 and master

var err error

if config != nil {
err = gcfg.ReadInto(&cfg, config)
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: seems err is scoped only to the if block that handles it, using old way in one line ends up being cleaner.

if err := gcfg.ReadInto(&cfg, configReader); err != nil {

@Jeffwan
Copy link
Contributor

Jeffwan commented Mar 12, 2019

/LGTM

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 12, 2019
@cuppett
Copy link
Contributor

cuppett commented Mar 12, 2019

@Jeffwan Does somebody else have to "approve" this also?

@mwielgus
Copy link
Contributor

@cuppett No, we merge (approve) as soon as we get LGTM from AWS.

Copy link
Contributor

@mwielgus mwielgus left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mwielgus

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 12, 2019
@k8s-ci-robot k8s-ci-robot merged commit e79fbee into kubernetes:master Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cluster-autoscaler area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants