Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f1270cf
Use separate methods for setting deploy_interface related update node…
s3rj1k Feb 14, 2021
790abd2
Upgrade CRD & Webhook to v1
fmuyassarov Mar 3, 2021
06584aa
Add debug log for provisioner
andfasano Jan 15, 2021
c627998
Upgrade cert-manager from v1alpha2 to v1
fmuyassarov Mar 13, 2021
42e0395
upgrade k8s/api to v0.2.1
asalkeld Mar 12, 2021
ea2b836
add dmitry tantsur as approver
dhellmann Mar 15, 2021
ccb8519
Merge pull request #815 from dhellmann/dmitry-approver
metal3-io-bot Mar 15, 2021
e307972
Merge pull request #805 from Nordix/upgrade-crd-v1/feruz
metal3-io-bot Mar 15, 2021
c6dfc62
Add idrac-redfish url type
juliakreger Feb 6, 2020
b3e23f2
Use the correct version of tools (from go.mod)
asalkeld Mar 11, 2021
d123cc5
Merge pull request #794 from s3rj1k/deploy_interface
metal3-io-bot Mar 16, 2021
df5df61
Merge pull request #808 from asalkeld/update-k8s-api
metal3-io-bot Mar 16, 2021
b252310
Merge pull request #633 from honza/juliakreger-idrac-redfish-ipxe
metal3-io-bot Mar 17, 2021
9b93d97
Merge pull request #813 from asalkeld/vendored-tools
metal3-io-bot Mar 17, 2021
cbdff6d
Apache webserver handles TLS on Ironic and Ironic-inspector sides
namnx228 Mar 11, 2021
82fd2d7
Merge pull request #728 from Nordix/ironic-apache-reverse-proxy-nam
metal3-io-bot Mar 17, 2021
56dbe97
Bug: fix missing Inspecting state
fmuyassarov Mar 22, 2021
dc4839d
Merge pull request #822 from Nordix/fix-inspection/feruz
metal3-io-bot Mar 22, 2021
b9ecdc2
Decouple Unmanaged state from externallyProvisioned
Mar 22, 2021
e22224c
Merge pull request #824 from hardys/unmanaged_bug
metal3-io-bot Mar 22, 2021
f7bc330
Fix some lint errors
elfosardo Mar 22, 2021
ad72e4a
Merge pull request #823 from elfosardo/fix-lint
metal3-io-bot Mar 23, 2021
96fcd6a
Change default of RAIDInterface
iurygregory Mar 23, 2021
0e6772b
Merge pull request #757 from andfasano/registration-log-and-fix
metal3-io-bot Mar 24, 2021
0ae0add
Add a unit test for unsupported secure boot
dtantsur Mar 24, 2021
5ebf0ab
Merge pull request #829 from iurygregory/fix_raid
metal3-io-bot Mar 24, 2021
4e829eb
Pass go tests flags via env.
s3rj1k Mar 24, 2021
002fcb8
Merge pull request #831 from dtantsur/secure-boot
metal3-io-bot Mar 26, 2021
1b51bba
Select empty provisioner inside ironic factory
zaneb Mar 23, 2021
beea4d0
ironic: Lazily create BMC AccessDetails
zaneb Mar 22, 2021
da3bd7e
Remove empty provisioner
zaneb Mar 18, 2021
04d6151
Merge pull request #820 from zaneb/empty-provisioner
metal3-io-bot Mar 29, 2021
d7a2fed
Merge pull request #833 from s3rj1k/TEST
metal3-io-bot Mar 29, 2021
e9afe2a
Prepend the namespace to ironic nodenames to avoid conflicts
asalkeld Feb 16, 2021
b236263
Merge pull request #797 from asalkeld/ironic-host-namespaced
metal3-io-bot Mar 30, 2021
6706739
Merge upstream
honza Mar 30, 2021
73bae4a
Update go modules after upstream merge
honza Mar 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 13 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RUN_NAMESPACE = metal3
GO_TEST_FLAGS = $(VERBOSE)
GO_TEST_FLAGS = $(TEST_FLAGS)
DEBUG = --debug
COVER_PROFILE = cover.out

Expand All @@ -18,10 +18,9 @@ COVER_PROFILE = cover.out
BIN_DIR := bin

CRD_OPTIONS ?= "crd:trivialVersions=false,allowDangerousTypes=true,crdVersions=v1"
CONTROLLER_TOOLS_VERSION=v0.4.1
CONTROLLER_GEN := $(BIN_DIR)/controller-gen
GOLANGCI_LINT := $(BIN_DIR)/golangci-lint
KUSTOMIZE := $(BIN_DIR)/kustomize
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

# See pkg/version.go for details
SOURCE_GIT_COMMIT ?= $(shell git rev-parse --short HEAD)
Expand Down Expand Up @@ -53,15 +52,6 @@ help: ## Display this help

# Image URL to use all building/pushing image targets
IMG ?= baremetal-operator:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif

## --------------------------------------
## Test Targets
Expand All @@ -73,7 +63,7 @@ test: generate lint manifests unit ## Run common developer tests

.PHONY: unit
unit: ## Run unit tests
go test ./... $(VERBOSE) -coverprofile $(COVER_PROFILE)
go test ./... $(GO_TEST_FLAGS) -coverprofile $(COVER_PROFILE)

.PHONY: unit-cover
unit-cover: ## Run unit tests with code coverage
Expand All @@ -82,7 +72,7 @@ unit-cover: ## Run unit tests with code coverage

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

## --------------------------------------
## Linter Targets
Expand All @@ -101,12 +91,9 @@ fmt: lint
vet: lint

.PHONY: lint
lint: $(GOLANGCI_LINT)
lint:
$(GOLANGCI_LINT) run

$(GOLANGCI_LINT):
./hack/install-golangci-lint.sh

.PHONY: manifest-lint
manifest-lint: ## Run manifest validation
./hack/manifestlint.sh
Expand Down Expand Up @@ -135,35 +122,27 @@ run-test-mode: generate fmt vet manifests ## Run against the configured Kubernet
go run -ldflags $(LDFLAGS) ./main.go -namespace=$(RUN_NAMESPACE) -dev -test-mode

.PHONY: install
install: $(KUSTOMIZE) manifests ## Install CRDs into a cluster
install: manifests ## Install CRDs into a cluster
$(KUSTOMIZE) build config/crd | kubectl apply -f -

.PHONY: uninstall
uninstall: $(KUSTOMIZE) manifests ## Uninstall CRDs from a cluster
uninstall: manifests ## Uninstall CRDs from a cluster
$(KUSTOMIZE) build config/crd | kubectl delete -f -

.PHONY: deploy
deploy: $(KUSTOMIZE) manifests ## Deploy controller in the configured Kubernetes cluster in ~/.kube/config
deploy: manifests ## Deploy controller in the configured Kubernetes cluster in ~/.kube/config
cd config/manager && kustomize edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -

.PHONY: manifests
manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) ## 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: ## Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(KUSTOMIZE) build config/default > config/render/capm3.yaml

.PHONY: generate
generate: $(CONTROLLER_GEN) ## Generate code
generate: ## Generate code
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

.PHONY: $(KUSTOMIZE)
$(KUSTOMIZE):
./tools/install_kustomize.sh

# Build the version of controller-gen that we use
$(CONTROLLER_GEN):
./hack/install-controller-gen.sh $(CONTROLLER_TOOLS_VERSION) $$(pwd)/$(CONTROLLER_GEN)

