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

Add airGappedChecksum field to check workload version before rollout #319

Merged

Conversation

Danil-Grigorev
Copy link
Contributor

@Danil-Grigorev Danil-Grigorev commented May 10, 2024

What this PR does / why we need it:
This change adds AirGappedChecksum field to agent config. By using this field, a user might declare expected sha256sum checksum for the air gapped manifests and prevent incomplete or different package installation on the host.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #297
Depends on #313 for fuzzy test changes to make CI green

Special notes for your reviewer:

Internals of the curl -sfL https://get.rke2.io in the air-gapped mode already verify the contents of provided tar files based on the checksum from sha256sum-<arch>.txt. Therefore the AirGappedChecksum declares the expected checksum for this file only to connect API definition with the prepared host pre-bootstrap state.

Checklist:

  • squashed commits into logical changes
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@Danil-Grigorev Danil-Grigorev added kind/feature New feature or request area/api Indicates an issue or PR relates to the APIs labels May 10, 2024
@Danil-Grigorev Danil-Grigorev self-assigned this May 10, 2024
Copy link
Member

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

thanks, looks good just one small comment

// AirGappedChecksum is a string value with a sha256sum checksum to compare with checksum
// of existing sha256sum-<arch>.txt file for packages already available on the machine
// before performing air-gapped installation.
AirGappedChecksum string `json:"airGappedChecksum,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

can we make this field optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was blocked on #313 for fuzzy testing, so I was only able to add generated manifests, make the field optional and backward value recovery after it got merged. This should be ready for review.

@salasberryfin
Copy link
Contributor

LGTM pending fixing CI checks and resolving @alexander-demicev's comment.

Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
@Danil-Grigorev Danil-Grigorev merged commit ceab8cc into rancher:main May 14, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates an issue or PR relates to the APIs kind/feature New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

in airGapped mode, ensure that the desired k8s version is used
3 participants