Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream 2020 06 04 #73

Merged
merged 138 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
114510d
Adding README.md to the folder fixed
furkatgofurov7 Apr 2, 2020
0f38b05
Makefile: update operator-sdk command
Apr 14, 2020
721f42b
Merge branch 'master' of github.com:Nordix/baremetal-operator into fu…
furkatgofurov7 Apr 14, 2020
bed8a51
Implement metadata interface for beremetal operator
dukov Mar 2, 2020
33abfaf
Update pkg/controller/baremetalhost/host_config_data.go
dukov Mar 4, 2020
2dcd8da
Cover MetaData method with unit tests
dukov Mar 11, 2020
a78c993
Add metaData and networkData usage sample
dukov Mar 11, 2020
d4f0461
Default meta-data namespace to BMH namespace
dukov Mar 26, 2020
f1e8625
Merge pull request #448 from dukov/master
metal3-io-bot Apr 15, 2020
33e2ec2
Merge pull request #479 from Nordix/furkat-test-bmo
metal3-io-bot Apr 17, 2020
19c1b63
Add openstack profile
Apr 20, 2020
0372ae0
Update hardware profile with openstack
Apr 20, 2020
90745e2
Merge pull request #486 from schmaustech/master
metal3-io-bot Apr 21, 2020
5876cd5
Put BMH status in annotation while reconciliation
kashifest Mar 30, 2020
a1dd8ac
Merge pull request #470 from Nordix/add/status-in-annotation
metal3-io-bot Apr 24, 2020
229b739
Update operator-sdk to v0.17.0
honza Apr 27, 2020
9a2eb8b
Use openapi-gen directly to generate files
honza Apr 22, 2020
7ce3ae1
Merge pull request #487 from honza/update-sdk
metal3-io-bot Apr 27, 2020
c2ed2fd
document openapi-gen dependency
dhellmann Apr 29, 2020
1bd72ee
update vendored gosec dependencies
dhellmann Apr 29, 2020
310b04f
remove lint job from travis
dhellmann Apr 29, 2020
c0c7874
Merge pull request #494 from dhellmann/no-travis-lint-job
russellb Apr 29, 2020
7a2661d
fix kubebuilder validation for vlanid
dhellmann Apr 29, 2020
652a5bb
set up check to ensure operator-sdk generation is done
dhellmann Apr 29, 2020
292bd7b
Merge pull request #496 from dhellmann/kubebuilder-vlanid
metal3-io-bot Apr 30, 2020
e0de61b
Merge pull request #492 from dhellmann/update-gosec-dependencies
metal3-io-bot Apr 30, 2020
7556851
Merge pull request #489 from dhellmann/document-openapi-gen
metal3-io-bot Apr 30, 2020
a0938f6
Merge pull request #497 from dhellmann/generate-crds
metal3-io-bot Apr 30, 2020
246e124
add test for operator-sdk docker file
dhellmann Apr 30, 2020
f214654
make hack/gofmt.sh return error if it wants to make changes
dhellmann Apr 29, 2020
55d5ba3
add makefile target for gofmt
dhellmann Apr 29, 2020
6a19e80
add gofmt to local 'make lint' checks
dhellmann Apr 29, 2020
3826750
run gofmt
dhellmann Apr 29, 2020
eeb8e06
symlink role file used by operator-sdk
dhellmann May 1, 2020
00c828c
Merge pull request #499 from dhellmann/test-sdk-dockerfile
metal3-io-bot May 1, 2020
0103b76
Merge pull request #503 from dhellmann/detangle-kustomize2
metal3-io-bot May 1, 2020
2c0dc99
Merge pull request #491 from dhellmann/strict-gofmt
zaneb May 1, 2020
60716c6
Merge pull request #484 from q384566678/fix-makefile
metal3-io-bot May 4, 2020
7ad4300
Postpone inspector start when running out of cluster
maelk May 5, 2020
8884461
Merge pull request #506 from Nordix/local-mael
metal3-io-bot May 5, 2020
70f00b9
Expand image checksum support to use hash algo and its corresponding …
kirankt Jan 13, 2020
aecbf57
fix the broken link to vbmc doc
demonCoder95 May 5, 2020
c567abe
Merge pull request #508 from demonCoder95/fix-vbmc-doc-link
russellb May 6, 2020
c5ccc7e
fix some warning
Hellcatlk Apr 28, 2020
9c21a13
Merge pull request #488 from Hellcatlk/master
dhellmann May 7, 2020
b5e0027
fix operator-sdk commands in the makefile
dhellmann May 7, 2020
da79c86
Run ironic-endpoint-keepalived outside the deployment
fmuyassarov May 8, 2020
71ebf50
Merge pull request #401 from kirankt/expand-image-checksum
metal3-io-bot May 11, 2020
1cb0a02
Merge pull request #511 from Nordix/ironic-keepalived-feruz
metal3-io-bot May 12, 2020
49d20fc
Get rid of extra resource write during delete
zaneb May 12, 2020
108a5b4
add operator-sdk 0.17.0 code
dhellmann May 1, 2020
c549ec2
use the copy of operator-sdk in tools
dhellmann May 1, 2020
107f790
change controller-tools to allow float fields
dhellmann May 1, 2020
61069dd
refresh the generated CRD
dhellmann May 1, 2020
017f052
make shellcheck ignore vendored operator-sdk
dhellmann May 1, 2020
8b02875
remove OWNERS files for vendored code
dhellmann May 1, 2020
6decebe
make markdownlint ignore vendored operator-sdk
dhellmann May 1, 2020
c1f7144
make gosec look only at our source
dhellmann May 1, 2020
3312e63
fix operator-sdk commands in the makefile
dhellmann May 7, 2020
6b86e1d
Merge pull request #510 from dhellmann/makefile-targets
metal3-io-bot May 12, 2020
761feac
Requeue after writing status from annotation
zaneb May 13, 2020
12c8cca
Add a tool to convert introspection data to HardwareDetails
stbenjam May 12, 2020
fe92fa2
Merge pull request #515 from stbenjam/introspection
metal3-io-bot May 13, 2020
fb4eb02
Rename make-introspection to get-hardware-details
stbenjam May 13, 2020
d03651f
Merge pull request #520 from stbenjam/rename-introspection-cmd
metal3-io-bot May 13, 2020
44415ce
Merge pull request #504 from dhellmann/operator-sdk-allow-floats
metal3-io-bot May 13, 2020
b18d2dd
Merge pull request #516 from zaneb/status-annotation-cleanup
metal3-io-bot May 13, 2020
f1236a5
Adding last new changes without removing old ones
furkatgofurov7 May 13, 2020
c0da138
add golint-check target and travis job
dhellmann May 13, 2020
7438682
fix golint errors
dhellmann May 13, 2020
826b22a
Merge pull request #523 from dhellmann/fix-lint
metal3-io-bot May 13, 2020
d898529
Add status annotation documentation
kashifest May 14, 2020
48162e0
update make help target
dhellmann May 14, 2020
5ef6cd6
change "lint" make target to only run golint
dhellmann May 14, 2020
506e096
add separate "vet" make target
dhellmann May 14, 2020
5d42ae8
rename gofmt targets in makefile
dhellmann May 14, 2020
8b76f4b
update gosec in makefile
dhellmann May 14, 2020
a5d4817
update test target
dhellmann May 14, 2020
0130789
add hack/golint.sh
dhellmann May 14, 2020
9a694a9
Fix version string build option
andfasano May 15, 2020
4758340
Merge pull request #528 from andfasano/fix-version-string
metal3-io-bot May 15, 2020
889fafd
add the dockerfile for golint job
dhellmann May 14, 2020
6a6589c
Merge pull request #526 from Nordix/add/status-annotation-doc
metal3-io-bot May 16, 2020
1dd86ff
Merge pull request #527 from dhellmann/make-targets
metal3-io-bot May 18, 2020
bb711d0
Fix IP address in ironic_ci.env
fmuyassarov May 13, 2020
f6466ec
Merge pull request #518 from Nordix/fix-ip-feruz
metal3-io-bot May 18, 2020
ba33b5d
Delay when we are awaiting state change while validating access
zaneb May 16, 2020
40aa6b0
Don't set Dirty flag and ErrorMessage together
zaneb May 18, 2020
1e8ce5e
Don't set RequeueAfter when returning an error
zaneb May 18, 2020
09e6f72
Merge pull request #514 from zaneb/delete-double-write
dhellmann May 18, 2020
76031b6
Remove ironic workaround when running locally
maelk May 20, 2020
22bd739
Merge pull request #534 from Nordix/fix-local-mael
metal3-io-bot May 20, 2020
6255225
Register host config data error metric
zaneb May 19, 2020
ff1a153
Merge pull request #532 from zaneb/host-config-data-error-register
metal3-io-bot May 20, 2020
2788ca7
handle missing image in GetImageChecksum
dhellmann May 22, 2020
bb2e66a
Merge pull request #535 from dhellmann/image-checksum-validation
metal3-io-bot May 23, 2020
4807f72
Unify the image reference in operator deployments
maelk May 24, 2020
1511066
Merge pull request #538 from Nordix/local-mael
metal3-io-bot May 25, 2020
54918b7
Add Image disk format in api and ironic updates
maelk May 20, 2020
b801335
Merge pull request #533 from Nordix/raw-mael
metal3-io-bot May 27, 2020
071384e
Merge pull request #531 from zaneb/validate-delay
metal3-io-bot May 27, 2020
d4356d1
fix typos in state diagram
dhellmann May 27, 2020
2fe2e52
Merge pull request #539 from dhellmann/fix-state-diagram-deleted5
metal3-io-bot May 28, 2020
300f0f3
Update doc link and operator-sdk command
demonCoder95 May 28, 2020
5e19f45
Update doc link and operator-sdk command
demonCoder95 May 28, 2020
913405d
Merge branch 'fix-dev-docs' of https://github.com/demonCoder95/bareme…
demonCoder95 May 28, 2020
86ffcc8
add root device hints to BareMetalHost
mikkosest Feb 24, 2020
592d826
update api docs for root device hints
dhellmann Jun 1, 2020
f31abfc
Reference link edited in configuration.md and small changes in deploy…
furkatgofurov7 May 28, 2020
a27a5dd
make root device hint size field explicitly a minimum value
dhellmann Jun 2, 2020
c2513a6
use explicit operators when passing device hints to ironic
dhellmann Jun 2, 2020
007211a
Merge pull request #495 from dhellmann/root-device-hints
metal3-io-bot Jun 2, 2020
1b0e4b9
add minimum validation for root device hint size
dhellmann Jun 2, 2020
5692756
Merge pull request #544 from dhellmann/device-hint-api-validation
metal3-io-bot Jun 2, 2020
24fc19c
Added ironic to kustomization
furkatgofurov7 May 28, 2020
22f98ae
Merge pull request #522 from Nordix/furkat-bmo-new
metal3-io-bot Jun 4, 2020
779dba8
fix typo in variable name in controller tests
dhellmann Jun 4, 2020
4cc2141
create reusable functions for managing the status annotation content
dhellmann Jun 4, 2020
e0ccd87
ensure last updated is set when extracting status from annotation
dhellmann Jun 4, 2020
4cc6f0a
Merge 'master' from 'metal3-io/baremetal' into 'master'
honza Jun 4, 2020
f946251
fix typo in output message for get-hardware-details
dhellmann Jun 4, 2020
831ad31
Merge pull request #546 from dhellmann/fix-partial-status-annotation
metal3-io-bot Jun 4, 2020
a1af863
Merge 'master' from 'metal3-io/baremetal-operator' into 'master'
honza Jun 4, 2020
97dbf1f
Adding kustomizeconfig.yaml for namespace
metal3-io-bot Jun 4, 2020
35d536a
Fix behavior type in kustomization
furkatgofurov7 Jun 5, 2020
21fb1cb
support older ironic checksum expectations
dhellmann Jun 5, 2020
a371b9b
Merge pull request #548 from Nordix/furkat-bmo-capm3
metal3-io-bot Jun 7, 2020
e4c1933
Merge pull request #549 from dhellmann/fix-image-checksum
metal3-io-bot Jun 7, 2020
29cbba8
Feat: add ibmc driver support
IamFive May 18, 2020
01667b2
Merge pull request #542 from demonCoder95/fix-dev-docs
metal3-io-bot Jun 8, 2020
5024dc1
Merge pull request #530 from IamFive/master
metal3-io-bot Jun 8, 2020
fac4d77
This commit updates the docs/api.md for new unhealthy annotation
jan-est Jun 9, 2020
fbb69f6
Merge pull request #550 from Nordix/unhealthy-annotation-jan
metal3-io-bot Jun 9, 2020
027d324
Remove ironic deployment from default
furkatgofurov7 Jun 10, 2020
5c48b6c
Merge pull request #541 from Nordix/bmo-ironic-doc-furkat
metal3-io-bot Jun 10, 2020
012d0d8
added fixes some typo and rephrasing in doc addressed from prev merge…
furkatgofurov7 Jun 10, 2020
ae0531d
Merge pull request #551 from Nordix/furkat-confmap-behavior-fix
metal3-io-bot Jun 11, 2020
91b0409
Merge 'master' from 'metal3-io/baremetal-operator' into 'master'
honza Jun 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Temporary Build Files
bin
build/_output
build/_test
# Created by https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ before_install:

