From af5a7f4df8414deb5ffc707184d9db82b7d2b3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 25 Aug 2020 19:00:08 +0200 Subject: [PATCH 1/2] ci: run make codegen validation in workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fail if a PR is submitted and has not run "make codegen" Signed-off-by: Sébastien Han --- .github/workflows/codegen.yml | 20 ++++++++++++++++++++ hack/validate-codegen.sh | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/codegen.yml create mode 100755 hack/validate-codegen.sh diff --git a/.github/workflows/codegen.yml b/.github/workflows/codegen.yml new file mode 100644 index 000000000..740ed0f3d --- /dev/null +++ b/.github/workflows/codegen.yml @@ -0,0 +1,20 @@ +name: Codegen +on: [pull_request] + +jobs: + codegen: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v1 + + - uses: actions/setup-go@v2 + with: + go-version: 1.13 + + - name: run codegen + run: GOPATH=$(go env GOPATH) make codegen + + - name: validate codegen + run: hack/validate-codegen.sh + diff --git a/hack/validate-codegen.sh b/hack/validate-codegen.sh new file mode 100755 index 000000000..e7b1e7bab --- /dev/null +++ b/hack/validate-codegen.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -ex + +for file in $(git status --porcelain); do + if [[ "$file" =~ "zz" ]]; then + echo "found codegen files!" + echo "please run 'make codegen' and update your PR" + exit 1 + fi +done From 0c1250ac81771c48c90f47d1c94246cb40ee1f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 25 Aug 2020 19:21:50 +0200 Subject: [PATCH 2/2] ceph: resync codegen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resync API. Signed-off-by: Sébastien Han --- pkg/apis/rook.io/v1/zz_generated.deepcopy.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/apis/rook.io/v1/zz_generated.deepcopy.go b/pkg/apis/rook.io/v1/zz_generated.deepcopy.go index a817b6526..59021b529 100644 --- a/pkg/apis/rook.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/rook.io/v1/zz_generated.deepcopy.go @@ -428,6 +428,11 @@ func (in *StorageClassDeviceSet) DeepCopyInto(out *StorageClassDeviceSet) { *out = *in in.Resources.DeepCopyInto(&out.Resources) in.Placement.DeepCopyInto(&out.Placement) + if in.PreparePlacement != nil { + in, out := &in.PreparePlacement, &out.PreparePlacement + *out = new(Placement) + (*in).DeepCopyInto(*out) + } if in.Config != nil { in, out := &in.Config, &out.Config *out = make(map[string]string, len(*in)) @@ -512,6 +517,11 @@ func (in *VolumeSource) DeepCopyInto(out *VolumeSource) { } in.Resources.DeepCopyInto(&out.Resources) in.Placement.DeepCopyInto(&out.Placement) + if in.PreparePlacement != nil { + in, out := &in.PreparePlacement, &out.PreparePlacement + *out = new(Placement) + (*in).DeepCopyInto(*out) + } if in.Config != nil { in, out := &in.Config, &out.Config *out = make(map[string]string, len(*in))