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

Match Fleet server version with fleetctl version #45

Merged
merged 3 commits into from
Aug 13, 2024
Merged

Match Fleet server version with fleetctl version #45

merged 3 commits into from
Aug 13, 2024

Conversation

ninxsoft
Copy link
Contributor

@ninxsoft ninxsoft commented Aug 13, 2024

The provided GitHub Actions workflow currently installs the latest version of fleetctl during each run, which can result in the workflow failing if this version does not match the server version you are targeting.

Here is an excerpt from an internal workflow run that failed to complete - the server version 4.54.1 was not aware of a key that was added in fleetctl version 4.55.0:

...
Warning: Version mismatch.
Client Version:   4.55.0
Server Version:  4.54.1
Error: applying fleet config: PATCH /api/latest/fleet/config received status 400 Bad Request: unsupported key provided: "ios_updates"
...

This PR attempts to correct this by determining the Fleet server-side version via the /api/v1/fleet/version endpoint, and installing the correlating version of fleetctl during the GitHub workflow run.

Assumptions:

  • curl - the workflow is configured to run on the ubuntu-latest GitHub runner image which has this dependency installed
  • jq - the workflow is configured to run on the ubuntu-latest GitHub runner image which has this dependency installed

@ninxsoft ninxsoft requested a review from noahtalerman as a code owner August 13, 2024 01:14
Copy link
Member

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

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

Great idea!

Thanks for the contribution, left a comment.

.github/gitops-action/action.yml Outdated Show resolved Hide resolved
Copy link
Member

@getvictor getvictor left a comment

Choose a reason for hiding this comment

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

LGTM

@getvictor getvictor merged commit 698bce2 into fleetdm:main Aug 13, 2024
1 check failed
@ninxsoft ninxsoft deleted the ninxsoft/fleetctl-versions-should-match branch August 13, 2024 13:54
@noahtalerman
Copy link
Member

Thanks @ninxsoft!

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

Successfully merging this pull request may close these issues.

4 participants