Skip to content

Commit

Permalink
Merge pull request #594 from MUzairS15/update-converter
Browse files Browse the repository at this point in the history
remove annotations before converting to manifests
  • Loading branch information
Mohd Uzair authored Sep 23, 2024
2 parents 4abc81b + 66ee76b commit 7b4737d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions converter/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ func (k *K8sConverter) Convert(patternFile string) (string, error) {
if err != nil {
return "", err
}

patterns.ProcessAnnotations(pattern)
return NewK8sManifestsFromPatternfile(pattern)
}

Expand Down
11 changes: 11 additions & 0 deletions models/patterns/pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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
}

0 comments on commit 7b4737d

Please sign in to comment.