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 2021-06-15 #156

Merged
merged 104 commits into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
fa38361
modify power_interface for irmc
Apr 6, 2021
1e564ac
Enable golint with golangci-lint
elfosardo Apr 8, 2021
679a3fa
Merge pull request #849 from zaneb/fix-extprov-adopt
zaneb Apr 9, 2021
fe95a49
Define command for ironic-inspector run
elfosardo Apr 12, 2021
64898fa
Merge pull request #825 from elfosardo/enable-golint
dhellmann Apr 12, 2021
57b7cc3
Remove govet script and test
elfosardo Apr 14, 2021
399f5ef
Merge pull request #848 from zhouhao3/change-irmc-power
zaneb Apr 15, 2021
f4865db
Add go.mod for BMH api
kashifest Apr 14, 2021
c927d1d
Merge pull request #857 from Nordix/addGoMoDApi
maelk Apr 16, 2021
71be7a3
Propagate IPA_BASEURI env var to ironic images
macaptain Apr 19, 2021
a4ca6eb
ironic: Add code for lazily updating options
zaneb Apr 9, 2021
8df005a
ironic: Update image options only when changed
zaneb Apr 9, 2021
3103dec
ironic: Refactor setting of 'properties' options
zaneb Apr 9, 2021
b8dba2c
ironic: Add convenience function for top-level options
zaneb Apr 12, 2021
9e284fb
ironic: Pass nodeUpdater instead of updates list
zaneb Apr 16, 2021
2558c36
Add unit lint test in travis
kashifest Apr 20, 2021
ea932a3
ironic: Refactor node update into single method
zaneb Apr 20, 2021
eff6124
Merge pull request #852 from zaneb/ironic-lazy-update
zaneb Apr 20, 2021
8653b7d
Merge pull request #862 from Nordix/add/tests-in-travis
zaneb Apr 20, 2021
e749f3b
Fix travis lint test
zaneb Apr 20, 2021
d5ec505
Merge pull request #860 from Nordix/set-ipa-baseuri-locally
maelk Apr 21, 2021
a39c5d3
Merge pull request #863 from zaneb/lint-fix
zaneb Apr 21, 2021
7374a04
Point ironic-inspector to the ironic image in quay
elfosardo Apr 19, 2021
8186237
Fix some typos
Hellcatlk Apr 27, 2021
025c22b
Merge pull request #856 from elfosardo/remove-govet
metal3-io-bot Apr 30, 2021
cdb3386
Revert Add unit and lint test in travis
fmuyassarov May 2, 2021
e0aa706
Don't assigne variable is to itself.
fmuyassarov May 2, 2021
0c1ede9
Merge pull request #869 from Nordix/disable-travis/feruz
metal3-io-bot May 3, 2021
90c70fa
Merge pull request #866 from Hellcatlk/master
metal3-io-bot May 3, 2021
2e6cac3
Merge pull request #851 from elfosardo/inspector-command
metal3-io-bot May 3, 2021
c45ecfb
Create port for node when node exists and has no port allocated.
s3rj1k Apr 9, 2021
291eb95
Remove redundant pager error check.
s3rj1k May 3, 2021
a23c269
Adding RAID Parameters
ZainubW Apr 15, 2021
364f0a6
Adding RAID Parameters in api.md
ZainubW Apr 20, 2021
77ef06e
Document parameter to set boot iso source
elfosardo May 5, 2021
89c64e6
Run apis/ tests in make unit
ardaguclu May 6, 2021
2f4c08b
Remove go lint dependency
ardaguclu May 6, 2021
ef7758c
Revert linter dependency removal
ardaguclu May 7, 2021
a629ef2
Merge pull request #861 from elfosardo/inspector-to-ironic-quay
metal3-io-bot May 10, 2021
c35e0b3
Enable Client certificate authorization for Ironic TLS client.
s3rj1k Apr 21, 2021
fa1773f
Merge pull request #864 from s3rj1k/TLS_CLIENT_CERT
metal3-io-bot May 10, 2021
a3c360b
Merge pull request #817 from s3rj1k/IRONIC_PORT
metal3-io-bot May 10, 2021
9da8e7c
Merge pull request #858 from ZainubW/raid_api
metal3-io-bot May 10, 2021
3629e91
TEST PR: Revet 861
fmuyassarov May 10, 2021
a55d73c
Merge pull request #873 from Nordix/revert-861/feruz
metal3-io-bot May 11, 2021
60cbd24
Merge pull request #871 from ardaguclu/run-apis-unit-tests
metal3-io-bot May 12, 2021
cb572bd
Fix error: missing the following IPMI credentials in node's driver_in…
Hellcatlk May 17, 2021
e9240f5
unit tests: Add tests for available state in Prepare()
zaneb Apr 22, 2021
78d6805
Return started=true from Prepare() at least once
zaneb May 17, 2021
782878b
strip whitespace after decoding secret values
dhellmann May 17, 2021
88a3938
Merge pull request #881 from dhellmann/secret-trailing-whitespace
metal3-io-bot May 17, 2021
2e860d8
Update unit test
Hellcatlk May 18, 2021
bc3874c
Refactor actionPreparing()
zaneb Apr 22, 2021
7817fbc
unit tests: Make test data more realistic
zaneb May 18, 2021
667b010
Fix transitions to Preparing state from Ready/Available
zaneb May 17, 2021
9a55ce5
ironic: Do automated cleaning in Prepare state
zaneb Apr 22, 2021
8a6da37
Always restart Prepare after an error
zaneb May 13, 2021
b359b7d
Merge pull request #880 from Hellcatlk/master
metal3-io-bot May 19, 2021
d83b384
Unify `kubectl apply -f` format
MaXinjian May 20, 2021
ac22d77
Merge pull request #882 from zaneb/prepare-automated-clean
metal3-io-bot May 20, 2021
98d8e53
Handle separate apis go module for controller-gen
zaneb May 20, 2021
f20971a
Handle node "available" state in inspection
zaneb May 21, 2021
8244f90
Merge pull request #870 from elfosardo/add-ironic-boot-iso-source
metal3-io-bot May 23, 2021
2315955
Document re-inspection API
fmuyassarov May 23, 2021
0a9c3ab
Merge pull request #889 from zaneb/prepare-automated-clean
metal3-io-bot May 23, 2021
9fdf96f
Uplift kube-rbac-proxy to v0.8.0
kashifest May 24, 2021
6bd7a18
Merge pull request #888 from zaneb/apis-mod-generate
metal3-io-bot May 24, 2021
736bc38
Also run controller-gen on the controller directory to get rbac
asalkeld May 24, 2021
6eabbb3
Restart Ironic containers when certificates are changed
namnx228 Apr 13, 2021
4da5368
Merge pull request #854 from Nordix/ironic-cert-update-nam
metal3-io-bot May 26, 2021
a892d07
Add cert manager setup for Ironic TLS deployment.
smoshiur1237 Apr 16, 2021
80c0c57
fix comment
zhouhao3 May 27, 2021
583348b
Merge pull request #894 from zhouhao3/fix-com
metal3-io-bot May 27, 2021
24cc04f
Merge pull request #859 from Nordix/cert-manager-tls-moshiur
fmuyassarov May 28, 2021
99fc4ae
Point ironic-inspector to the ironic image in quay
elfosardo Apr 19, 2021
9439c06
Delete the use of httpd-reverse-proxy container
namnx228 May 20, 2021
94fbffd
Merge pull request #886 from Nordix/remove-ironic-inspector-nam
metal3-io-bot May 31, 2021
a79a91b
Merge pull request #890 from Nordix/doc-inspection/feruz
metal3-io-bot Jun 1, 2021
04bc696
Add disk type field to BMH Storage API.
s3rj1k Jun 2, 2021
a4b6fe0
Merge pull request #850 from s3rj1k/DISK_TYPE
metal3-io-bot Jun 3, 2021
d5e09a6
Merge pull request #891 from Nordix/uplift/kube-rbac-proxy
metal3-io-bot Jun 4, 2021
97e1521
Add bios setting's API
Hellcatlk Feb 5, 2021
ccc0ed4
Add bios clean step
Hellcatlk Mar 24, 2021
4cd4f81
Add unit test
Hellcatlk Mar 24, 2021
b05dd9e
Modify buildBIOSSettings to support pointers
Hellcatlk Apr 8, 2021
c6b7952
Update for compatibility with PR173
Hellcatlk Apr 15, 2021
25e976a
Fix golint warning
Hellcatlk May 12, 2021
e4ad7b9
Update manifests
Hellcatlk Jun 6, 2021
a91d812
Merge pull request #302 from longkb/extend_api_to_support_bios_config
metal3-io-bot Jun 7, 2021
febccb3
Increase the default $BMO_CONCURRENCY for scale
zaneb Jun 1, 2021
8daa459
Don't check registration status in MatchProfile
zaneb Jun 1, 2021
f5228fa
Merge pull request #906 from zaneb/scale-concurrency
metal3-io-bot Jun 8, 2021
13ed70f
Support deploy_iso in addition to deploy_kernel/ramdisk
dtantsur Jun 2, 2021
c98f729
Refactor and unit test environment settings
dtantsur Jun 9, 2021
eef54da
Disable raid feature for iRMC server
Hellcatlk Jun 10, 2021
66307fe
Merge pull request #911 from Hellcatlk/alternate
metal3-io-bot Jun 10, 2021
c3a0d32
Extend docs for "baremetalhost.metal3.io/detached" annotation
mkowalski Jun 10, 2021
0b5ef36
Merge pull request #885 from MaXinjian/0520
metal3-io-bot Jun 10, 2021
a93cb9c
Merge pull request #892 from asalkeld/fix-controller-gen
metal3-io-bot Jun 10, 2021
1c9e637
Merge pull request #907 from dtantsur/deploy-iso
metal3-io-bot Jun 11, 2021
f194220
Merge pull request #913 from mkowalski/detached-annotation-docs
metal3-io-bot Jun 14, 2021
3bd0608
Merge upstream
honza Jun 15, 2021
86d60a1
Update vendor
honza Jun 15, 2021
624ffc2
Re-render capm3 config file
honza Jun 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ run:
linters:
disable-all: true
enable: [
"golint",
"govet",
"goimports",
"gofmt",
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ go:

env:
- TARGET=docker

script: make $TARGET
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ WORKDIR /workspace
# advantage of caching these layers in future builds.
COPY go.mod go.mod
COPY go.sum go.sum
COPY apis/go.mod apis/go.mod
COPY apis/go.sum apis/go.sum
RUN go mod download

COPY . .
Expand Down
28 changes: 13 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ COVER_PROFILE = cover.out
BIN_DIR := bin

CRD_OPTIONS ?= "crd:trivialVersions=false,allowDangerousTypes=true,crdVersions=v1"
CONTROLLER_GEN ?= go run sigs.k8s.io/controller-tools/cmd/controller-gen
GOLANGCI_LINT ?= GOLANGCI_LINT_CACHE=$(GOLANGCI_LINT_CACHE) go run github.com/golangci/golangci-lint/cmd/golangci-lint
KUSTOMIZE ?= go run sigs.k8s.io/kustomize/kustomize/v3

Expand Down Expand Up @@ -64,11 +63,14 @@ test: generate lint manifests unit ## Run common developer tests
.PHONY: unit
unit: ## Run unit tests
go test ./... $(GO_TEST_FLAGS) -coverprofile $(COVER_PROFILE)
cd apis/ && go test ./... $(GO_TEST_FLAGS) -coverprofile $(COVER_PROFILE)

.PHONY: unit-cover
unit-cover: ## Run unit tests with code coverage
go test -coverprofile=$(COVER_PROFILE) $(GO_TEST_FLAGS) ./...
go tool cover -func=$(COVER_PROFILE)
cd apis/ && go test -coverprofile=$(COVER_PROFILE) $(GO_TEST_FLAGS) ./...
cd apis/ && go tool cover -func=$(COVER_PROFILE)

.PHONY: unit-verbose
unit-verbose: ## Run unit tests with verbose output
Expand All @@ -81,15 +83,6 @@ unit-verbose: ## Run unit tests with verbose output
.PHONY: linters
linters: lint generate-check fmt-check

.PHONY: sec
sec: lint

.PHONY: fmt
fmt: lint

.PHONY: vet
vet: lint

.PHONY: lint
lint:
$(GOLANGCI_LINT) run
Expand Down Expand Up @@ -118,7 +111,7 @@ demo: generate lint manifests ## Run in demo mode
go run -ldflags $(LDFLAGS) ./main.go -namespace=$(RUN_NAMESPACE) -dev -demo-mode

.PHONY: run-test-mode
run-test-mode: generate fmt vet manifests ## Run against the configured Kubernetes cluster in ~/.kube/config
run-test-mode: generate fmt-check lint manifests ## Run against the configured Kubernetes cluster in ~/.kube/config
go run -ldflags $(LDFLAGS) ./main.go -namespace=$(RUN_NAMESPACE) -dev -test-mode

.PHONY: install
Expand All @@ -134,14 +127,19 @@ deploy: manifests ## Deploy controller in the configured Kubernetes cluster in ~
cd config/manager && kustomize edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -

tools/bin/controller-gen: go.mod
go build -o $@ sigs.k8s.io/controller-tools/cmd/controller-gen

.PHONY: manifests
manifests: ## Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
manifests: tools/bin/controller-gen ## Generate manifests e.g. CRD, RBAC etc.
cd apis; ../$< $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=../config/crd/bases
$< rbac:roleName=manager-role paths="./..." output:rbac:artifacts:config=config/rbac
$(KUSTOMIZE) build config/default > config/render/capm3.yaml

.PHONY: generate
generate: ## Generate code
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
generate: tools/bin/controller-gen ## Generate code
cd apis; ../$< object:headerFile="../hack/boilerplate.go.txt" paths="./..."
$< object:headerFile="hack/boilerplate.go.txt" paths="./..."

## --------------------------------------
## Docker Targets
Expand Down
10 changes: 10 additions & 0 deletions apis/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module github.com/metal3-io/baremetal-operator/apis

go 1.16

require (
github.com/stretchr/testify v1.7.0
k8s.io/api v0.20.2
k8s.io/apimachinery v0.20.2
sigs.k8s.io/controller-runtime v0.7.0
)
610 changes: 610 additions & 0 deletions apis/go.sum

Large diffs are not rendered by default.

48 changes: 45 additions & 3 deletions apis/metal3.io/v1alpha1/baremetalhost_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
// an immediate requeue)
PausedAnnotation = "baremetalhost.metal3.io/paused"

// Detached is the annotation which stops provisioner management of the host
// DetachedAnnotation is the annotation which stops provisioner management of the host
// unlike in the paused case, the host status may be updated
DetachedAnnotation = "baremetalhost.metal3.io/detached"

Expand Down Expand Up @@ -149,7 +149,7 @@ const (
// PreparationError is an error condition occurring when do
// cleaning steps failed.
PreparationError ErrorType = "preparation error"
// ProvisioningError is an error condition occuring when the controller
// ProvisioningError is an error condition occurring when the controller
// fails to provision or deprovision the Host.
ProvisioningError ErrorType = "provisioning error"
// PowerManagementError is an error condition occurring when the
Expand Down Expand Up @@ -289,6 +289,24 @@ type RAIDConfig struct {
SoftwareRAIDVolumes []SoftwareRAIDVolume `json:"softwareRAIDVolumes,omitempty"`
}

// FirmwareConfig contains the configuration that you want to configure BIOS settings in Bare metal server
type FirmwareConfig struct {
// Supports the virtualization of platform hardware.
// This supports following options: true, false.
// +kubebuilder:validation:Enum=true;false
VirtualizationEnabled *bool `json:"virtualizationEnabled,omitempty"`

// Allows a single physical processor core to appear as several logical processors.
// This supports following options: true, false.
// +kubebuilder:validation:Enum=true;false
SimultaneousMultithreadingEnabled *bool `json:"simultaneousMultithreadingEnabled,omitempty"`

// SR-IOV support enables a hypervisor to create virtual instances of a PCI-express device, potentially increasing performance.
// This supports following options: true, false.
// +kubebuilder:validation:Enum=true;false
SriovEnabled *bool `json:"sriovEnabled,omitempty"`
}

// BareMetalHostSpec defines the desired state of BareMetalHost
type BareMetalHostSpec struct {
// Important: Run "make generate manifests" to regenerate code
Expand All @@ -306,6 +324,9 @@ type BareMetalHostSpec struct {
// RAID configuration for bare metal server
RAID *RAIDConfig `json:"raid,omitempty"`

// BIOS configuration for bare metal server
Firmware *FirmwareConfig `json:"firmware,omitempty"`

// What is the name of the hardware profile for this host? It
// should only be necessary to set this when inspection cannot
// automatically determine the profile.
Expand Down Expand Up @@ -442,6 +463,16 @@ const (
TeraByte = GigaByte * 1000
)

// DiskType is a disk type, i.e. HDD, SSD, NVME.
type DiskType string

// DiskType constants.
const (
HDD DiskType = "HDD"
SSD DiskType = "SSD"
NVME DiskType = "NVME"
)

// CPU describes one processor on the host.
type CPU struct {
Arch string `json:"arch,omitempty"`
Expand All @@ -457,9 +488,17 @@ type Storage struct {
// may not be stable across reboots.
Name string `json:"name,omitempty"`

// Whether this disk represents rotational storage
// Whether this disk represents rotational storage.
// This field is not recommended for usage, please
// prefer using 'Type' field instead, this field
// will be deprecated eventually.
Rotational bool `json:"rotational,omitempty"`

// Device type, one of: HDD, SSD, NVME.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Enum=HDD;SSD;NVME;
Type DiskType `json:"type,omitempty"`

// The size of the disk in Bytes
SizeBytes Capacity `json:"sizeBytes,omitempty"`

Expand Down Expand Up @@ -698,6 +737,9 @@ type ProvisionStatus struct {

// The Raid set by the user
RAID *RAIDConfig `json:"raid,omitempty"`

// The Bios set by the user
Firmware *FirmwareConfig `json:"firmware,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
40 changes: 40 additions & 0 deletions apis/metal3.io/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/basic-auth/default/credentials_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ spec:
secretName: ironic-credentials
- name: ironic-inspector-credentials
secret:
secretName: ironic-inspector-credentials
secretName: ironic-inspector-credentials
2 changes: 1 addition & 1 deletion config/basic-auth/tls/credentials_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ spec:
secretName: ironic-credentials
- name: ironic-inspector-credentials
secret:
secretName: ironic-inspector-credentials
secretName: ironic-inspector-credentials
53 changes: 52 additions & 1 deletion config/crd/bases/metal3.io_baremetalhosts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,28 @@ spec:
externallyProvisioned:
description: ExternallyProvisioned means something else is managing the image running on the host and the operator should only manage the power status and hardware inventory inspection. If the Image field is filled in, this field is ignored.
type: boolean
firmware:
description: BIOS configuration for bare metal server
properties:
simultaneousMultithreadingEnabled:
description: 'Allows a single physical processor core to appear as several logical processors. This supports following options: true, false.'
enum:
- true
- false
type: boolean
sriovEnabled:
description: 'SR-IOV support enables a hypervisor to create virtual instances of a PCI-express device, potentially increasing performance. This supports following options: true, false.'
enum:
- true
- false
type: boolean
virtualizationEnabled:
description: 'Supports the virtualization of platform hardware. This supports following options: true, false.'
enum:
- true
- false
type: boolean
type: object
hardwareProfile:
description: What is the name of the hardware profile for this host? It should only be necessary to set this when inspection cannot automatically determine the profile.
type: string
Expand Down Expand Up @@ -495,7 +517,7 @@ spec:
description: The Linux device name of the disk, e.g. "/dev/sda". Note that this may not be stable across reboots.
type: string
rotational:
description: Whether this disk represents rotational storage
description: Whether this disk represents rotational storage. This field is not recommended for usage, please prefer using 'Type' field instead, this field will be deprecated eventually.
type: boolean
serialNumber:
description: The serial number of the device
Expand All @@ -504,6 +526,13 @@ spec:
description: The size of the disk in Bytes
format: int64
type: integer
type:
description: 'Device type, one of: HDD, SSD, NVME.'
enum:
- HDD
- SSD
- NVME
type: string
vendor:
description: The name of the vendor of the device
type: string
Expand Down Expand Up @@ -614,6 +643,28 @@ spec:
- UEFISecureBoot
- legacy
type: string
firmware:
description: The Bios set by the user
properties:
simultaneousMultithreadingEnabled:
description: 'Allows a single physical processor core to appear as several logical processors. This supports following options: true, false.'
enum:
- true
- false
type: boolean
sriovEnabled:
description: 'SR-IOV support enables a hypervisor to create virtual instances of a PCI-express device, potentially increasing performance. This supports following options: true, false.'
enum:
- true
- false
type: boolean
virtualizationEnabled:
description: 'Supports the virtualization of platform hardware. This supports following options: true, false.'
enum:
- true
- false
type: boolean
type: object
image:
description: Image holds the details of the last image successfully provisioned to the host.
properties:
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
spec:
containers:
- name: kube-rbac-proxy
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8085/"
Expand Down