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

contract: change default value of lastAttachment so server doesn't try to parse empty string #2682

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

orndorffgrant
Copy link
Collaborator

Why is this needed?

Machines attached with a pro version <=28.1 don't have a lastAttachment time. The fallback value of "" was trying to be parsed by the contract server, which resulted in errors. The new fallback value of None is treated as nil by the backend and isn't parsed.

Test Steps

env SHELL_BEFORE=1 ./tools/test-in-lxd.sh xenial
apt update
apt install ubuntu-advantage-tools
pro attach $token
exit # new version gets installed after exit and lxc shell is re-started
sudo pro disable esm-infra
# Before this PR: you'd get an error here
# With this PR: this should succeed

Checklist

  • [n/a] I have updated or added any unit tests accordingly
  • [n/a] I have updated or added any integration tests accordingly
  • [n/a] Changes here need to be documented, and this was done in:

Does this PR require extra reviews?

  • Yes
  • No

@orndorffgrant
Copy link
Collaborator Author

@TeodorPt FYI

@github-actions
Copy link

Jira: This PR is not related to a Jira item. (The PR title does not include a SC-#### reference)

GitHub Issues: No GitHub issues are fixed by this PR. (No commits have Fixes: #### references)

Launchpad Bugs: No Launchpad bugs are fixed by this PR. (No commits have LP: #### references)

Documentation: The changes in this PR do not require documentation changes.

👍 this comment to confirm that this is correct.

Copy link
Member

@renanrodrigo renanrodrigo left a comment

Choose a reason for hiding this comment

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

dis good

@orndorffgrant
Copy link
Collaborator Author

CI fails unrelated

@orndorffgrant orndorffgrant merged commit c50bdba into main Jul 31, 2023
21 of 23 checks passed
@orndorffgrant orndorffgrant deleted the fix-contract-lastattachment-default branch July 31, 2023 22:03
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.

2 participants