Skip to content

Commit d2139dc

Browse files
committed
dev
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
1 parent 63c77a3 commit d2139dc

File tree

8 files changed

+55
-8
lines changed

8 files changed

+55
-8
lines changed

infra/feast-operator/api/v1alpha1/featurestore_types.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,19 @@ import (
2121
)
2222

2323
const (
24+
// Feast phases:
25+
ReadyPhase = "Ready"
26+
PendingPhase = "Pending"
27+
FailedPhase = "Failed"
28+
2429
// Feast condition types:
25-
ReadyType = "FeatureStore"
26-
RegistryReadyType = "Registry"
2730
ClientReadyType = "Client"
31+
RegistryReadyType = "Registry"
32+
ReadyType = "FeatureStore"
2833

2934
// Feast condition reasons:
3035
ReadyReason = "Ready"
31-
FailedReason = "FeastDeploymentFailed"
36+
FailedReason = "FeatureStoreFailed"
3237
RegistryFailedReason = "RegistryDeploymentFailed"
3338
ClientFailedReason = "ClientDeploymentFailed"
3439

@@ -54,6 +59,7 @@ type FeatureStoreStatus struct {
5459
ClientConfigMap string `json:"clientConfigMap,omitempty"`
5560
Conditions []metav1.Condition `json:"conditions,omitempty"`
5661
FeastVersion string `json:"feastVersion,omitempty"`
62+
Phase string `json:"phase,omitempty"`
5763
ServiceUrls ServiceUrls `json:"serviceUrls,omitempty"`
5864
}
5965

@@ -65,6 +71,8 @@ type ServiceUrls struct {
6571
//+kubebuilder:object:root=true
6672
//+kubebuilder:subresource:status
6773
//+kubebuilder:resource:shortName=feast
74+
//+kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`
75+
//+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
6876

6977
// FeatureStore is the Schema for the featurestores API
7078
type FeatureStore struct {

infra/feast-operator/bundle/manifests/feast-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ metadata:
1616
}
1717
]
1818
capabilities: Basic Install
19-
createdAt: "2024-10-20T23:32:11Z"
19+
createdAt: "2024-10-21T14:24:47Z"
2020
operators.operatorframework.io/builder: operator-sdk-v1.37.0
2121
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
2222
name: feast-operator.v0.40.0

infra/feast-operator/bundle/manifests/feast.dev_featurestores.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ spec:
1616
singular: featurestore
1717
scope: Namespaced
1818
versions:
19-
- name: v1alpha1
19+
- additionalPrinterColumns:
20+
- jsonPath: .status.phase
21+
name: Status
22+
type: string
23+
- jsonPath: .metadata.creationTimestamp
24+
name: Age
25+
type: date
26+
name: v1alpha1
2027
schema:
2128
openAPIV3Schema:
2229
description: FeatureStore is the Schema for the featurestores API
@@ -138,6 +145,8 @@ spec:
138145
type: array
139146
feastVersion:
140147
type: string
148+
phase:
149+
type: string
141150
serviceUrls:
142151
description: ServiceUrls
143152
properties:

infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ spec:
1616
singular: featurestore
1717
scope: Namespaced
1818
versions:
19-
- name: v1alpha1
19+
- additionalPrinterColumns:
20+
- jsonPath: .status.phase
21+
name: Status
22+
type: string
23+
- jsonPath: .metadata.creationTimestamp
24+
name: Age
25+
type: date
26+
name: v1alpha1
2027
schema:
2128
openAPIV3Schema:
2229
description: FeatureStore is the Schema for the featurestores API
@@ -138,6 +145,8 @@ spec:
138145
type: array
139146
feastVersion:
140147
type: string
148+
phase:
149+
type: string
141150
serviceUrls:
142151
description: ServiceUrls
143152
properties:

infra/feast-operator/dist/install.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ spec:
2424
singular: featurestore
2525
scope: Namespaced
2626
versions:
27-
- name: v1alpha1
27+
- additionalPrinterColumns:
28+
- jsonPath: .status.phase
29+
name: Status
30+
type: string
31+
- jsonPath: .metadata.creationTimestamp
32+
name: Age
33+
type: date
34+
name: v1alpha1
2835
schema:
2936
openAPIV3Schema:
3037
description: FeatureStore is the Schema for the featurestores API
@@ -146,6 +153,8 @@ spec:
146153
type: array
147154
feastVersion:
148155
type: string
156+
phase:
157+
type: string
149158
serviceUrls:
150159
description: ServiceUrls
151160
properties:

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ func (r *FeatureStoreReconciler) deployFeast(ctx context.Context, cr *feastdevv1
105105
Reason: feastdevv1alpha1.ReadyReason,
106106
Message: feastdevv1alpha1.ReadyMessage,
107107
}
108-
109108
feast := services.FeastServices{
110109
Client: r.Client,
111110
Context: ctx,
@@ -125,6 +124,14 @@ func (r *FeatureStoreReconciler) deployFeast(ctx context.Context, cr *feastdevv1
125124
logger.Info(condition.Message)
126125
apimeta.SetStatusCondition(&cr.Status.Conditions, condition)
127126

127+
if apimeta.IsStatusConditionTrue(cr.Status.Conditions, feastdevv1alpha1.ReadyType) {
128+
cr.Status.Phase = feastdevv1alpha1.ReadyPhase
129+
} else if apimeta.IsStatusConditionFalse(cr.Status.Conditions, feastdevv1alpha1.ReadyType) {
130+
cr.Status.Phase = feastdevv1alpha1.FailedPhase
131+
} else {
132+
cr.Status.Phase = feastdevv1alpha1.PendingPhase
133+
}
134+
128135
return result, err
129136
}
130137

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ var _ = Describe("FeatureStore Controller", func() {
125125
Expect(cond.Type).To(Equal(feastdevv1alpha1.ClientReadyType))
126126
Expect(cond.Message).To(Equal(feastdevv1alpha1.ClientReadyMessage))
127127

128+
Expect(resource.Status.Phase).To(Equal(feastdevv1alpha1.ReadyPhase))
129+
128130
deploy := &appsv1.Deployment{}
129131
err = k8sClient.Get(ctx, types.NamespacedName{
130132
Name: feast.GetFeastServiceName(services.RegistryFeastType),
@@ -316,6 +318,8 @@ var _ = Describe("FeatureStore Controller", func() {
316318
Expect(cond.Reason).To(Equal(feastdevv1alpha1.ReadyReason))
317319
Expect(cond.Type).To(Equal(feastdevv1alpha1.ClientReadyType))
318320
Expect(cond.Message).To(Equal(feastdevv1alpha1.ClientReadyMessage))
321+
322+
Expect(resource.Status.Phase).To(Equal(feastdevv1alpha1.FailedPhase))
319323
})
320324
})
321325
})

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func (feast *FeastServices) createRegistryDeployment() error {
9696
} else if op == controllerutil.OperationResultCreated || op == controllerutil.OperationResultUpdated {
9797
logger.Info("Successfully reconciled", "Deployment", deploy.Name, "operation", op)
9898
}
99+
99100
return nil
100101
}
101102

0 commit comments

Comments
 (0)