Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
tls.SecretRef.Name
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
  • Loading branch information
tchughesiv committed Dec 4, 2024
commit 1f3186527a69bb2e6e6ff3e395c29512f9eaec89
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
. "github.com/onsi/gomega"
"gopkg.in/yaml.v3"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

feastdevv1alpha1 "github.com/feast-dev/feast/infra/feast-operator/api/v1alpha1"
)
Expand Down Expand Up @@ -468,6 +469,7 @@ func emptyRegistryConfig() RegistryConfig {

func minimalFeatureStore() *feastdevv1alpha1.FeatureStore {
return &feastdevv1alpha1.FeatureStore{
ObjectMeta: metav1.ObjectMeta{Name: "test"},
Spec: feastdevv1alpha1.FeatureStoreSpec{
FeastProject: projectName,
},
Expand Down
24 changes: 15 additions & 9 deletions infra/feast-operator/internal/controller/services/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,28 @@ func (feast *FeastServices) setTlsDefaults() error {

func (feast *FeastServices) setOpenshiftTls() error {
appliedServices := feast.Handler.FeatureStore.Status.Applied.Services
tlsConfigs := &feastdevv1alpha1.TlsConfigs{
SecretRef: &corev1.LocalObjectReference{},
}
if feast.offlineOpenshiftTls() {
appliedServices.OfflineStore.TLS = &feastdevv1alpha1.OfflineTlsConfigs{
TlsConfigs: *tlsConfigs,
TlsConfigs: feastdevv1alpha1.TlsConfigs{
SecretRef: &corev1.LocalObjectReference{
Name: feast.initFeastSvc(OfflineFeastType).Name + tlsNameSuffix,
},
},
}
appliedServices.OfflineStore.TLS.TlsConfigs.SecretRef.Name = feast.initFeastSvc(OfflineFeastType).Name + tlsNameSuffix
}
if feast.onlineOpenshiftTls() {
appliedServices.OnlineStore.TLS = tlsConfigs
appliedServices.OnlineStore.TLS.SecretRef.Name = feast.initFeastSvc(OnlineFeastType).Name + tlsNameSuffix
appliedServices.OnlineStore.TLS = &feastdevv1alpha1.TlsConfigs{
SecretRef: &corev1.LocalObjectReference{
Name: feast.initFeastSvc(OnlineFeastType).Name + tlsNameSuffix,
},
}
}
if feast.localRegistryOpenshiftTls() {
appliedServices.Registry.Local.TLS = tlsConfigs
appliedServices.Registry.Local.TLS.SecretRef.Name = feast.initFeastSvc(RegistryFeastType).Name + tlsNameSuffix
appliedServices.Registry.Local.TLS = &feastdevv1alpha1.TlsConfigs{
SecretRef: &corev1.LocalObjectReference{
Name: feast.initFeastSvc(RegistryFeastType).Name + tlsNameSuffix,
},
}
} else if remote, err := feast.remoteRegistryOpenshiftTls(); remote {
// if the remote registry reference is using openshift's service serving certificates, we can use the injected service CA bundle configMap
if appliedServices.Registry.Remote.TLS == nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,17 @@ var _ = Describe("TLS Config", func() {
tls = feast.getTlsConfigs(OfflineFeastType)
Expect(tls).NotTo(BeNil())
Expect(tls.IsTLS()).To(BeTrue())
Expect(tls.SecretRef).NotTo(BeNil())
Expect(tls.SecretRef.Name).To(Equal("feast-test-offline-tls"))
tls = feast.getTlsConfigs(OnlineFeastType)
Expect(tls).NotTo(BeNil())
Expect(tls.IsTLS()).To(BeTrue())
Expect(tls.SecretRef).NotTo(BeNil())
Expect(tls.SecretRef.Name).To(Equal("feast-test-online-tls"))
tls = feast.getTlsConfigs(RegistryFeastType)
Expect(tls).NotTo(BeNil())
Expect(tls.SecretRef).NotTo(BeNil())
Expect(tls.SecretRef.Name).To(Equal("feast-test-registry-tls"))
Expect(tls.SecretKeyNames).To(Equal(secretKeyNames))
Expect(tls.IsTLS()).To(BeTrue())

Expand Down