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)
|
options = new(ContainerTargetOptions)
|
||||||
case TargetNameWorkerServer:
|
case TargetNameWorkerServer:
|
||||||
options = new(WorkerServerTargetOptions)
|
options = new(WorkerServerTargetOptions)
|
||||||
|
case TargetNamePulpOSTree:
|
||||||
|
options = new(PulpOSTreeTargetOptions)
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unexpected target name: %s", rawTarget.Name)
|
return fmt.Errorf("unexpected target name: %s", rawTarget.Name)
|
||||||
}
|
}
|
||||||
|
|
@ -278,6 +280,10 @@ func (target Target) MarshalJSON() ([]byte, error) {
|
||||||
// the incompatible change.
|
// the incompatible change.
|
||||||
rawOptions, err = json.Marshal(target.Options)
|
rawOptions, err = json.Marshal(target.Options)
|
||||||
|
|
||||||
|
case *PulpOSTreeTargetOptions:
|
||||||
|
// added after incompatibility change
|
||||||
|
rawOptions, err = json.Marshal(target.Options)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unexpected target options type: %t", t)
|
return nil, fmt.Errorf("unexpected target options type: %t", t)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,8 @@ func UnmarshalTargetResultOptions(trName TargetName, rawOptions json.RawMessage)
|
||||||
options = new(OCIObjectStorageTargetResultOptions)
|
options = new(OCIObjectStorageTargetResultOptions)
|
||||||
case TargetNameContainer:
|
case TargetNameContainer:
|
||||||
options = new(ContainerTargetResultOptions)
|
options = new(ContainerTargetResultOptions)
|
||||||
|
case TargetNamePulpOSTree:
|
||||||
|
options = new(PulpOSTreeTargetResultOptions)
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unexpected target result name: %s", trName)
|
return nil, fmt.Errorf("unexpected target result name: %s", trName)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue