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

feat: add 'dev tofu-create' command to build bundles from a uds-bundle.tf config #1060

Open
wants to merge 5 commits into
base: uds-tofu
Choose a base branch
from

Conversation

YrrepNoj
Copy link
Member

Description

Parses uds-bundle.tf files and generates a uds-bundle-fake-metadata-0.0.0.tar.zst tarball bundle.

There is (a lot) more work that will need to be implemented to ensure full feature parity with the standard uds create from a uds-bundle.yaml file, but I believe this PR offers a good starting point.

The changes in this PR add additional config booleans to check against so we do not change the behavior of a standard uds create command.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

😰😬🙈

@YrrepNoj YrrepNoj requested a review from catsby January 23, 2025 23:29
@YrrepNoj YrrepNoj requested a review from a team as a code owner January 23, 2025 23:29
Copy link
Collaborator

@catsby catsby left a comment

Choose a reason for hiding this comment

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

Overall looks solid, great job 👍

return err
}

// Fake metadata for now
Copy link
Collaborator

Choose a reason for hiding this comment

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

still fake?

Description: *tfConfig.Metadata.Description,
}

// Parse each Package resoruce and convert it types.Package type
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Parse each Package resoruce and convert it types.Package type
// Parse each Package resoruce and convert it to types.Package type

@@ -88,6 +120,7 @@ func (b *Bundle) Create() error {
}
}

// TODO: @JPERRY this dev eploy block has not been validated to work with tofu based bundles yet
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// TODO: @JPERRY this dev eploy block has not been validated to work with tofu based bundles yet
// TODO: @JPERRY this dev deploy block has not been validated to work with tofu based bundles yet

Comment on lines +113 to 125
var bundleManifestDesc ocispec.Descriptor
if lo.isTofu {
bundleManifestDesc, err = pushBundleTFToStore(store, filepath.Join(lo.sourceDir, config.BundleTF))
if err != nil {
return err
}
} else {
// push uds-bundle.yaml to OCI store
bundleManifestDesc, err = pushBundleYAMLToStore(store, bundle)
if err != nil {
return err
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: style suggestion

Suggested change
var bundleManifestDesc ocispec.Descriptor
if lo.isTofu {
bundleManifestDesc, err = pushBundleTFToStore(store, filepath.Join(lo.sourceDir, config.BundleTF))
if err != nil {
return err
}
} else {
// push uds-bundle.yaml to OCI store
bundleManifestDesc, err = pushBundleYAMLToStore(store, bundle)
if err != nil {
return err
}
}
var bundleManifestDesc ocispec.Descriptor
if lo.isTofu {
// push uds-bundle.tf to OCI store
bundleManifestDesc, err = pushBundleTFToStore(store, filepath.Join(lo.sourceDir, config.BundleTF))
} else {
// push uds-bundle.yaml to OCI store
bundleManifestDesc, err = pushBundleYAMLToStore(store, bundle)
}
if err != nil {
return err
}

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

Successfully merging this pull request may close these issues.

2 participants