Skip to content

Commit

Permalink
fix nil pointer exception (gardener#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianburth authored Feb 2, 2024
1 parent 27afeed commit eec71fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/guided-tour/blueprints/helm-chart-resource/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Using this oci reference, the landscaper is able to fetch the helm chart and dep
## Referencing the Helm Chart with a Component
>**_CAUTION_**: Specifying the *Repository Context* directly in the *Installation* is **deprecated**. In order to be able to
> use this feature, the *Repository Context* has to be specified in the Landscaper *[Context](../../../usage/Context.md)*.
In the [previous section](../external-blueprint/README.md), the concept of components was introduced, as an alternative
means to reference the blueprints in the installation instead of having to write the blueprints directly inline into the
installation (as it was done in the [first several examples](../../hello-world/installation/installation.yaml)).
Expand Down
8 changes: 8 additions & 0 deletions pkg/deployer/helm/chartresolver/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ func getChartFromResourceRef(ctx context.Context, resourceRef string, lsCtx *lsv

octx := ocm.New(datacontext.MODE_EXTENDED)

if lsCtx == nil {
return nil, fmt.Errorf("landscaper context cannot be nil")
}
if lsCtx.RepositoryContext == nil || lsCtx.RepositoryContext.Raw == nil {
return nil, fmt.Errorf("landscaper context %s/%s does not specify a repository context but has"+
" to specify a repository context to resolve resource from an ocm reference", lsCtx.Namespace, lsCtx.Name)
}

// Credential Handling
// resolve all credentials from registry pull secrets
registryPullSecretRefs := lib.GetRegistryPullSecretsFromContext(lsCtx)
Expand Down

0 comments on commit eec71fe

Please sign in to comment.