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

Various cleanups around apply_cluster and awsmodel #10579

Merged
merged 6 commits into from
Mar 7, 2021

Conversation

olemarkus
Copy link
Member

A lot of the AWS specific builders exist in the generic model package. Most of them have now been moved to awsmodel.
Some are left behind because they are (ab)used elsewhere in kOps.

Also merged spotinst builder into awsmodel because spotinst isn't a true cloud provider and there are cyclic dependencies between the two.

Also merged the two large switch statements.

/kind cleanup

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. area/provider/aws Issues or PRs related to aws provider labels Jan 14, 2021
@k8s-ci-robot k8s-ci-robot added area/provider/spotinst Issues or PRs related to spotinst provider approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 14, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 16, 2021
@olemarkus
Copy link
Member Author

/test pull-kops-e2e-kubernetes-aws

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 23, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 29, 2021
@hakman
Copy link
Member

hakman commented Jan 31, 2021

As discussed during Office Hours, Justin will give the final approval on this.
/assign @justinsb

@@ -67,7 +66,7 @@ func (b *AutoscalingGroupModelBuilder) Build(c *fi.ModelBuilderContext) error {
name := b.AutoscalingGroupName(ig)

if featureflag.SpotinstHybrid.Enabled() {
if spotinstmodel.HybridInstanceGroup(ig) {
if HybridInstanceGroup(ig) {
Copy link
Member

Choose a reason for hiding this comment

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

We might want to call this SpotInstHybridInstanceGroup if it's spotinst specific

@@ -270,11 +271,11 @@ func (b *BastionModelBuilder) Build(c *fi.ModelBuilderContext) error {
// Here we implement the bastion CNAME logic
// By default bastions will create a CNAME that follows the `bastion-$clustername` formula
t := &awstasks.DNSName{
Name: s(bastionPublicName),
Name: fi.String(bastionPublicName),
Copy link
Member

Choose a reason for hiding this comment

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

I think I agree with this change (it's more verbose but clearer not to use the helper functions), but it might have been easier to do this as a follow-on PR or separate commit, just from a change readability perspective.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. This change was mainly done because awstasks does not have these helper functions, and I didn't see the point of copying them.

@justinsb
Copy link
Member

justinsb commented Mar 7, 2021

One suggestion to rename a spotinst-specific method ("HybridInstanceGroup") but non-blocking and this is good

/approve
/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 7, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman, justinsb

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

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 7, 2021
@rifelpet
Copy link
Member

rifelpet commented Mar 7, 2021

/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 7, 2021
@k8s-ci-robot k8s-ci-robot merged commit 1f7a184 into kubernetes:master Mar 7, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Mar 7, 2021
k8s-ci-robot added a commit that referenced this pull request Mar 12, 2021
…579-origin-release-1.20

Automated cherry pick of #10579: Set ssh key on the model context in one location
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/provider/aws Issues or PRs related to aws provider area/provider/spotinst Issues or PRs related to spotinst provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants