diff --git a/converter/k8s.go b/converter/k8s.go index 7d87c3fb..10c776ca 100644 --- a/converter/k8s.go +++ b/converter/k8s.go @@ -17,6 +17,8 @@ func (k *K8sConverter) Convert(patternFile string) (string, error) { if err != nil { return "", err } + + patterns.ProcessAnnotations(pattern) return NewK8sManifestsFromPatternfile(pattern) } diff --git a/models/patterns/pattern.go b/models/patterns/pattern.go index 5b933132..e206a5c7 100644 --- a/models/patterns/pattern.go +++ b/models/patterns/pattern.go @@ -4,6 +4,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/layer5io/meshkit/encoding" "github.com/layer5io/meshkit/utils" + "github.com/meshery/schemas/models/v1beta1/component" "github.com/meshery/schemas/models/v1beta1/pattern" ) @@ -36,3 +37,13 @@ func GetPatternFormat(patternFile string) (*pattern.PatternFile, error) { } return &pattern, nil } + +func ProcessAnnotations(pattern *pattern.PatternFile) { + components := []*component.ComponentDefinition{} + for _, component := range pattern.Components { + if !component.Metadata.IsAnnotation { + components = append(components, component) + } + } + pattern.Components = components +}