env:
- TARGET=unit-verbose
- TARGET=lint
- TARGET=docker
- TARGET=golint-check
- TARGET=lint

script: make $TARGET
93 changes: 58 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,8 @@ export GO111MODULE=on
export GOFLAGS=

.PHONY: help
help:
@echo "Targets:"
@echo " test -- run unit tests and linter"
@echo " unit -- run the unit tests"
@echo " unit-cover -- run the unit tests and write code coverage statistics to console"
@echo " unit-cover-html -- run the unit tests and open code coverage statistics in a browser"
@echo " unit-verbose -- run unit tests with verbose flag enabled"
@echo " lint -- run the linter"
@echo " e2e-local -- run end-to-end tests locally"
@echo " help -- this help output"
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
@echo
@echo "Variables:"
@echo " TEST_NAMESPACE -- project name to use ($(TEST_NAMESPACE))"
Expand All @@ -37,11 +29,12 @@ help:
@echo " DEBUG -- debug flag, if any ($(DEBUG))"

.PHONY: test
test: generate unit lint
test: fmt generate lint vet unit ## Run common developer tests

.PHONY: generate
generate:
operator-sdk generate k8s
generate: bin/operator-sdk ## Run the operator-sdk code generator
./bin/operator-sdk generate $(VERBOSE) k8s
./bin/operator-sdk generate $(VERBOSE) crds
openapi-gen \
--input-dirs ./pkg/apis/metal3/v1alpha1 \
--output-package ./pkg/apis/metal3/v1alpha1 \
Expand All @@ -50,15 +43,21 @@ generate:
--report-filename "-" \
--go-header-file /dev/null

