Skip to content

controllers: store HelmChart Artifact with suffix #611

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions controllers/helmchart_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,11 +626,11 @@ func (r *HelmChartReconciler) reconcileArtifact(ctx context.Context, obj *source
}()

// Create artifact from build data
artifact := r.Storage.NewArtifactFor(obj.Kind, obj.GetObjectMeta(), b.Version, fmt.Sprintf("%s-%s.tgz", b.Name, b.Version))
artifact := r.Storage.NewArtifactFor(obj.Kind, obj.GetObjectMeta(), b.Version, fmt.Sprintf("%s-%s-%d.tgz", b.Name, b.Version, time.Now().Unix()))
Copy link
Member

Choose a reason for hiding this comment

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

This will break signature verification for cached charts (ref: #605). The chart name should be exactly how it's mentioned in it's provenance file, i.e. name-version.tgz. We could probably get around this by adding a symlink linking name-version-ts.tgz to name-version.tgz.

Copy link
Member Author

Choose a reason for hiding this comment

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

Was afraid this would be the case. Ack, I'll give it another shot when #605 is merged to get a better view on the options available then.

Copy link
Member

@aryan9600 aryan9600 Apr 7, 2022

Choose a reason for hiding this comment

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

We should go ahead and merge this now, because of: #605 (comment)

Converting PR to draft, as this is being put on hold until we reach GA (ref: fluxcd/flux2#2592)

Copy link
Member Author

Choose a reason for hiding this comment

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

I would rather like to come up with a solution first that works for #605, as otherwise we're shooting ourselves in the foot with premeditation.

Copy link
Member

@aryan9600 aryan9600 Apr 19, 2022

Choose a reason for hiding this comment

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

We could modify #605 such that we make a copy of the packaged chart file named <name>-<version>.tgz and use that copy for sig verification and delete it after the verification process is completed. I can't think of any drawbacks for this approach @hiddeco, what do you think?


// Return early if the build path equals the current artifact path
if curArtifact := obj.GetArtifact(); curArtifact != nil && r.Storage.LocalPath(*curArtifact) == b.Path {
ctrl.LoggerFrom(ctx).Info("artifact up-to-date", "revision", artifact.Revision)
ctrl.LoggerFrom(ctx).Info("artifact up-to-date", "revision", curArtifact.Revision)
return sreconcile.ResultSuccess, nil
}

Expand Down