## --------------------------------------
## Docker Targets
## --------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ approvers:
- andfasano
- asalkeld
- dhellmann
- dtantsur
- hardys
- honza
- kirankt
Expand All @@ -16,6 +17,7 @@ reviewers:
- andfasano
- asalkeld
- dhellmann
- dtantsur
- hardys
- honza
- kirankt
Expand Down
6 changes: 6 additions & 0 deletions apis/metal3.io/v1alpha1/baremetalhost_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ const (
// has any sort of error.
OperationalStatusError OperationalStatus = "error"

// OperationalStatusDelayed is the status value for when the host
// deployment needs to be delayed to limit simultaneous hosts provisioning
OperationalStatusDelayed = "delayed"
)

Expand Down Expand Up @@ -546,10 +548,13 @@ type CredentialsStatus struct {
type RebootMode string

const (
// RebootModeHard defined for hard reset of a node
RebootModeHard RebootMode = "hard"
// RebootModeSoft defined for soft reset of a node
RebootModeSoft RebootMode = "soft"
)

// RebootAnnotationArguments defines the arguments of the RebootAnnotation type
type RebootAnnotationArguments struct {
Mode RebootMode `json:"mode"`
}
Expand Down Expand Up @@ -896,6 +901,7 @@ func (host *BareMetalHost) GetImageChecksum() (string, string, bool) {
return host.Spec.Image.GetChecksum()
}

// GetChecksum method returns the checksum of an image
func (image *Image) GetChecksum() (checksum, checksumType string, ok bool) {
if image == nil {
return
Expand Down
4 changes: 2 additions & 2 deletions config/certmanager/certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# More document can be found at https://docs.cert-manager.io
# WARNING: Targets CertManager 0.11 check https://docs.cert-manager.io/en/latest/tasks/upgrading/index.html for
# breaking changes
apiVersion: cert-manager.io/v1alpha2
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: selfsigned-issuer
namespace: system
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1alpha2
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_baremetalhosts.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The following patch adds a directive for certmanager to inject CA into the CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_baremetalhosts.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The following patch enables conversion webhook for CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: baremetalhosts.metal3.io
Expand Down
4 changes: 2 additions & 2 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ vars:
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1alpha2
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
# fieldref:
# fieldpath: metadata.namespace
#- name: CERTIFICATE_NAME
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1alpha2
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
#- name: SERVICE_NAMESPACE # namespace of the service
# objref:
Expand Down
4 changes: 2 additions & 2 deletions config/default/webhookcainjection_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# This patch add annotation to admission webhook config and
# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize.
apiVersion: admissionregistration.k8s.io/v1beta1
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: mutating-webhook-configuration
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
---
apiVersion: admissionregistration.k8s.io/v1beta1
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: validating-webhook-configuration
Expand Down
6 changes: 5 additions & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
envFrom:
- configMapRef:
name: ironic
Expand All @@ -37,4 +41,4 @@ spec:
port: 9440
initialDelaySeconds: 3
periodSeconds: 3
terminationGracePeriodSeconds: 10
terminationGracePeriodSeconds: 10
4 changes: 4 additions & 0 deletions config/render/capm3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
envFrom:
- configMapRef:
name: baremetal-operator-ironic
Expand Down
3 changes: 2 additions & 1 deletion controllers/metal3.io/baremetalhost_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func (r *BareMetalHostReconciler) Reconcile(ctx context.Context, request ctrl.Re
}()

reqLogger := r.Log.WithValues("baremetalhost", request.NamespacedName)
reqLogger.Info("start")

// Fetch the BareMetalHost
host := &metal3v1alpha1.BareMetalHost{}
Expand Down Expand Up @@ -213,7 +214,7 @@ func (r *BareMetalHostReconciler) Reconcile(ctx context.Context, request ctrl.Re
request: request,
bmcCredsSecret: bmcCredsSecret,
}
prov, err := r.ProvisionerFactory(*host, *bmcCreds, info.publishEvent)
prov, err := r.ProvisionerFactory(*host.DeepCopy(), *bmcCreds, info.publishEvent)
if err != nil {
return ctrl.Result{}, errors.Wrap(err, "failed to create provisioner")
}
Expand Down
4 changes: 4 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ communicate with them.
* `idrac://` (or `idrac+http://` to disable TLS).
* `idrac-virtualmedia://` to use virtual media instead of PXE
for attaching the provisioning image to the host.
* `idrac-redfish://` may be used to manage iDRAC controller with the
Redfish protocol over HTTPS. The URL must also contain a path to
the Redfish API system endpoint.
`idrac-redfish://myhost.example/redfish/v1/Systems/System.Embedded.1`
* Fujitsu iRMC
* `irmc://<host>:<port>`, where `<port>` is optional if using the default.
* HUAWEI ibmc
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
github.com/prometheus/client_golang v1.7.1
github.com/stretchr/testify v1.6.1
go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5
k8s.io/api v0.20.0
k8s.io/apimachinery v0.20.0
k8s.io/client-go v0.20.0
k8s.io/api v0.20.1
k8s.io/apimachinery v0.20.1
k8s.io/client-go v0.20.1
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
sigs.k8s.io/controller-runtime v0.7.0
sigs.k8s.io/controller-tools v0.4.1
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1147,25 +1147,25 @@ k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI=
k8s.io/api v0.17.3/go.mod h1:YZ0OTkuw7ipbe305fMpIdf3GLXZKRigjtZaV5gzC2J0=
k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78=
k8s.io/api v0.19.2/go.mod h1:IQpK0zFQ1xc5iNIQPqzgoOwuFugaYHK4iCknlAQP9nI=
k8s.io/api v0.20.0 h1:WwrYoZNM1W1aQEbyl8HNG+oWGzLpZQBlcerS9BQw9yI=
k8s.io/api v0.20.0/go.mod h1:HyLC5l5eoS/ygQYl1BXBgFzWNlkHiAuyNAbevIn+FKg=
k8s.io/api v0.20.1 h1:ud1c3W3YNzGd6ABJlbFfKXBKXO+1KdGfcgGGNgFR03E=
k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo=
k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY=
k8s.io/apiextensions-apiserver v0.19.2 h1:oG84UwiDsVDu7dlsGQs5GySmQHCzMhknfhFExJMz9tA=
k8s.io/apiextensions-apiserver v0.19.2/go.mod h1:EYNjpqIAvNZe+svXVx9j4uBaVhTB4C94HkY3w058qcg=
k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg=
k8s.io/apimachinery v0.17.3/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g=
k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA=
k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA=
k8s.io/apimachinery v0.20.0 h1:jjzbTJRXk0unNS71L7h3lxGDH/2HPxMPaQY+MjECKL8=
k8s.io/apimachinery v0.20.0/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/apimachinery v0.20.1 h1:LAhz8pKbgR8tUwn7boK+b2HZdt7MiTu2mkYtFMUjTRQ=
k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw=
k8s.io/apiserver v0.19.2/go.mod h1:FreAq0bJ2vtZFj9Ago/X0oNGC51GfubKK/ViOKfVAOA=
k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k=
k8s.io/client-go v0.17.3/go.mod h1:cLXlTMtWHkuK4tD360KpWz2gG2KtdWEr/OT02i3emRQ=
k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU=
k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA=
k8s.io/client-go v0.20.0 h1:Xlax8PKbZsjX4gFvNtt4F5MoJ1V5prDvCuoq9B7iax0=
k8s.io/client-go v0.20.0/go.mod h1:4KWh/g+Ocd8KkCwKF8vUNnmqgv+EVnQDK4MBF4oB5tY=
k8s.io/client-go v0.20.1 h1:Qquik0xNFbK9aUG92pxHYsyfea5/RPO9o9bSywNor+M=
k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y=
k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc=
k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk=
k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM=
Expand Down
27 changes: 0 additions & 27 deletions hack/install-controller-gen.sh

This file was deleted.

27 changes: 0 additions & 27 deletions hack/install-golangci-lint.sh

This file was deleted.

Loading