target: add the pulp.ostree target to the marshal functions
This commit is contained in:
parent
ab659c013c
commit
503fbfb312
2 changed files with 8 additions and 0 deletions
|
|
@ -93,6 +93,8 @@ func (target *Target) UnmarshalJSON(data []byte) error {
|
|||
options = new(ContainerTargetOptions)
|
||||
case TargetNameWorkerServer:
|
||||
options = new(WorkerServerTargetOptions)
|
||||
case TargetNamePulpOSTree:
|
||||
options = new(PulpOSTreeTargetOptions)
|
||||
default:
|
||||
return fmt.Errorf("unexpected target name: %s", rawTarget.Name)
|
||||
}
|
||||
|
|
@ -278,6 +280,10 @@ func (target Target) MarshalJSON() ([]byte, error) {
|
|||
// the incompatible change.
|
||||
rawOptions, err = json.Marshal(target.Options)
|
||||
|
||||
case *PulpOSTreeTargetOptions:
|
||||
// added after incompatibility change
|
||||
rawOptions, err = json.Marshal(target.Options)
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unexpected target options type: %t", t)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ func UnmarshalTargetResultOptions(trName TargetName, rawOptions json.RawMessage)
|
|||
options = new(OCIObjectStorageTargetResultOptions)
|
||||
case TargetNameContainer:
|
||||
options = new(ContainerTargetResultOptions)
|
||||
case TargetNamePulpOSTree:
|
||||
options = new(PulpOSTreeTargetResultOptions)
|
||||
default:
|
||||
return nil, fmt.Errorf("unexpected target result name: %s", trName)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue