Skip to content

Commit

Permalink
Address Matt' comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chinhtranvan committed Feb 16, 2024
1 parent fbf8a86 commit ee51d7a
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 12 deletions.
4 changes: 4 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@ resources:
kind: VerticaScrutinize
path: github.com/vertica/vertica-kubernetes/api/v1beta1
version: v1beta1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
version: "3"
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |-
export STARTTIMESTAMP=$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==1 and .archive=="db") | .timestamp')
sh -c "envsubst < vrpq-start-timestamp.yaml | kubectl apply -n $NAMESPACE -f -"
apiVersion: vertica.com/v1beta1
kind: VerticaRestorePointsQuery
metadata:
name: archive-query
spec:
verticaDBName: archive-query
filterOptions:
startTimestamp: "2024-02-18"
21 changes: 21 additions & 0 deletions tests/e2e-leg-6/verify-vrpq-conditions/25-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# (c) Copyright [2021-2023] Open Text.
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: vertica.com/v1beta1
kind: VerticaRestorePointsQuery
metadata:
name: archive-query
spec:
verticaDBName: archive-query
filterOptions:
startTimestamp: "2024-02-18"
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |-
export STARTTIMESTAMP=$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==1 and .archive=="db") | .timestamp')
export STARTTIMESTAMP="$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==1 and .archive=="db") | .timestamp')"
sh -c "envsubst < vrpq-start-timestamp.yaml | kubectl apply -n $NAMESPACE -f -"
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |-
export ENDTIMESTAMP=$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==1 and .archive=="db") | .timestamp')
export ENDTIMESTAMP="$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==1 and .archive=="db") | .timestamp')"
sh -c "envsubst < vrpq-end-timestamp.yaml | kubectl apply -n $NAMESPACE -f -"
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |-
export STARTTIMESTAMP=$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==1 and .archive=="db") | .timestamp')
export ENDTIMESTAMP=$STARTTIMESTAMP
export STARTTIMESTAMP="$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==1 and .archive=="db") | .timestamp')"
export ENDTIMESTAMP="$STARTTIMESTAMP"
sh -c "envsubst < vrpq-both-timestamps.yaml | kubectl apply -n $NAMESPACE -f -"
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |-
export STARTTIMESTAMP=$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==2 and .archive=="db") | .timestamp' | cut -d ' ' -f 1)
export ENDTIMESTAMP=$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==1 and .archive=="db2") | .timestamp' | cut -d ' ' -f 1)
export STARTTIMESTAMP="$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==2 and .archive=="db") | .timestamp' | cut -d ' ' -f 1)"
export ENDTIMESTAMP="$(kubectl get vrpq archive-query -o json -n $NAMESPACE | jq -r '.status.restorePoints[] | select(.index==1 and .archive=="db2") | .timestamp' | cut -d ' ' -f 1)"
sh -c "envsubst < vrpq-both-date-only-timestamps.yaml | kubectl apply -n $NAMESPACE -f -"

0 comments on commit ee51d7a

Please sign in to comment.