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

Install CNI Refactor #97

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bcheung
Copy link
Contributor

@bcheung bcheung commented Aug 21, 2020

Fixes #33 and #93

  • Created an internal directory that holds the interfaces and mock testing tools for system/platform related dependencies (iptables, http requests, systctl etc.). This decouples the implementation logic from these dependencies so that the code is more unit-testable.
  • Rewrote the install-cni.sh script in Golang and added unit tests for each plugin installer.

install-cni structure:

  • The structure of install-cni program decouples the process (cmd/install-cni/main.go) from the root command (pkg/install-cni/cmd/root.go) and its related packages. The root command is where the binary gets all the environment variables and calls the CNIInstaller in pkg/install-cni/install.
  • The CNI installer is where the script logic/flow is implemented and runs the plugin installers.
  • The plugins are designed to be decoupled from each other and each plugin implements an Installer interface that requires a Run() function.

The last commit marks the remaining TODO items.

Note: These changes need to be tested with integration tests to ensure that it works with the internal GKE codebase.

@k8s-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign varunmar
You can assign the PR to them by writing /assign @varunmar in a comment when ready.

The full list of commands accepted by this bot can be found 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert scripts/install-cni.sh to a golang
2 participants