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

package upgrade

import "github.com/juju/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.

type OldPortRangeDoc28 Uses

type OldPortRangeDoc28 struct {
    UnitName string `bson:"unitname"`
    FromPort int    `bson:"fromport"`
    ToPort   int    `bson:"toport"`
    Protocol string `bson:"protocol"`
}

OldPortsDoc28 represents a port range entry document prior to the 2.9 schema changes.

type OldPortsDoc28 Uses

type OldPortsDoc28 struct {
    DocID     string              `bson:"_id"`
    ModelUUID string              `bson:"model-uuid"`
    MachineID string              `bson:"machine-id"`
    SubnetID  string              `bson:"subnet-id"`
    Ports     []OldPortRangeDoc28 `bson:"ports"`
    TxnRevno  int64               `bson:"txn-revno"`
}

OldPortsDoc28 represents a ports document prior to the 2.9 schema changes.

Package upgrade imports 3 packages (graph) and is imported by 2 packages. Updated 2020-09-02. Refresh now. Tools for package owners.