diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index 37719e4b..7dfb9dec 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -1,5 +1,5 @@ name: check-pr -on: +on: pull_request_target: branches: - 'master' diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d51af620..0938ed83 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -160,8 +160,8 @@ jobs: kind load docker-image kind/ydb-operator:current - name: pull-and-load-other-images run: | - docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 - kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 + docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0@sha256:f3b6b39a6062328c095337b4cadcefd1612348fdd5190b1dcbcb9b9e90bd8068 + kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0@sha256:f3b6b39a6062328c095337b4cadcefd1612348fdd5190b1dcbcb9b9e90bd8068 # TODO would be cool to parse YDB image from manifests to avoid duplicating information docker pull cr.yandex/crptqonuodf51kdj7a7d/ydb:22.4.44 diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index e5c7653a..af05f86b 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -7,7 +7,7 @@ on: branches: - master jobs: - tag-job: + tag-job: runs-on: ubuntu-latest outputs: tagcreated: ${{steps.tag-step.outputs.tagcreated}} @@ -60,7 +60,7 @@ jobs: env: SA_KEYS_FOR_PRIVATE_DOCKER_HELM_AND_PUBLIC_DOCKER: ${{ secrets.SA_KEYS_FOR_PRIVATE_DOCKER_HELM_AND_PUBLIC_DOCKER }} - name: parse-version-from-chart - run: | + run: | VERSION=$(cat ./deploy/ydb-operator/Chart.yaml | sed -n 's/^version: //p') echo "VERSION=$VERSION" >> $GITHUB_ENV - name: login-to-registries diff --git a/Makefile b/Makefile index d6ff7342..eeae7b16 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,8 @@ vet: ## Run go vet against code. kind-init: if kind get clusters | grep "kind-ydb-operator"; then exit 0; fi; \ kind create cluster --config e2e/kind-cluster-config.yaml --name kind-ydb-operator; \ + docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0@sha256:f3b6b39a6062328c095337b4cadcefd1612348fdd5190b1dcbcb9b9e90bd8068; \ + kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0@sha256:f3b6b39a6062328c095337b4cadcefd1612348fdd5190b1dcbcb9b9e90bd8068 --name kind-ydb-operator; \ docker pull cr.yandex/crptqonuodf51kdj7a7d/ydb:22.4.44; \ kind load docker-image cr.yandex/crptqonuodf51kdj7a7d/ydb:22.4.44 --name kind-ydb-operator diff --git a/api/v1alpha1/databasenodeset_types.go b/api/v1alpha1/databasenodeset_types.go index 743e6bb8..c52c922a 100644 --- a/api/v1alpha1/databasenodeset_types.go +++ b/api/v1alpha1/databasenodeset_types.go @@ -1,9 +1,10 @@ package v1alpha1 import ( - "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" ) // DatabaseNodeSetSpec describes an group nodes of Database object diff --git a/api/v1alpha1/storagenodeset_types.go b/api/v1alpha1/storagenodeset_types.go index cad585b1..4b29a5ac 100644 --- a/api/v1alpha1/storagenodeset_types.go +++ b/api/v1alpha1/storagenodeset_types.go @@ -1,9 +1,10 @@ package v1alpha1 import ( - "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/ydb-platform/ydb-kubernetes-operator/internal/controllers/constants" ) // StorageNodeSetSpec describes an group nodes of Storage object diff --git a/deploy/ydb-operator/crds/databasenodeset.yaml b/deploy/ydb-operator/crds/databasenodeset.yaml index 9e492c24..74c8bd19 100644 --- a/deploy/ydb-operator/crds/databasenodeset.yaml +++ b/deploy/ydb-operator/crds/databasenodeset.yaml @@ -2236,12 +2236,27 @@ spec: description: Number of nodes (pods) in the set format: int32 type: integer + operatorSync: + default: true + description: Enables or disables operator's reconcile loop. `false` + means all the Pods are running, but the reconcile is effectively + turned off. `true` means the default state of the system, all Pods + running, operator reacts to specification change of this Database + resource. + type: boolean path: description: '(Optional) Custom database path in schemeshard Default: //' maxLength: 255 pattern: /[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?/[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?(/[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?)* type: string + pause: + default: false + description: The state of the Database processes. `true` means all + the Database Pods are being killed, but the Database resource is + persisted. `false` means the default state of the system, all Pods + running. + type: boolean priorityClassName: description: (Optional) If specified, the pod's priorityClassName. type: string diff --git a/deploy/ydb-operator/crds/storagenodeset.yaml b/deploy/ydb-operator/crds/storagenodeset.yaml index 266ed6a5..4ba02d2f 100644 --- a/deploy/ydb-operator/crds/storagenodeset.yaml +++ b/deploy/ydb-operator/crds/storagenodeset.yaml @@ -2379,6 +2379,20 @@ spec: description: Number of nodes (pods) in the set format: int32 type: integer + operatorSync: + default: true + description: Enables or disables operator's reconcile loop. `false` + means all the Pods are running, but the reconcile is effectively + turned off. `true` means the default state of the system, all Pods + running, operator reacts to specification change of this Database + resource. + type: boolean + pause: + default: false + description: The state of the Storage processes. `true` means all + the Stprage Pods are being killed, but the Storage resource is persisted. + `false` means the default state of the system, all Pods running. + type: boolean priorityClassName: description: (Optional) If specified, the pod's priorityClassName. type: string diff --git a/e2e/tests/smoke_test.go b/e2e/tests/smoke_test.go index c6b6ed14..9d256b00 100644 --- a/e2e/tests/smoke_test.go +++ b/e2e/tests/smoke_test.go @@ -338,7 +338,6 @@ var _ = Describe("Operator smoke test", func() { return len(storagePods.Items) == 0 }, Timeout, Interval).Should(BeTrue()) - By("... and then storage pods must not restart for a while...") Consistently(func(g Gomega) bool { storagePods := corev1.PodList{}