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

dep: Use GitLab-maintained docker-machine package #145

Merged

Conversation

lgarber-akamai
Copy link
Contributor

@lgarber-akamai lgarber-akamai commented Aug 2, 2024

📝 Description

This pull request adds a replace statement to go.mod to use GitLab's docker-machine fork rather than its deprecated equivalent.

This is necessary to consume versions of Docker > v20.x.x which contain critical security fixes.

NOTE: This has been successfully tested against v2.8.5 using the steps in the Testing Rancher Compatibility section.

✔️ How to Test

The following test steps assume you have pulled down this PR locally.

Unit Testing

make test

Manual Testing

  1. Ensure the LINODE_TOKEN environment variable is exported.

  2. Install docker-machine-driver-linode locally:

make install
  1. Download the GitLab docker-machine fork CLI locally (see documentation):
curl -o docker-machine "https://gitlab-docker-machine-downloads.s3.amazonaws.com/v0.16.2-gitlab.19/docker-machine-Darwin-x86_64"
chmod +x docker-machine

NOTE: Be sure to download the correct binary for your system.

  1. Provision a Linode machine:
# NOTE: docker-machine-driver-linode will be automatically resolved from path
./docker-machine create -d linode linode
  1. Ensure the Linode machine provisions as expected.

Testing Rancher Compatibility

NOTE: This should be done in a secure dev VM with restricted access to ports 22, 80 and 443. All other ports must be open to enable connectivity between nodes and the deployed Rancher instance. See the development-instance tool in dx-devenv for more details

Prerequisites:

  • Docker
  • Go
  • Make
  1. Clone and build this branch of docker-machine-driver-linode:
git clone https://github.com/lgarber-akamai/docker-machine-driver-linode.git --branch fix/use-gitlab-docker-machine
  1. Build docker-machine-driver-linode:
# NOTE: cgo must be disabled because the Rancher container does not support glibc.
CGO_ENABLED=0 make build
  1. Provision a Rancher container:
sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged --name rancher rancher/rancher
  1. Copy the built docker-machine-driver-linode binary into the running Rancher container:
docker cp ./out/docker-machine-driver-linode rancher:/opt/drivers/management-state/bin/docker-machine-driver-linode
  1. Navigate to the VM's IP in your browser and finish the Rancher setup process.
  2. Attempt to create an RKE1 (not RKE2) Linode cluster.
  3. Ensure the cluster provisions as expected.

@lgarber-akamai lgarber-akamai added the bugfix for any bug fixes in the changelog. label Aug 2, 2024
@lgarber-akamai lgarber-akamai marked this pull request as ready for review August 2, 2024 17:49
@lgarber-akamai lgarber-akamai requested a review from a team as a code owner August 2, 2024 17:49
@lgarber-akamai lgarber-akamai requested review from yec-akamai and ezilber-akamai and removed request for a team August 2, 2024 17:49
@lgarber-akamai lgarber-akamai added dependencies dependency updates usually from dependabot and removed bugfix for any bug fixes in the changelog. labels Aug 2, 2024
@lgarber-akamai lgarber-akamai changed the title fix: Use GitLab-maintained docker-machine package dep: Use GitLab-maintained docker-machine package Aug 2, 2024
Copy link
Contributor

@ezilber-akamai ezilber-akamai left a comment

Choose a reason for hiding this comment

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

Everything is working properly. Great work!

Copy link

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

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

Nice work!

@lgarber-akamai lgarber-akamai merged commit e7f3b6c into linode:main Aug 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies dependency updates usually from dependabot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants