Skip to content

Generate Instance CRD #55

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

Merged
merged 10 commits into from
Jun 2, 2022
Merged

Generate Instance CRD #55

merged 10 commits into from
Jun 2, 2022

Conversation

brycahta
Copy link
Contributor

Issue #, if available: aws-controllers-k8s/community#1196

Description of changes:

  • Instance Controller create/delete functionality with smoke test

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@brycahta
Copy link
Contributor Author

I will be handling update/modify code as well as exceptions and TerminalConditions in the next PR. Until then, Instance is NOT able to achieve ResourceSynced state because of "rolling" late initialization for fields such as BlockDeviceMappings.

Detailed Details

//prev
BlockDeviceMappings: []

//updated
BlockDeviceMappings: [{
              DeviceName: "/dev/xvda",
              Ebs: {
                AttachTime: 2022-05-25 17:20:03 +0000 UTC,
                DeleteOnTermination: true,
                Status: "attaching",
                VolumeId: "vol-008cf94ebf53b06ec"
              }
            }],
  • This triggers an update (not yet impl) and thus resource does not reach Sync state.
  • Note, I have tried LateInitializing BlockDeviceMappings, but per the first point it does not apply here.

Copy link
Contributor

@RedbackThomson RedbackThomson left a comment

Choose a reason for hiding this comment

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

I just want to make sure we're not duplicating fields between Spec and Status. I saw VPCID defined in Status, but I don't see it defined in Spec - which makes me wonder how I would set this value in the first place.

Also left a comment inline about testing methodology.

@brycahta
Copy link
Contributor Author

I saw VPCID defined in Status, but I don't see it defined in Spec - which makes me wonder how I would set this value in the first place.

Good catch! By default, RunInstances API will use the default VPC and a random subnet. If you want to select which VPC+Subnet to use, then the subnetID needs to be specified in the request. Basically there's no way to pass a VPCID in the request. https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html

@brycahta brycahta requested a review from RedbackThomson May 27, 2022 16:10
@brycahta
Copy link
Contributor Author

brycahta commented Jun 1, 2022

/retest

Copy link
Contributor

@RedbackThomson RedbackThomson left a comment

Choose a reason for hiding this comment

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

Great job!

}
instanceTags = append(instanceTags, tag)
}
desiredTagSpecs.SetResourceType("instance")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Move into a constant

@vijtrip2
Copy link

vijtrip2 commented Jun 2, 2022

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 2, 2022
@ack-bot
Copy link
Collaborator

ack-bot commented Jun 2, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brycahta, RedbackThomson, vijtrip2

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:
  • OWNERS [RedbackThomson,brycahta,vijtrip2]

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

@ack-bot ack-bot merged commit aa747d9 into aws-controllers-k8s:main Jun 2, 2022
@brycahta brycahta deleted the gen-instance branch June 29, 2022 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants