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

Proposal: Allow a way to create an idempotent index.yaml file #11057

Closed
colearendt opened this issue Jun 18, 2022 · 11 comments
Closed

Proposal: Allow a way to create an idempotent index.yaml file #11057

colearendt opened this issue Jun 18, 2022 · 11 comments

Comments

@colearendt
Copy link

colearendt commented Jun 18, 2022

Per discussion here, there is reluctance to depend on filesystem times for chart "created" time.

However, there are other occasions where being able to create an index.yaml file from a set of data that is reliable (i.e. GitHub tags, releases, git logs, etc.). As a result, it would be ideal to have a way to generate the index file in an idempotent fashion.

I believe the only piece of data that is not reproducible is the "created" time. As a result, it would be ideal to have a way to IndexFile.MustAdd() with deterministic input / output (i.e. allow specifying the timestamp). This would allow index file creation to be idempotent downstream, which could improve CI mechanisms, migration to different build systems, and migration to different helm repositories without losing timestamp data.

Relevant code:

helm/pkg/repo/index.go

Lines 120 to 146 in 657850e

func (i IndexFile) MustAdd(md *chart.Metadata, filename, baseURL, digest string) error {
if md.APIVersion == "" {
md.APIVersion = chart.APIVersionV1
}
if err := md.Validate(); err != nil {
return errors.Wrapf(err, "validate failed for %s", filename)
}
u := filename
if baseURL != "" {
_, file := filepath.Split(filename)
var err error
u, err = urlutil.URLJoin(baseURL, file)
if err != nil {
u = path.Join(baseURL, file)
}
}
cr := &ChartVersion{
URLs: []string{u},
Metadata: md,
Digest: digest,
Created: time.Now(),
}
ee := i.Entries[md.Name]
i.Entries[md.Name] = append(ee, cr)
return nil
}

Would a PR implementing such a solution be permissible? What approach would be preferable?

@yxxhero
Copy link
Member

yxxhero commented Jun 19, 2022

@colearendt Can you create a HIP for this feature. Thanks very much.

@colearendt
Copy link
Author

Woops missed that process 😅 Thanks, will do!

@colearendt colearendt changed the title Feature Request: Allow a way to create an idempotent index.yaml file Proposal: Allow a way to create an idempotent index.yaml file Jun 19, 2022
@github-actions
Copy link

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Sep 18, 2022
@colearendt
Copy link
Author

I started a HIP for this - haven't submitted yet

@yxxhero yxxhero removed the Stale label Sep 18, 2022
@github-actions
Copy link

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Dec 18, 2022
@colearendt
Copy link
Author

I started on a HIP for this. Need to finish!

@github-actions github-actions bot removed the Stale label Dec 19, 2022
@github-actions
Copy link

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Mar 19, 2023
@colearendt
Copy link
Author

Grr. My HIP is stagnant. Still hoping to get back to this 🙈

@github-actions github-actions bot removed the Stale label Mar 20, 2023
@github-actions
Copy link

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Jun 18, 2023
@colearendt
Copy link
Author

Still hoping to get back here

@github-actions github-actions bot removed the Stale label Jun 19, 2023
@github-actions
Copy link

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

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

No branches or pull requests

2 participants