bin/operator-sdk: bin
make -C tools/operator-sdk install

bin:
mkdir -p bin

.PHONY: travis
travis: unit-verbose lint

.PHONY: unit
unit:
unit: ## Run unit tests
go test $(GO_TEST_FLAGS) ./cmd/... ./pkg/...

.PHONY: unit-cover
unit-cover:
unit-cover: ## Run unit tests with code coverage
go test -coverprofile=cover.out $(GO_TEST_FLAGS) ./cmd/... ./pkg/...
go tool cover -func=cover.out

Expand All @@ -68,14 +67,18 @@ unit-cover-html:
go tool cover -html=cover.out

.PHONY: unit-verbose
unit-verbose:
unit-verbose: ## Run unit tests with verbose output
VERBOSE=-v make unit

crd_file=deploy/crds/metal3.io_baremetalhosts_crd.yaml
crd_tmp=.crd.yaml.tmp
.PHONY: linters
linters: sec lint generate-check fmt-check vet ## Run all linters

.PHONY: vet
vet: ## Run go vet
go vet ./pkg/... ./cmd/...

.PHONY: golint-check
lint: $GOPATH/bin/golint
.PHONY: lint
lint: golint-binary ## Run golint
find ./pkg ./cmd -type f -name \*.go |grep -v zz_ | xargs -L1 golint -set_exit_status

