Skip to content

Commit

Permalink
addressing review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Soule BA <[email protected]>
  • Loading branch information
souleb committed Oct 21, 2022
1 parent 5355fb3 commit 25673ac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion controllers/helmchart_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ func (r *HelmChartReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
summarizeHelper := summarize.NewHelper(r.EventRecorder, patchHelper)
summarizeOpts := []summarize.Option{
summarize.WithConditions(helmChartReadyCondition),
summarize.WithBiPolarityConditionTypes(sourcev1.SourceVerifiedCondition),
summarize.WithReconcileResult(recResult),
summarize.WithReconcileError(retErr),
summarize.WithIgnoreNotFound(),
Expand Down Expand Up @@ -648,7 +649,7 @@ func (r *HelmChartReconciler) buildFromHelmRepository(ctx context.Context, obj *
ValuesFiles: obj.GetValuesFiles(),
Force: obj.Generation != obj.Status.ObservedGeneration,
// The remote builder will not attempt to download the chart if
// an artifact exist with the same name and version and the force is false.
// an artifact exists with the same name and version and `Force` is false.
// It will try to verify the chart if:
// - we are on the first reconciliation
// - the HelmChart spec has changed (generation drift)
Expand Down
10 changes: 6 additions & 4 deletions internal/helm/registry/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func KeychainAdaptHelper(keyChain authn.Keychain) func(string) (registry.LoginOp
if err != nil {
return nil, fmt.Errorf("unable to parse registry URL '%s'", registryURL)
}
authenticator, err := keyChain.Resolve(resource{parsedURL.Host})
authenticator, err := keyChain.Resolve(stringResource{parsedURL.Host})
if err != nil {
return nil, fmt.Errorf("unable to resolve credentials for registry '%s': %w", registryURL, err)
}
Expand Down Expand Up @@ -126,14 +126,16 @@ func AuthAdaptHelper(auth authn.Authenticator) (registry.LoginOption, error) {
return registry.LoginOptBasicAuth(username, password), nil
}

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

func (r resource) String() string {
func (r stringResource) String() string {
return r.registry
}

func (r resource) RegistryStr() string {
func (r stringResource) RegistryStr() string {
return r.registry
}
2 changes: 1 addition & 1 deletion internal/helm/repository/chart_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,5 +528,5 @@ func (r *ChartRepository) RemoveCache() error {
func (r *ChartRepository) VerifyChart(_ context.Context, _ *repo.ChartVersion) error {
// no-op
// this is a no-op because this is not implemented yet.
return nil
return fmt.Errorf("not implemented")
}
2 changes: 1 addition & 1 deletion internal/oci/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type options struct {
ROpt []remote.Option
}

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

// WithPublicKey sets the public key.
Expand Down

0 comments on commit 25673ac

Please sign in to comment.