Skip to content

Commit 5019969

Browse files
committed
feat: add registry client init
1 parent 69d218a commit 5019969

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

go/shim/main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838
"helm.sh/helm/v4/pkg/cli"
3939
"helm.sh/helm/v4/pkg/getter"
4040
"helm.sh/helm/v4/pkg/kube"
41+
"helm.sh/helm/v4/pkg/registry"
4142
"helm.sh/helm/v4/pkg/repo/v1"
4243
)
4344

@@ -142,6 +143,18 @@ func helm_sdkpy_config_create(namespace *C.char, kubeconfig *C.char, kubecontext
142143
// We'll configure this in the Install action instead
143144
}
144145

146+
// Initialize registry client for OCI operations
147+
registryClient, err := registry.NewClient(
148+
registry.ClientOptDebug(false),
149+
registry.ClientOptEnableCache(true),
150+
registry.ClientOptWriter(os.Stdout),
151+
registry.ClientOptCredentialsFile(envs.RegistryConfig),
152+
)
153+
if err != nil {
154+
return setError(fmt.Errorf("failed to initialize registry client: %w", err))
155+
}
156+
cfg.RegistryClient = registryClient
157+
145158
state := &configState{
146159
cfg: cfg,
147160
envs: envs,

0 commit comments

Comments
 (0)