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

Get binary for specific version of EKS-A release in E2E tests #650

Merged
merged 3 commits into from
Nov 17, 2021

Conversation

taneyland
Copy link
Member

Issue #, if available:

Description of changes:
This PR allows us to extract the binary of the desired EKS-A release version for E2E tests.
We also changed the compare function in the semver package to increase its readability.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@abhay-krishna abhay-krishna added approved size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 17, 2021
latestReleaseBinaryPath := filepath.Join(latestReleaseBinaryFolder, releaseBinaryName)

if !validations.FileExists(latestReleaseBinaryPath) {
e.T.Logf("Downloading binary for EKS-A release [%s]", release.Version)
Copy link
Member

Choose a reason for hiding this comment

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

consider logging the path as well (here and in the errors)

return 1
}
return -1
if c := compare(v.Major, v2.Major); c != 0 {
Copy link
Member

Choose a reason for hiding this comment

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

nice this is very clear now

}

func (e *ClusterE2ETest) getBinary(release *releasev1alpha1.EksARelease) (string, error) {
latestReleaseBinaryFolder := filepath.Join("bin", release.Version)
Copy link
Member

Choose a reason for hiding this comment

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

so the directory will be in the format ./bin/v0.6.0/?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes!

}

func (e *ClusterE2ETest) GetLatestMinorReleaseFromReleaseBranch(releaseBranchVersion *semver.Version) *releasev1alpha1.EksARelease {
func (e *ClusterE2ETest) GetLatestMinorReleaseFromReleaseBranch(releaseBranchVersion *semver.Version) string {
Copy link
Member

Choose a reason for hiding this comment

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

perhaps this method should be "GetLatestMinorReleaseBinaryFromReleaseBranch" or "DownloadLatestMinorReleaseFromReleaseBranch" or something (I realize that's really long) that indicates that it not only gets the release object but actually downloads the binary itself

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I can change it to GetLatestMinorReleaseBinaryFromReleaseBranch because it'll only download the binary if it doesn't exist, but it'll always "get" the binary to use in the E2E test.

@abhay-krishna
Copy link
Member

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danbudris, taneyland

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 [danbudris,taneyland]

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

@danbudris
Copy link
Member

/lgtm

@danbudris danbudris merged commit 2bed2f4 into aws:main Nov 17, 2021
wanyufe pushed a commit to wanyufe/eks-anywhere that referenced this pull request Mar 9, 2022
* Get binary for specific version of EKS-A release in E2E tests

* Add more detail to logs and errors

* Change method names
eks-distro-bot pushed a commit that referenced this pull request Mar 17, 2022
* Update NewClusterGenerate not use ConvertConfigToConfigGenerateStruct (#645)

* Get previous minor release for core components e2e tests (#618)

* Get previous minor release for core components e2e tests

* Add imports

* Add compare func to semver pkg

* move to framework dir

* make func public to avoid unused warning

* rename file

* Support adding taints on control plane nodes (#359)

* Support adding taints on control plane nodes

* Review comments - Rev1

* Review comments - Rev2

* fix issue with using EKSA_REGISTRY_MIRROR_CA env var (#639)

* fix issue with using EKSA_REGISTRY_MIRROR_CA env var

* Add unit tests for ValidateCert

* add commands used to generate the unit test cert

* Get binary for specific version of EKS-A release in E2E tests (#650)

* Get binary for specific version of EKS-A release in E2E tests

* Add more detail to logs and errors

* Change method names

* move osFamily and userConfiguation from vsphere to shared cluster types

* add cloudstack provider to create cluster

* uncomment out cloudstack setup check

* Remove bottlerocket and kubevip and others based on PR comments

* Fixing fallouts from merge conflicts

* Fix go.sum for release

* Fix unit-test

* Making AWS_REGION overridable

* Fix AWS_REGION env var

* Fix regional endpoints for dev-release clients

* Adding more debug log statements to release

* Add more log statements

* Remove gittag from vsphere cloud provider

* Only test latest tag on bottlerocket

* Add more logs to release output

* Hack networking create step to include allow-all networkpolicy to enable cilium always policy mode

* Remove unit-tests for now to pass

* Include stderr in the skopeo output

* Add more log statements to release

* Modify policy to allow us-east-1 images

* Add eks-a upload artifacts to build stage

* cloudstack - part 3

* Create workflow succeeded after we commented out eksa controller

* update some unit tests and comments out some unit test (review later)

* cloudstack - part 3 (#37)

* cloudstack - part 3

* Create workflow succeeded after we commented out eksa controller

* update some unit tests and comments out some unit test (review later)

Co-authored-by: Yufei Wang <wanyufe@amazon.com>

* Adding capc paths to release pkg

* Fix release pkg to exclude all cloud-provider-cloudstack

* Make cloudstack artifacts non dependent on eksdrelease

* Point to proper buckets for embargo dev-release

* Fixing name on template-cp to match with code expectations

* Removing govc closer

* Removing redundant credentials requirement and formatting code

* Fixing unit tests

* Formatting code

* Refactoring cert validation to come from 'insecure' field of deployment config, and increasing cmk timeout and releasing cmk domain

* Removing other traces of cloudstack username/password

* Revert "Merge branch 'main' into main"

This reverts commit 9383a0c, reversing
changes made to 617a083.

* Build succeeds, but changes untested

* Support either IP address or FQDN for controlPlaneConfiguration.Endpoint.Host

* Cluster creation completes successfully

* Fix and add unit tests for the control plane endpoint host

* Updated for review comments

* Move up calling SplitHostPort before values definition

* fix unit testing - remove control-plane suffix, cloudstack versionbundle test data

* add capc in network policy allow for cilium

* Re-creating bundles from release package

* eks-a reconciler is being invoked

* Got past reconcile dry-run

* Eksa controller isn't failing

* Cleaning up code and fixing mocks

* Renaming variables and cleaning up secret contents and removing CAPC replace in 'go.mod'

* Responding to PR feedback from Joey

* Fixing typo to avoid accidentally creating additional control plane node

* Cleaning up code for PR and adding tests

* Fix unit testing (#45)

* fix unit testing - remove control-plane suffix, cloudstack versionbundle test data

* add capc in network policy allow for cilium

Co-authored-by: Yufei Wang <wanyufe@amazon.com>

* Cleanup

* Add a placeholder for Template in machine config generation (#47)

* Add a placeholder for Template in machine config generation

* Make template required

Co-authored-by: Wonkun Kim <wonkun@amazon.com>

* Changing CAPC dependency to be non-staging repo

* Refactoring cmk wrapper, unit tests, and enabling UUID searching for it (#18)

* Refactoring cmk wrapper, unit tests, and enabling UUID searching for it

* Minor fixes to format and improve error messaging

* Adding missing test data files to fix unit tests

* Upgrading dependencies to address dependabot issues (#50)

* Upgrading dependencies to address dependabot issue

* Updating docs website to address post-css vulnerability

* Making redhat the default osfamily for cloudstack clusters (#51)

* Add multiple DNS into control endpoint CA's SANs (#48)

* Mount /etc/ssl volume for adding CA certs when running eks-a cli docker image

* support extra endpoints in control plane in SANs

* mount /etc/ssl to allow eks-cli to use host ca cert

Co-authored-by: Yufei Wang <wanyufe@amazon.com>

* Add Affinity Group IDs (#53)

* Mount /etc/ssl volume for adding CA certs when running eks-a cli docker image

* support extra endpoints in control plane in SANs

* Add affinity group ids in control-plane, etc, and worker machine config

* use array for affinity group ids

* mount /etc/ssl to allow eks-cli to use host ca cert

Co-authored-by: Yufei Wang <wanyufe@amazon.com>

* Disable read only port and disable anonymous authentication for kubelet

* Fix unit-test files for anonymous auth + read only port for kubelet

* Remove dev files

* Fix unit-testing

* Fix unit-tests for cloudstack

* Add kubelet readonly and anonymous auth for cloudstack

* Fix cloudstack unit-test

* Fix cloudstack extra endpoints unit-test

* Adding preflight check for affinity groups, and upgrading to capc v0.3.0 (#55)

* Adding preflight check for affinity groups, and upgrading to capc v0.3.0

* Apply formatting

* Adding affinity group id copying for upgrade workflow

* Resetting to newer tag

* Updating go.sum

* Fix release for capc

* Fix go.sum for releases

* Remove unwanted go mods from release

* Allow machine templae, offering, users, details to upgrade - Cloudstack (#54)

* Mount /etc/ssl volume for adding CA certs when running eks-a cli docker image

* support extra endpoints in control plane in SANs

* Add affinity group ids in control-plane, etc, and worker machine config

* use array for affinity group ids

* mount /etc/ssl to allow eks-cli to use host ca cert

* Allow offering, users, and details to upgrade

* remove commented out line and change min time back to 30 min

* Remove unused variable

Co-authored-by: Yufei Wang <wanyufe@amazon.com>

* Fix missing provider log in support bundle generated from management cluster (#59)

* Fix the issue where the provider (capc or capv) logs in the support bundle generated from a management cluster

* Fix unit test failures

* Fix the issue where capv specific error messages are printed when generating a support bundle for capc

* Replace capvCrds with capcCrds

* Remove the deployments referred by the CapiWebhookSystemNamespace since it was eliminated in CAPI in CAPI beta

Co-authored-by: Wonkun Kim <wonkun@amazon.com>

* Adding support for CAPC account/domain (#58)

* Adding support for CAPC account/domain

* Fixing provider unit tests

* Adding retry logic on cluster creation to address timeouts

* Fixing unit tests and moving retry logic to be higher in the stack

* Fixing incorrect error message in preflight check

* Reverting retry logic changes to be included in separate PR

* Add control plane in progress check before checking control plane is ready.  (#57)

* Mount /etc/ssl volume for adding CA certs when running eks-a cli docker image

* support extra endpoints in control plane in SANs

* Add affinity group ids in control-plane, etc, and worker machine config

* use array for affinity group ids

* mount /etc/ssl to allow eks-cli to use host ca cert

* Allow offering, users, and details to upgrade

* remove commented out line and change min time back to 30 min

* Remove unused variable

* add control plane in progress check and some retries for cluster upgrade

* remove unnecessary control plane ready check

* remove accidently added file

* remove unused variable

* rephrase log sentense

* re-run make mocks to generate mocks

* Fix unit testing after adding new func

* specify /etc/ssl/certs instead of /etc/ssl due to soft-link issue

* remove retry logic per PR comments

* remove retry logic per PR comments - extra

Co-authored-by: Yufei Wang <wanyufe@amazon.com>

* Fix cipher and audit log regressions

* Fix audit log static manifest

* Remove duplicate capc

* Explicitly add default namespace for cloudstack (#61)

* Mount /etc/ssl volume for adding CA certs when running eks-a cli docker image

* support extra endpoints in control plane in SANs

* Add affinity group ids in control-plane, etc, and worker machine config

* use array for affinity group ids

* mount /etc/ssl to allow eks-cli to use host ca cert

* Allow offering, users, and details to upgrade

* remove commented out line and change min time back to 30 min

* Remove unused variable

* add control plane in progress check and some retries for cluster upgrade

* remove unnecessary control plane ready check

* remove accidently added file

* remove unused variable

* rephrase log sentense

* re-run make mocks to generate mocks

* Fix unit testing after adding new func

* specify /etc/ssl/certs instead of /etc/ssl due to soft-link issue

* remove retry logic per PR comments

* remove retry logic per PR comments - extra

* explictily add default namespace in cloudstack for flux version 0.23 upgrade

Co-authored-by: Yufei Wang <wanyufe@amazon.com>

* Adding support for cloudstack bundles

* Add multiple-zone support for cloudstack provider.

Zones are defined in cloudstack datacenter config and network is
under each zone.

CloudMonkey is updated to check domain, account, zones and network
under each zone.

Template and computer offering are now checked with zone id filter
to make sure they exist in all zones.

Domain and account filter are added when supported by CloudMonkey.

* Addressing lint issues

* Removing Manager in favor of ClusterAPIController

* Removing kubeproxy components

* Fixing missed refactor

* Refactor domainId and account filter

Account cannot be specified without domainId, and domainId can be
specified without account specified.

The change is to show above business requirement.

* code removed, will add back in other files in future

* Some unit tests starting to pass - no validator integration

* Adding support for cloudstack bundles

* Addressing lint issues

* Removing Manager in favor of ClusterAPIController

* Removing kubeproxy components

* Fixing missed refactor

* Some unit tests starting to pass - no validator integration

* Cluster is starting with controller - provider unit tests still failing

* Testing cluster creation after rebase

* Adding managed check to SetupAndValidateCluster

* Cleanup and unit tests passing

* Removing unnecessary testdata files

* Adding readme for cloudstack provider

* Adding feature restriction on cloudstack provider for cluster creation/deletion

* Further cleanup and additional unit testing

* Adding test file

* Removing CAPC templates from this branch

* refactoring to reuse common utilities

* Adding comment explaining empty OSFamily implementation

* Responding to remaining questions and linting

* reduce zones from 2 to 1 in template

* use empty string for zone and network default value in template

* Integrating with validator

* gofumpt-ed

* Revert "Add multiple-zone support for cloudstack provider."

This reverts commit aa31d9b.

* Integrating with validator

* Add multiple-zones in CloudStack Provider.

Updating cmk and validator to use zone, network, domain, and account
as filter to pre-flight check configurations.

* gofumpt-ed files

* Refactoring verifyCert plumbing for cmk

* linting

* Add multiple-zones in CloudStack Provider.

Updating cmk and validator to use zone, network, domain, and account
as filter to pre-flight check configurations.

* gofumpt-ed files

* refactor some code per PR comments, non-functional changes

* Fixing error message

* separate command and args into different variables for clarity

* gofumpted - cmk.go and cloudstackdatacenterconfig.go

* refator listzone using commandArgs and filterArgs

* refactor cmk.go - extract zoneId by name into a func

* do account checking only if account specified

* Adding more utils to common.go

* Removing Insecure flag from cluster spec in favor of passing it in via env var

* Adding redaction for cloudstack env var

* refactoring shared into a const string

* refactor cmk's command args code

* change cmk args builder visibility to internal

* rename to cmkCommandArgs cmk_cmd_builder

* gofumped cmk_cmd_builder.go

* Additional cleanup after merge to get create working

* first attemp to merge controller from embargo to repo

* work-on-going -- merging congtroller

* fix unit test - except template-cp/md

* fix unit testing

* make release-manifests to update config yaml

* fix some merging issues

* EKS-A controller is running stably

* change remaining cloudstack deployment config to datacenter config, v1alpha2 to v1beta 1, details to usercustomerdetails

* Pushing farther in upgrade

* kubevip - part 1

* kube-vip part 2

* Upgrade succeeded

* kube vip - part 3

* kube-vip part 4

* change cloudstack deployment to datacenter -- missed changes

* fix some bugs in cloudstack upgrade flow

* delete controllers/controllers/clusters/cloudstack.go since it is not yet to be used

* update details to userCustomDetails

* remove unused method

* add unit test for cloudstack reconciler and update template-cp.yaml

* undo gomega version change

* uncommented one test case

* add new test case use id instead of name in zone, network, template and offering

* change id/name to be conditional in template-cp/md.yaml

* remove err as part of return from a method

* refactor large method into smaller methods

* Implement tinkerbell manifest writer for hardware generation. (#1482)

The yaml writer satisfies the MachineWriter interface required by
Translate functions for translating a machine description into
tinkerbell custom resource manifests.

* Fix nil pointer issue in upgrade plan with cilium (#1318)

* undo changes for cloudstack in cluster_controller.go file

* refactor to remove loop since cloudstack only support 1 worker node group config per PR comments

* [PR BOT] Update ATTRIBUTION.txt file (#1457)

* pass the required info as flags instead of env (#1501)

* Enable only docker e2e tests (#1503)

* roll back changes in changelog.md

* extract controlplane name into a separate method

* Implement json MachineWriter for Tinkerbell hardware generation. (#1500)

Similar to the yaml writer, we need to write tinkerbell hardware json
that can be registered with the tinkerbell stack. This cl adds the
construct for creating individual tinkerbell hardware jsons and
provides a mechanism to retrieve all files written enabling a separation
of generate and register steps.

* change cloudstack provider to 0.4.1

* change variable name to reflect cloudstack - Cs

* validate zones are immutable

* remove zone check since old spec is empty currently

* Revert "remove zone check since old spec is empty currently"

This reverts commit 65909c1.

Co-authored-by: Jiayi Wang <jiayiwang7@yahoo.com>
Co-authored-by: Taylor Neyland <57606775+taneyland@users.noreply.github.com>
Co-authored-by: Abhisek Banerjee <68349259+bnrjee@users.noreply.github.com>
Co-authored-by: Abhinav Pandey <abhinavmpandey08@gmail.com>
Co-authored-by: Vignesh Goutham Ganesh <72776369+vignesh-goutham@users.noreply.github.com>
Co-authored-by: Yufei Wang <wanyufe@amazon.com>
Co-authored-by: Vignesh Goutham Ganesh <vgg@amazon.com>
Co-authored-by: Max Dribinsky <dribinm@amazon.com>
Co-authored-by: Wonkun Kim <wonkun@amazon.com>
Co-authored-by: Max Dribinsky <maxdrib@users.noreply.github.com>
Co-authored-by: Wonkun Kim <wongni@gmail.com>
Co-authored-by: Chris Doherty <chris.doherty4@gmail.com>
Co-authored-by: EKS Distro PR Bot <75336432+eks-distro-pr-bot@users.noreply.github.com>
Co-authored-by: Daniel Budris <budris@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants