Skip to content

Commit

Permalink
Updates unit BSON document to store CharmURL as a string pointer instead
Browse files Browse the repository at this point in the history
of *charm.URL.

There is an overhead for parsing the stored URL, which we are paying
whether we access it or not.
  • Loading branch information
manadart committed Dec 6, 2021
1 parent f346023 commit d5b2ff0
Show file tree
Hide file tree
Showing 24 changed files with 229 additions and 165 deletions.
3 changes: 0 additions & 3 deletions api/uniter/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,6 @@ func (u *Unit) ClosePorts(protocol string, fromPort, toPort int) error {
var ErrNoCharmURLSet = errors.New("unit has no charm url set")

// CharmURL returns the charm URL this unit is currently using.
//
// NOTE: This differs from state.Unit.CharmURL() by returning
// an error instead of a bool, because it needs to make an API call.
func (u *Unit) CharmURL() (*charm.URL, error) {
var results params.StringBoolResults
args := params.Entities{
Expand Down
55 changes: 28 additions & 27 deletions apiserver/facades/agent/uniter/mocks/lxdprofile.go

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

Loading

0 comments on commit d5b2ff0

Please sign in to comment.