Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions go/shim/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func helm_sdkpy_config_create(namespace *C.char, kubeconfig *C.char, kubecontext
if err != nil {
return setError(fmt.Errorf("failed to initialize helm config: %w", err))
}

// Configure the Kubernetes client to use Ignore field validation
// This allows charts with managedFields in templates (like rook-ceph v1.18.x)
// to install successfully without strict Kubernetes API validation errors
Expand Down Expand Up @@ -202,20 +202,20 @@ func helm_sdkpy_install(handle C.helm_sdkpy_handle, release_name *C.char, chart_
client.ReleaseName = releaseName
client.Namespace = state.envs.Namespace()
client.CreateNamespace = create_namespace != 0

// Use client-side apply instead of server-side to avoid strict field validation
// Server-side apply (default in Helm v4) enforces strict field validation which
// rejects charts with managedFields in templates (like rook-ceph v1.18.x)
client.ServerSideApply = false

// Disable OpenAPI validation as well
client.DisableOpenAPIValidation = true

// Set version if provided
if chartVersion != "" {
client.Version = chartVersion
}

// Configure wait behavior
if wait != 0 {
client.WaitStrategy = kube.StatusWatcherStrategy // Use the status watcher strategy
Expand Down Expand Up @@ -284,7 +284,10 @@ func helm_sdkpy_upgrade(handle C.helm_sdkpy_handle, release_name *C.char, chart_
// Create upgrade action
client := action.NewUpgrade(state.cfg)
client.Namespace = state.envs.Namespace()


// Set wait strategy
client.WaitStrategy = kube.HookOnlyStrategy

// Set version if provided
if chartVersion != "" {
client.Version = chartVersion
Expand Down Expand Up @@ -342,7 +345,7 @@ func helm_sdkpy_uninstall(handle C.helm_sdkpy_handle, release_name *C.char, wait

// Create uninstall action
client := action.NewUninstall(state.cfg)

// Configure wait behavior
if wait != 0 {
client.WaitStrategy = kube.StatusWatcherStrategy // Use the status watcher strategy
Expand Down Expand Up @@ -996,11 +999,11 @@ func helm_sdkpy_registry_login(handle C.helm_sdkpy_handle, hostname *C.char, use

// Parse options
var options struct {
CertFile string `json:"cert_file"`
KeyFile string `json:"key_file"`
CAFile string `json:"ca_file"`
Insecure bool `json:"insecure"`
PlainHTTP bool `json:"plain_http"`
CertFile string `json:"cert_file"`
KeyFile string `json:"key_file"`
CAFile string `json:"ca_file"`
Insecure bool `json:"insecure"`
PlainHTTP bool `json:"plain_http"`
}

optionsStr := C.GoString(options_json)
Expand All @@ -1015,7 +1018,7 @@ func helm_sdkpy_registry_login(handle C.helm_sdkpy_handle, hostname *C.char, use

// Build options slice
var loginOpts []action.RegistryLoginOpt

if options.CertFile != "" {
loginOpts = append(loginOpts, action.WithCertFile(options.CertFile))
}
Expand Down Expand Up @@ -1101,7 +1104,7 @@ func helm_sdkpy_push(handle C.helm_sdkpy_handle, chart_ref *C.char, remote *C.ch
// Create push action
var pushOpts []action.PushOpt
pushOpts = append(pushOpts, action.WithPushConfig(state.cfg))

if options.CertFile != "" || options.KeyFile != "" || options.CAFile != "" {
pushOpts = append(pushOpts, action.WithTLSClientConfig(options.CertFile, options.KeyFile, options.CAFile))
}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "helm-sdkpy"
version = "0.0.12"
version = "0.0.13"
description = "Python bindings for Helm - The Kubernetes Package Manager"
readme = "README.md"
requires-python = ">=3.12"
Expand Down
Loading