Skip to content

Introduce ExtensionFeatureMetadata struct #306

@kkk777-7

Description

@kkk777-7

What would you like to be added:
Introduce ExtensionFeatureMetadata struct.

type ExtensionFeatureMetadata struct {
	emitted bool
	source *ExtensionFeatureSource
}

type ExtensionFeatureSource struct {
	IngressNN     types.NamespacedName
	AnnotationKey []string
}

func (m *ExtensionFeatureMetadata) SetEmitted() {
	m.emitted = true
}
func (m *ExtensionFeatureMetadata) IsEmitted() bool {
	return m.emitted
}
func (m *ExtensionFeatureMetadata) GetSource() *ExtensionFeatureSource {
	return m.source
}
func (m *ExtensionFeatureMetadata) SetSource(source *ExtensionFeatureSource) {
	m.source = source
}

Why this is needed:
currently, we're implementing extension features, like below

It’s unclear which emitter should apply the extensions.
so, we should append metadata into extensions to handle correctly.

Each extension embeds the metadata above in the struct, allowing the emitter to tell that it has already been processed.

e.g.

type BodySize struct {
    ExtensionFeatureMetadata
	BufferSize *resource.Quantity
	MaxSize    *resource.Quantity
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions