Skip to content

Commit ef30f1c

Browse files
ntkatholejyejare
authored andcommitted
fix: Fix resolving to the correct version v1 or v1alpha1
Signed-off-by: ntkathole <[email protected]>
1 parent a45cede commit ef30f1c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

infra/feast-operator/test/utils/test_util.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ const (
2626
FeastPrefix = "feast-"
2727
FeatureStoreName = "simple-feast-setup"
2828
FeastResourceName = FeastPrefix + FeatureStoreName
29+
FeatureStoreResourceName = "featurestores.feast.dev"
2930
)
3031

3132
// dynamically checks if all conditions of custom resource featurestore are in "Ready" state.
3233
func checkIfFeatureStoreCustomResourceConditionsInReady(featureStoreName, namespace string) error {
3334
// Wait 10 seconds to lets the feature store status update
3435
time.Sleep(1 * time.Minute)
3536

36-
cmd := exec.Command("kubectl", "get", "featurestore", featureStoreName, "-n", namespace, "-o", "json")
37+
cmd := exec.Command("kubectl", "get", FeatureStoreResourceName, featureStoreName, "-n", namespace, "-o", "json")
3738

3839
var out bytes.Buffer
3940
var stderr bytes.Buffer
@@ -179,7 +180,16 @@ func isFeatureStoreHavingRemoteRegistry(namespace, featureStoreName string) (boo
179180
startTime := time.Now()
180181

181182
for time.Since(startTime) < timeout {
182-
cmd := exec.Command("kubectl", "get", "featurestore", featureStoreName, "-n", namespace,
183+
// First check if the resource exists
184+
checkCmd := exec.Command("kubectl", "get", FeatureStoreResourceName, featureStoreName, "-n", namespace)
185+
if err := checkCmd.Run(); err != nil {
186+
// Resource doesn't exist yet, retry
187+
fmt.Printf("FeatureStore %s/%s does not exist yet, waiting...\n", namespace, featureStoreName)
188+
time.Sleep(interval)
189+
continue
190+
}
191+
192+
cmd := exec.Command("kubectl", "get", FeatureStoreResourceName, featureStoreName, "-n", namespace,
183193
"-o=jsonpath='{.status.applied.services.registry}'")
184194

185195
output, err := cmd.Output()

0 commit comments

Comments
 (0)