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 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))