Skip to content

Commit 25673ac

Browse files
committed
addressing review comments
Signed-off-by: Soule BA <[email protected]>
1 parent 5355fb3 commit 25673ac

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

controllers/helmchart_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ func (r *HelmChartReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
214214
summarizeHelper := summarize.NewHelper(r.EventRecorder, patchHelper)
215215
summarizeOpts := []summarize.Option{
216216
summarize.WithConditions(helmChartReadyCondition),
217+
summarize.WithBiPolarityConditionTypes(sourcev1.SourceVerifiedCondition),
217218
summarize.WithReconcileResult(recResult),
218219
summarize.WithReconcileError(retErr),
219220
summarize.WithIgnoreNotFound(),
@@ -648,7 +649,7 @@ func (r *HelmChartReconciler) buildFromHelmRepository(ctx context.Context, obj *
648649
ValuesFiles: obj.GetValuesFiles(),
649650
Force: obj.Generation != obj.Status.ObservedGeneration,
650651
// The remote builder will not attempt to download the chart if
651-
// an artifact exist with the same name and version and the force is false.
652+
// an artifact exists with the same name and version and `Force` is false.
652653
// It will try to verify the chart if:
653654
// - we are on the first reconciliation
654655
// - the HelmChart spec has changed (generation drift)

internal/helm/registry/auth.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func KeychainAdaptHelper(keyChain authn.Keychain) func(string) (registry.LoginOp
9595
if err != nil {
9696
return nil, fmt.Errorf("unable to parse registry URL '%s'", registryURL)
9797
}
98-
authenticator, err := keyChain.Resolve(resource{parsedURL.Host})
98+
authenticator, err := keyChain.Resolve(stringResource{parsedURL.Host})
9999
if err != nil {
100100
return nil, fmt.Errorf("unable to resolve credentials for registry '%s': %w", registryURL, err)
101101
}
@@ -126,14 +126,16 @@ func AuthAdaptHelper(auth authn.Authenticator) (registry.LoginOption, error) {
126126
return registry.LoginOptBasicAuth(username, password), nil
127127
}
128128

129-
type resource struct {
129+
// stringResource is there to satisfy the github.com/google/go-containerregistry/pkg/authn.Resource interface.
130+
// It merely wraps a given string and returns it for all of the interface's methods.
131+
type stringResource struct {
130132
registry string
131133
}
132134

133-
func (r resource) String() string {
135+
func (r stringResource) String() string {
134136
return r.registry
135137
}
136138

137-
func (r resource) RegistryStr() string {
139+
func (r stringResource) RegistryStr() string {
138140
return r.registry
139141
}

internal/helm/repository/chart_repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,5 +528,5 @@ func (r *ChartRepository) RemoveCache() error {
528528
func (r *ChartRepository) VerifyChart(_ context.Context, _ *repo.ChartVersion) error {
529529
// no-op
530530
// this is a no-op because this is not implemented yet.
531-
return nil
531+
return fmt.Errorf("not implemented")
532532
}

internal/oci/verifier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type options struct {
4545
ROpt []remote.Option
4646
}
4747

48-
// Options is a function that configures the options applied to a CosignVerifier.
48+
// Options is a function that configures the options applied to a Verifier.
4949
type Options func(opts *options)
5050

5151
// WithPublicKey sets the public key.

0 commit comments

Comments
 (0)