Skip to content

Commit

Permalink
ENG-8624 fix operating_system_version/operating_system mismatch (tink…
Browse files Browse the repository at this point in the history
…erbell#275)

Signed-off-by: Kelly Deng <kelly@packet.com>

## Description

<!--- Please describe what this PR is going to change -->
This PR fixes the mismatch in field names [`operating_system_version`](https://github.com/tinkerbell/tink/blob/master/protos/packet/packet.proto#L86) vs [`operating_system`](https://github.com/tinkerbell/hegel/blob/a3138d417536903dcdedd674d634e13ebc19fc79/http_handlers.go#L33).

## Why is this needed
This bug mainly affects the users who needs both the `packet.pb.go` and the EC2 endpoint. Because the EC2 endpoint in Hegel uses the field name `operating_system` to be backwards compatible with Kant, users using the `Metadata` object defined in `packet.pb.go` will face a problem with parsing the operating system field since it was defined as `operating_system_version` there. 
The reason for the mismatch is because in the "old" cacher mode, `operating_system_version`, but Kant uses `operating_system` (which we have to be backwards compatible with) so we decided move away from `operating_system_version` and go with `operating_system` for "tink mode".
A user could have worked around this by specifying two fields `operating_system` and `operating_system_version` with the same value, inside the same piece of hardware, but this introduces some redundancy and just isn't ideal.

Related PR: tinkerbell/smee#104

<!--- Link to issue you have raised -->

Fixes: #

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

To be manually tested

## How are existing users impacted? What migration steps/scripts do we need?

<!--- Fixes a bug, unblocks installation, removes a component of the stack etc -->
<!--- Requires a DB migration script, etc. -->

Existing users who import the `packet.pb.go` will have to `go get` latest master of the tink repo.

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
  • Loading branch information
mergify[bot] authored Dec 4, 2020
2 parents 86057d3 + df9951b commit fe762e8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
57 changes: 28 additions & 29 deletions protos/packet/packet.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protos/packet/packet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ message Metadata {
bool allow_pxe = 4;
bool rescue = 5;

OperatingSystem operating_system_version = 6;
OperatingSystem operating_system = 6;
bool always_pxe = 7;
string ipxe_script_url = 8;
repeated IP ips = 9;
Expand Down

0 comments on commit fe762e8

Please sign in to comment.