Skip to content

Commit b89f2b9

Browse files
authored
Fix verify (#355)
* fix autogenerated files * verify script for CI * makefile enhancement * fix copyright
1 parent 16e6d68 commit b89f2b9

33 files changed

+283
-53
lines changed

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# syntax=docker/dockerfile:1.1-experimental
2+
3+
# Copyright 2021 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
# Build the manager binary
218
FROM golang:1.16.7 as builder
319

Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,41 @@ release-staging: ## Builds and push container images to the staging image regist
177177
$(MAKE) docker-build-all
178178
$(MAKE) docker-push-all
179179
$(MAKE) release-alias-tag
180+
181+
.PHONY: verify
182+
verify:
183+
./hack/verify-boilerplate.sh
184+
./hack/verify-doctoc.sh
185+
./hack/verify-shellcheck.sh
186+
#TODO(mkumatag): looking for tiltfile, fix it when we use tilt
187+
#./hack/verify-starlark.sh
188+
$(MAKE) verify-modules
189+
$(MAKE) verify-gen
190+
$(MAKE) verify-conversions
191+
192+
.PHONY: modules
193+
modules: ## Runs go mod to ensure modules are up to date.
194+
go mod tidy
195+
cd $(TOOLS_DIR); go mod tidy
196+
197+
.PHONY: verify-modules
198+
verify-modules: modules
199+
@if !(git diff --quiet HEAD -- go.sum go.mod $(TOOLS_DIR)/go.mod $(TOOLS_DIR)/go.sum); then \
200+
git diff; \
201+
echo "go module files are out of date"; exit 1; \
202+
fi
203+
@if (find . -name 'go.mod' | xargs -n1 grep -q -i 'k8s.io/client-go.*+incompatible'); then \
204+
find . -name "go.mod" -exec grep -i 'k8s.io/client-go.*+incompatible' {} \; -print; \
205+
echo "go module contains an incompatible client-go version"; exit 1; \
206+
fi
207+
208+
.PHONY: verify-gen
209+
verify-gen: generate
210+
@if !(git diff --quiet HEAD); then \
211+
git diff; \
212+
echo "generated files are out of date, run make generate"; exit 1; \
213+
fi
214+
215+
.PHONY: verify-conversions
216+
verify-conversions: $(CONVERSION_VERIFIER)
217+
$(CONVERSION_VERIFIER)

api/v1alpha3/groupversion_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
2+
Copyright 2021 The Kubernetes Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

api/v1alpha3/ibmvpccluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
2+
Copyright 2021 The Kubernetes Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

api/v1alpha3/ibmvpcmachine_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
2+
Copyright 2021 The Kubernetes Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

api/v1alpha3/ibmvpcmachinetemplate_types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package v1alpha3
218

319
import (

api/v1alpha3/types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package v1alpha3
218

319
type NetworkInterface struct {

api/v1alpha3/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha4/groupversion_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
2+
Copyright 2021 The Kubernetes Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

api/v1alpha4/ibmpowervscluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
2+
Copyright 2021 The Kubernetes Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)