Skip to content

apb.Spec cannot serialize to valid apb.yml file #47

@mhrivnak

Description

@mhrivnak

For two primary reasons, when using the apb.Spec type, you cannot serialize it to YAML and use that as contents for a valid apb.yml file.

Missing Name

The Name field is missing from the struct, but it is an important field. It would need to be added.

Contains non-spec data

The following fields are not part of the spec, but they are contained in this type.

FQName - this is generated based on the name of the image and the registry it was found in when discovered by a registry adapter
id - this is generated by the broker after discovery
runtime - this is part of a separate label and is not part of the APB specification

It seems like this struct is really a combination of two different types of data. It might make sense to separate them. There would be:

  1. Spec - a service bundle spec. Nothing less, nothing more.
  2. Other data from the discovery process.

The "other data" is sort of like an envelope. Maybe something like this would be appropriate?

type DiscoveredSpec struct {
	Spec    *apb.Spec
	FQName  string
	ID      string
	Runtime int
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions