Skip to content

Commit

Permalink
Merge pull request #582 from HumairAK/v1.6.x
Browse files Browse the repository at this point in the history
chore: ignore empty cabundle fields.
  • Loading branch information
HumairAK authored Mar 5, 2024
2 parents 9ffd0f3 + a6367dc commit 48c5cdd
Showing 1 changed file with 9 additions and 2 deletions.
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

0 comments on commit 48c5cdd

Please sign in to comment.