-
Notifications
You must be signed in to change notification settings - Fork 50
/
registry.go
28 lines (23 loc) · 876 Bytes
/
registry.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package registry
import (
"context"
"fmt"
"io/fs"
"helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/chartutil"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/provisioner/plain"
"github.com/operator-framework/rukpak/pkg/convert"
)
const (
// ProvisionerID is the unique registry provisioner ID
ProvisionerID = "core-rukpak-io-registry"
)
func HandleBundleDeployment(ctx context.Context, fsys fs.FS, bd *rukpakv1alpha2.BundleDeployment) (*chart.Chart, chartutil.Values, error) {
plainFS, err := convert.RegistryV1ToPlain(fsys, bd.Spec.InstallNamespace, []string{metav1.NamespaceAll})
if err != nil {
return nil, nil, fmt.Errorf("convert registry+v1 bundle to plain+v0 bundle: %v", err)
}
return plain.HandleBundleDeployment(ctx, plainFS, bd)
}