Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

bug: do not reset runner profile default if flag not specified #3702

Merged
merged 3 commits into from
Aug 18, 2022

Conversation

izaaklauer
Copy link
Contributor

@izaaklauer izaaklauer commented Aug 17, 2022

This fixes a bug wherein if the default flag was not specified, waypoint would set default to false.

Bug behavior:

$ waypoint runner profile list
Runner profiles
         NAME        | PLUGIN TYPE |                   OCI URL                   |               TARGET RUNNER               | DEFAULT  
---------------------+-------------+---------------------------------------------+-------------------------------------------+----------
  docker             | docker      | hashicorp/waypoint-odr:latest               | *                                         | yes      

$ waypoint runner profile set -name=docker -plugin-type=docker -oci-url=hashicorp/waypoint-odr:latest

$ waypoint runner profile list
Runner profiles
         NAME        | PLUGIN TYPE |                   OCI URL                   |               TARGET RUNNER               | DEFAULT  
---------------------+-------------+---------------------------------------------+-------------------------------------------+----------
  docker             | docker      | hashicorp/waypoint-odr:latest               | *                                         |          

Notice I did not tell it to stop defaulting that profile, yet it's no longer the default

New behavior:

$ waypoint runner profile list
Runner profiles
         NAME        | PLUGIN TYPE |                   OCI URL                   |               TARGET RUNNER               | DEFAULT  
---------------------+-------------+---------------------------------------------+-------------------------------------------+----------
  docker             | docker      | hashicorp/waypoint-odr:latest               | *                                         | yes      

$ waypoint runner profile set -name=docker -plugin-type=docker -oci-url=hashicorp/waypoint-odr:latest

$ waypoint runner profile list
Runner profiles
         NAME        | PLUGIN TYPE |                   OCI URL                   |               TARGET RUNNER               | DEFAULT  
---------------------+-------------+---------------------------------------------+-------------------------------------------+----------
  docker             | docker      | hashicorp/waypoint-odr:latest               | *                                         | yes         

Thanks to @benedikt for the bug report

@izaaklauer izaaklauer added the backport/0.9.x Automerge PR into release/0.9.x branch after merge to main label Aug 17, 2022
@github-actions github-actions bot added the core label Aug 17, 2022
Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

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

Looks good! You gotta re-gen the website markdown but otherwise this looks good to go 🚀

Name: "default",
Target: &c.flagDefault,
Default: false,
f.BoolPtrVar(&flag.BoolPtrVar{
Copy link
Contributor

Choose a reason for hiding this comment

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

yay BoolPtrVar comes in handy again 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/0.9.x Automerge PR into release/0.9.x branch after merge to main core website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants