Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default values for required fields in artifacthub-pkg #555

Conversation

ctcarrier
Copy link
Contributor

Description

This PR fixes a bug where the artifacthub-pkg generated during export of an OCI archive would be missing required fields. This adds default values if the value in the catalogData is empty. With this change a user can export an OCI and extract the artifacthub-pkg and drop it right into an ArtifactHub repo.

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Copy link

welcome bot commented Aug 9, 2024

Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, please review the Layer5 Community Welcome Guide and sure to join the community Slack.
Be sure to double-check that you have signed your commits. Here are instructions for making signing an implicit activity while peforming a commit.

"github.com/layer5io/meshkit/models/catalog/v1alpha1"
)

func BuildArtifactHubPkg(name, downloadURL, user, version, createdAt string, catalogData *v1alpha1.CatalogData) *ArtifactHubMetadata {
artifacthubPkg := &ArtifactHubMetadata{
Name: toKebabCase(name),
DisplayName: name,
Description: catalogData.PatternInfo,
Description: valueOrElse(catalogData.PatternInfo, "A Meshery Design"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really helpful. 👏

@hamza-mohd
Copy link
Contributor

Merge conflict eliminated.

@hamza-mohd hamza-mohd merged commit 9c6bfaf into meshery:master Aug 21, 2024
2 of 4 checks passed
Copy link

welcome bot commented Aug 21, 2024

Thanks for your contribution to Meshery! 🎉

Shows a black logo in light color mode and a white one in dark color mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants