Carry collection selections through configuration
This commit is contained in:
@@ -25,10 +25,24 @@ type ReferenceBinding struct {
|
||||
LaneID string `json:"lane_id,omitempty"`
|
||||
SlotName string `json:"slot_name"`
|
||||
Source string `json:"source,omitempty"`
|
||||
Collections []string `json:"collections,omitempty"`
|
||||
Artifact *ArtifactReference `json:"artifact,omitempty"`
|
||||
BindingSource string `json:"binding_source,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON preserves the distinction between default and empty selections.
|
||||
func (binding ReferenceBinding) MarshalJSON() ([]byte, error) {
|
||||
type bindingFields ReferenceBinding
|
||||
var collections *[]string
|
||||
if binding.Collections != nil {
|
||||
collections = &binding.Collections
|
||||
}
|
||||
return json.Marshal(struct {
|
||||
bindingFields
|
||||
Collections *[]string `json:"collections,omitempty"`
|
||||
}{bindingFields: bindingFields(binding), Collections: collections})
|
||||
}
|
||||
|
||||
type ReferenceUnbind struct {
|
||||
Stage ModuleStage `json:"stage,omitempty"`
|
||||
LaneID string `json:"lane_id,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user