Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: ignore empty cabundle fields. #582

Merged
merged 1 commit into from
Mar 5, 2024
Merged
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
11 changes: 9 additions & 2 deletions controllers/dspipeline_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,10 @@ func (p *DSPAParams) ExtractParams(ctx context.Context, dsp *dspa.DataSciencePip
log.Info(fmt.Sprintf("Found global CA Bundle %s present in this namespace %s, this bundle will be included in external tls connections.", config.GlobalODHCaBundleConfigMapName, p.Namespace))
// "odh-trusted-ca-bundle" can have fields: "odh-ca-bundle.crt" and "ca-bundle.crt", we need to utilize both
for _, val := range globalCerts {
p.APICustomPemCerts = append(p.APICustomPemCerts, []byte(val))
// If the ca-bundle field is empty, ignore it
if val != "" {
p.APICustomPemCerts = append(p.APICustomPemCerts, []byte(val))
}
}
}

Expand All @@ -535,7 +538,11 @@ func (p *DSPAParams) ExtractParams(ctx context.Context, dsp *dspa.DataSciencePip
log.Info(fmt.Sprintf("Encountered error when attempting to fetch ConfigMap: [%s], Error: %v", dspaCaBundleCfgName, dspaCACfgErr))
return dspaCACfgErr
}
p.APICustomPemCerts = append(p.APICustomPemCerts, []byte(dspaProvidedCABundle))

// If the ca-bundle field is empty, ignore it
if dspaProvidedCABundle != "" {
p.APICustomPemCerts = append(p.APICustomPemCerts, []byte(dspaProvidedCABundle))
}
}

// There are situations where global & user provided certs, or a provided ca trust configmap(s) have various trust bundles
Expand Down
Loading