Skip to content

Commit d92c2d7

Browse files
committed
remove grpcurl dependency
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
1 parent 3a06757 commit d92c2d7

File tree

9 files changed

+8
-54
lines changed

9 files changed

+8
-54
lines changed

infra/feast-operator/config/default/kustomization.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ patches:
3333
- path: related_image_fs_patch.yaml
3434
target:
3535
kind: Deployment
36-
- path: related_image_grpc_patch.yaml
37-
target:
38-
kind: Deployment
3936
# Uncomment the patches line if you enable Metrics, and/or are using webhooks and cert-manager
4037
# [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443.
4138
# More info: https://book.kubebuilder.io/reference/metrics

infra/feast-operator/config/default/related_image_grpc_patch.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

infra/feast-operator/config/manager/manager.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ spec:
7373
env:
7474
- name: RELATED_IMAGE_FEATURE_SERVER
7575
value: feast:latest
76-
- name: RELATED_IMAGE_GRPC_CURL
77-
value: grpc:latest
7876
livenessProbe:
7977
httpGet:
8078
path: /healthz

infra/feast-operator/dist/install.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3581,8 +3581,6 @@ spec:
35813581
env:
35823582
- name: RELATED_IMAGE_FEATURE_SERVER
35833583
value: docker.io/feastdev/feature-server:0.43.0
3584-
- name: RELATED_IMAGE_GRPC_CURL
3585-
value: docker.io/fullstorydev/grpcurl:v1.9.1-alpine
35863584
image: feastdev/feast-operator:0.43.0
35873585
livenessProbe:
35883586
httpGet:

infra/feast-operator/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.22.9
55
require (
66
github.com/onsi/ginkgo/v2 v2.17.1
77
github.com/onsi/gomega v1.32.0
8+
github.com/openshift/api v0.0.0-20240912201240-0a8800162826 // release-4.17
89
gopkg.in/yaml.v3 v3.0.1
910
k8s.io/api v0.30.1
1011
k8s.io/apimachinery v0.30.1

infra/feast-operator/internal/controller/featurestore_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ var _ = Describe("FeatureStore Controller", func() {
10071007
Namespace: objMeta.Namespace,
10081008
}, deploy)
10091009
Expect(err).NotTo(HaveOccurred())
1010-
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
1010+
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
10111011

10121012
// check client config
10131013
cm := &corev1.ConfigMap{}

infra/feast-operator/internal/controller/services/services.go

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (feast *FeastServices) ApplyDefaults() error {
5050
// Deploy the feast services
5151
func (feast *FeastServices) Deploy() error {
5252
if feast.noLocalServiceConfigured() {
53-
return errors.New("At least one local service must be configured. e.g. registry / online / offline.")
53+
return errors.New("at least one local service must be configured. e.g. registry / online / offline")
5454
}
5555
openshiftTls, err := feast.checkOpenshiftTls()
5656
if err != nil {
@@ -301,7 +301,6 @@ func (feast *FeastServices) setPod(podSpec *corev1.PodSpec) error {
301301
if err := feast.setContainers(podSpec); err != nil {
302302
return err
303303
}
304-
feast.setRegistryClientInitContainer(podSpec)
305304
feast.mountTlsConfigs(podSpec)
306305
feast.mountPvcConfigs(podSpec)
307306
feast.mountEmptyDirVolumes(podSpec)
@@ -430,29 +429,6 @@ func (feast *FeastServices) setInitContainer(podSpec *corev1.PodSpec, fsYamlB64
430429
}
431430
}
432431

433-
// add grpc init container if remote registry reference (feastRef) is configured
434-
func (feast *FeastServices) setRegistryClientInitContainer(podSpec *corev1.PodSpec) {
435-
if !feast.Handler.FeatureStore.Status.Applied.Services.DisableInitContainers {
436-
hostname := feast.Handler.FeatureStore.Status.ServiceHostnames.Registry
437-
if len(hostname) > 0 && feast.IsRemoteRefRegistry() {
438-
grpcurlFlag := "-plaintext"
439-
hostSplit := strings.Split(hostname, ":")
440-
if len(hostSplit) > 1 && hostSplit[1] == "443" {
441-
grpcurlFlag = "-insecure"
442-
}
443-
podSpec.InitContainers = append(podSpec.InitContainers, corev1.Container{
444-
Name: "init-registry",
445-
Image: getGrpcCurlImage(),
446-
Command: []string{
447-
"sh", "-c",
448-
"until grpcurl -H \"authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\" " +
449-
grpcurlFlag + " -d '' -format text " + hostname + " grpc.health.v1.Health/Check; do echo waiting for registry; sleep 2; done",
450-
},
451-
})
452-
}
453-
}
454-
}
455-
456432
func (feast *FeastServices) setService(svc *corev1.Service, feastType FeastServiceType) error {
457433
svc.Labels = feast.getFeastTypeLabels(feastType)
458434
if feast.isOpenShiftTls(feastType) {

infra/feast-operator/internal/controller/services/services_types.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ import (
2525
)
2626

2727
const (
28-
feastServerImageVar = "RELATED_IMAGE_FEATURE_SERVER"
29-
grpcCurlImageVar = "RELATED_IMAGE_GRPC_CURL"
30-
grpcCurlImage = "fullstorydev/grpcurl:v1.9.1-alpine"
31-
3228
TmpFeatureStoreYamlEnvVar = "TMP_FEATURE_STORE_YAML_BASE64"
29+
feastServerImageVar = "RELATED_IMAGE_FEATURE_SERVER"
3330
FeatureStoreYamlCmKey = "feature_store.yaml"
3431
EphemeralPath = "/feast-data"
3532
FeatureRepoDir = "/feature_repo"

infra/feast-operator/internal/controller/services/util.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
feastdevv1alpha1 "github.com/feast-dev/feast/infra/feast-operator/api/v1alpha1"
1212
appsv1 "k8s.io/api/apps/v1"
1313
corev1 "k8s.io/api/core/v1"
14-
v1 "k8s.io/api/core/v1"
1514
apierrors "k8s.io/apimachinery/pkg/api/errors"
1615
"k8s.io/apimachinery/pkg/api/resource"
1716
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -178,26 +177,19 @@ func getFeatureServerImage() string {
178177
return DefaultImage
179178
}
180179

181-
func getGrpcCurlImage() string {
182-
if img, exists := os.LookupEnv(grpcCurlImageVar); exists {
183-
return img
184-
}
185-
return grpcCurlImage
186-
}
187-
188180
func checkOfflineStoreFilePersistenceType(value string) error {
189181
if slices.Contains(feastdevv1alpha1.ValidOfflineStoreFilePersistenceTypes, value) {
190182
return nil
191183
}
192184
return fmt.Errorf("invalid file type %s for offline store", value)
193185
}
194186

195-
func ensureRequestedStorage(resources *v1.VolumeResourceRequirements, requestedStorage string) {
187+
func ensureRequestedStorage(resources *corev1.VolumeResourceRequirements, requestedStorage string) {
196188
if resources.Requests == nil {
197-
resources.Requests = v1.ResourceList{}
189+
resources.Requests = corev1.ResourceList{}
198190
}
199-
if _, ok := resources.Requests[v1.ResourceStorage]; !ok {
200-
resources.Requests[v1.ResourceStorage] = resource.MustParse(requestedStorage)
191+
if _, ok := resources.Requests[corev1.ResourceStorage]; !ok {
192+
resources.Requests[corev1.ResourceStorage] = resource.MustParse(requestedStorage)
201193
}
202194
}
203195

0 commit comments

Comments
 (0)