Improve approach to valid cases where some data is empty from charmhub

Bug #2020191 reported by Heather Lanigan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
High
Unassigned

Bug Description

Rather than guard against potential bad data when we unmarshal charmhub responses, solve the problem where the data is received.

Example core/charm/repository/charmhub.go:

 // NOTE: Charmhub returns a "{}\n" when no config.yaml exists for
 // the charm, e.g. postgreql. However, this will fail the charm
 // config validation which happens in ReadConfig. Valid config
 // are nil and "Options: {}"
 if configYAML != "" || strings.TrimSpace(configYAML) == "{}" {
  chConfig, err = charm.ReadConfig(strings.NewReader(configYAML))
  if err != nil {
   return corecharm.EssentialMetadata{}, errors.Annotatef(err, "parsing config.yaml for %q", curl)
  }
 }

Tags: tech-debt
Changed in juju:
milestone: 2.9.44 → 2.9.45
Changed in juju:
milestone: 2.9.45 → 2.9.46
Revision history for this message
Ian Booth (wallyworld) wrote :

The next 2.9.46 candidate release will not include a fix for this bug and we don't plan on any more 2.9 releases. As such it is being removed from its 2.9 milestone.

If the bug is still important to you, let us know and we can consider it for inclusion on a 3.x milestone.

Changed in juju:
milestone: 2.9.46 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.