juju: github.com/wallyworld/juju/state/upgrade Index | Files

package upgrade

import "github.com/wallyworld/juju/state/upgrade"

Index

Package Files

types.go

type OldAddress27 Uses

type OldAddress27 struct {
    Value       string `bson:"value"`
    AddressType string `bson:"addresstype"`
    Scope       string `bson:"networkscope,omitempty"`
    Origin      string `bson:"origin,omitempty"`
    SpaceName   string `bson:"spacename,omitempty"`
    SpaceID     string `bson:"spaceid,omitempty"`
}

OldAddress27 represents the address stored prior to version 2.7 in the collections: machines, cloudservices and cloudcontainers. Note that we can reuse this type for the new form because: - `omitempty` on SpaceName means we can set it as "" to remove. - The bson field `spaceid` is the same for the old SpaceProviderId.

and the new SpaceID.

func (OldAddress27) Upgrade Uses

func (a OldAddress27) Upgrade(lookup network.SpaceInfos) (OldAddress27, error)

Upgrade accepts an address and a name-to-ID space lookup and returns a new address representation based on whether space name/ID are populated. An error is returned if the address has a non-empty space name that we cannot map to an ID.

Package upgrade imports 3 packages (graph). Updated 2020-02-18. Refresh now. Tools for package owners.