.PHONY: generate-check
Expand All @@ -86,16 +89,27 @@ generate-check:
generate-check-local:
IS_CONTAINER=local ./hack/generate.sh

.PHONY: test-sec
test-sec: $GOPATH/bin/gosec
gosec -severity medium --confidence medium -quiet ./...
.PHONY: sec
sec: $GOPATH/bin/gosec
gosec -severity medium --confidence medium -quiet ./pkg/... ./cmd/...

$GOPATH/bin/gosec:
go get -u github.com/securego/gosec/cmd/gosec

.PHONY: golint-binary
golint-binary:
which golint 2>&1 >/dev/null || $(MAKE) $GOPATH/bin/golint
$GOPATH/bin/golint:
go get -u golang.org/x/lint/golint

.PHONY: fmt
fmt: ## Run gofmt and write changes to each file
gofmt -l -w ./pkg ./cmd

.PHONY: fmt-check
fmt-check: ## Run gofmt and report an error if any changes are made
./hack/gofmt.sh

.PHONY: docs
docs: $(patsubst %.dot,%.png,$(wildcard docs/*.dot))

Expand All @@ -110,35 +124,44 @@ e2e-local:
$(DEBUG) --go-test-flags "$(GO_TEST_FLAGS)"

.PHONY: run
run:
operator-sdk up local \
run: ## Run the operator outside of a cluster in development mode
operator-sdk run --local \
--go-ldflags=$(LDFLAGS) \
--namespace=$(RUN_NAMESPACE) \
--watch-namespace=$(RUN_NAMESPACE) \
--operator-flags="-dev"

.PHONY: demo
demo:
operator-sdk up local \
demo: ## Run the operator outside of a cluster using the demo driver
operator-sdk run --local \
--go-ldflags=$(LDFLAGS) \
--namespace=$(RUN_NAMESPACE) \
--watch-namespace=$(RUN_NAMESPACE) \
--operator-flags="-dev -demo-mode"

.PHONY: docker
docker:
docker: docker-operator docker-sdk docker-golint ## Build docker images

.PHONY: docker-operator
docker-operator:
docker build . -f build/Dockerfile

.PHONY: docker-sdk
docker-sdk:
docker build . -f hack/Dockerfile.operator-sdk

.PHONY: docker-golint
docker-golint:
docker build . -f hack/Dockerfile.golint

.PHONY: build
build:
build: ## Build the operator binary
@echo LDFLAGS=$(LDFLAGS)
go build -mod=vendor -o build/_output/bin/baremetal-operator cmd/manager/main.go
go build -mod=vendor -ldflags $(LDFLAGS) -o build/_output/bin/baremetal-operator cmd/manager/main.go

.PHONY: tools
tools:
@echo LDFLAGS=$(LDFLAGS)
go build -mod=vendor -o build/_output/bin/get-hardware-details cmd/get-hardware-details/main.go
go build -o build/_output/bin/get-hardware-details cmd/get-hardware-details/main.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@honza This broke the OSE build -- how do we make sure your script preserves this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I'll fix it ASAP.

This will go away if we upgrade to Golang 1.14. From the docs:

When the main module contains a top-level vendor directory and its go.mod file specifies go 1.14 or higher, the go command now defaults to -mod=vendor for operations that accept that flag. A new value for that flag, -mod=mod, causes the go command to instead load modules from the module cache (as when no vendor directory is present).

I'll see about upgrading the module to 1.14.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#76

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


.PHONY: deploy
deploy:
cd deploy && kustomize edit set namespace $(RUN_NAMESPACE) && cd ..
kustomize build deploy | kubectl apply -f -

2 changes: 1 addition & 1 deletion cmd/get-hardware-details/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func main() {
IronicInspectorEndpoint: os.Args[1],
})
if err != nil {
fmt.Printf("could not get inpsector client: %s", err)
fmt.Printf("could not get inspector client: %s", err)
os.Exit(1)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
)

var (
log = logf.Log.WithName("cmd")
watchNamespace string
log = logf.Log.WithName("cmd")
watchNamespace string
)

func printVersion() {
Expand Down
5 changes: 5 additions & 0 deletions deploy/bmo-capm3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# BMO AS PART OF DEPLOYMENT OF CAPM3

The main goal is to deploy BMO as part of deployment in CAPM3 project.
Ironic will be running outside of the cluster. Only the needed variables
inside the ironic_bmo_configmap.env are kept and parameterized.
4 changes: 4 additions & 0 deletions deploy/bmo-capm3/ironic_bmo_configmap.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DEPLOY_KERNEL_URL=${DEPLOY_KERNEL_URL}
DEPLOY_RAMDISK_URL=${DEPLOY_RAMDISK_URL}
IRONIC_ENDPOINT=${IRONIC_URL}
IRONIC_INSPECTOR_ENDPOINT=${IRONIC_INSPECTOR_URL}
10 changes: 10 additions & 0 deletions deploy/bmo-capm3/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../rbac
- ../crds
- ../operator/no_ironic
configMapGenerator:
- envs:
- ironic_bmo_configmap.env
name: ironic-bmo-configmap