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 #109

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
484c3d7
Render BMO deployment
kashifest Oct 8, 2020
e4fcc9b
Merge pull request #672 from Nordix/create/bmo-deployment-yaml
metal3-io-bot Oct 8, 2020
ae1c752
Fix tls cert path to config dir
kashifest Oct 8, 2020
2f52643
Initial InspectHardware unit tests
andfasano Sep 24, 2020
25856de
CAPM3 specific config changes
kashifest Oct 8, 2020
f7f8b35
Merge pull request #674 from Nordix/add/capm3-config
metal3-io-bot Oct 8, 2020
10dcca8
Add missing ironic bmo configmap in config/default
kashifest Oct 9, 2020
59fc6b6
Merge pull request #675 from Nordix/add/missing-ironic-configmap
maelk Oct 9, 2020
fc92f4b
Merge pull request #671 from Nordix/fix/tls-cert-path
maelk Oct 9, 2020
8ac00e7
Fix kustomization path
kashifest Oct 9, 2020
0ab615c
Merge pull request #676 from Nordix/fix/kustomize-path
maelk Oct 9, 2020
6535521
Fix tls kustomization path
kashifest Oct 9, 2020
ccdd30a
Merge pull request #677 from Nordix/fix/auth-kustomize
maelk Oct 9, 2020
4e34384
Remove old deploy directory
kashifest Oct 9, 2020
209dbd0
Fix image name in manager + other small nits
kashifest Oct 9, 2020
1e82298
Merge pull request #679 from Nordix/fix/image-name
maelk Oct 9, 2020
7d1178b
Add missing RBAC for secrets and events
kashifest Oct 9, 2020
525005d
Merge pull request #680 from Nordix/fix/rbac-secret
dhellmann Oct 9, 2020
4f5bdfe
Merge pull request #649 from andfasano/unit-test-inspect-hardware
metal3-io-bot Oct 9, 2020
48f1050
Merge pull request #678 from Nordix/remove/deploy-directory
metal3-io-bot Oct 10, 2020
fdc7158
Correct the description of HardwareDetails fields
zaneb Sep 29, 2020
355a71e
Update deploying document to reflect recent changes
furkatgofurov7 Oct 14, 2020
0aca948
remove test dependency from docker build
dhellmann Oct 14, 2020
c1e4e86
Merge pull request #657 from zaneb/disk-nic-descriptions
metal3-io-bot Oct 14, 2020
a6d4f1f
Merge pull request #683 from dhellmann/docker-no-test
metal3-io-bot Oct 14, 2020
75e5286
Re-enable IRONIC_FAST_TRACK and set Online to true when rendering BMH…
furkatgofurov7 Oct 15, 2020
10ecde8
use helper to create test ironic server
dhellmann Sep 22, 2020
1c892aa
make bmc.RegisterFactory public
dhellmann Sep 22, 2020
49db67c
require a valid bmc address value for all hosts
dhellmann Sep 22, 2020
5233b6d
ensure ironic provisioner requires boot mac when driver does
dhellmann Sep 22, 2020
4dd9c74
ensure ironic provisioner makes boot mac optional when driver does
dhellmann Sep 22, 2020
5c57195
add a test to show the provisioner can create nodes
dhellmann Sep 23, 2020
c167d52
ironic mock: register nodes by uuid and/or name
dhellmann Oct 13, 2020
88e8cdd
Update golang to latest across all repos
furkatgofurov7 Oct 19, 2020
c34c8ba
Fix path in install kustomize
honza Oct 19, 2020
a1b2cea
Add contoller-gen to go.mod
honza Oct 19, 2020
3111ee0
Merge pull request #682 from Nordix/kustomize-doc-update
metal3-io-bot Oct 20, 2020
cc79fb7
Merge pull request #687 from honza/kustomize-bug
metal3-io-bot Oct 20, 2020
dbcb214
Merge pull request #686 from Nordix/update-go-version-furkat
metal3-io-bot Oct 20, 2020
d055c59
Merge pull request #647 from dhellmann/unit-test-validate-management-…
metal3-io-bot Oct 20, 2020
6ce7bc3
Merge pull request #684 from Nordix/enable-fasttrack
metal3-io-bot Oct 21, 2020
1023cbf
Merge pull request #688 from honza/controller-gen-go-mod
metal3-io-bot Oct 21, 2020
b7b4259
Merge upstream
honza Oct 21, 2020
9531ae8
Update vendor
honza Oct 21, 2020
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
- docker

go:
- "1.13.7"
- "1.15.3"

env:
- TARGET=unit-verbose
Expand Down
35 changes: 24 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
FROM registry.svc.ci.openshift.org/ocp/builder:rhel-8-golang-1.15-openshift-4.7 AS builder
WORKDIR /go/src/github.com/metal3-io/baremetal-operator
# Build the manager binary
FROM registry.hub.docker.com/library/golang:1.15.3 AS builder

WORKDIR /workspace

# Bring in the go dependencies before anything else so we can take
# advantage of caching these layers in future builds.
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download

COPY . .
RUN make build
RUN make tools

FROM registry.svc.ci.openshift.org/ocp/4.7:base
COPY --from=builder /go/src/github.com/metal3-io/baremetal-operator/bin/manager /baremetal-operator
COPY --from=builder /go/src/github.com/metal3-io/baremetal-operator/bin/get-hardware-details /
COPY --from=builder /go/src/github.com/metal3-io/baremetal-operator/bin/make-bm-worker /
COPY --from=builder /go/src/github.com/metal3-io/baremetal-operator/bin/make-virt-host /
RUN if ! rpm -q genisoimage; then yum install -y genisoimage && yum clean all && rm -rf /var/cache/yum/*; fi
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o baremetal-operator main.go

# Copy the controller-manager into a thin image
# BMO has a dependency preventing us to use the static one,
# using the base one instead
FROM gcr.io/distroless/base:latest
WORKDIR /
COPY --from=builder /workspace/baremetal-operator .
USER nonroot:nonroot
ENTRYPOINT ["/baremetal-operator"]

LABEL io.k8s.display-name="Metal3 BareMetal Operator" \
io.k8s.description="This is the image for the Metal3 BareMetal Operator."
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ BUILD_VERSION ?= $(shell git describe --always --abbrev=40 --dirty)
export LDFLAGS="-X github.com/metal3-io/baremetal-operator/pkg/version.Raw=${BUILD_VERSION} -X github.com/metal3-io/baremetal-operator/pkg/version.Commit=${SOURCE_GIT_COMMIT}"

# Set some variables the operator expects to have in order to work
# Those need to be the same as in deploy/ironic_ci.env
# Those need to be the same as in config/default/ironic.env
export OPERATOR_NAME=baremetal-operator
export DEPLOY_KERNEL_URL=http://172.22.0.1:6180/images/ironic-python-agent.kernel
export DEPLOY_RAMDISK_URL=http://172.22.0.1:6180/images/ironic-python-agent.initramfs
Expand Down Expand Up @@ -134,16 +134,17 @@ install: $(KUSTOMIZE) manifests ## Install CRDs into a cluster

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

.PHONY: deploy
deploy: $(KUSTOMIZE) 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 -
$(KUSTOMIZE) build config/default | kubectl apply -f -

.PHONY: manifests
manifests: $(CONTROLLER_GEN) ## 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: $(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
$(KUSTOMIZE) build config/default > config/render/capm3.yaml

.PHONY: generate
generate: $(CONTROLLER_GEN) ## Generate code
Expand All @@ -162,7 +163,7 @@ $(CONTROLLER_GEN):
## --------------------------------------

.PHONY: docker
docker: test ## Build the docker image
docker: generate manifests ## Build the docker image
docker build . -t ${IMG}

# Push the docker image
Expand Down
4 changes: 2 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def validate_auth():

tilt_helper_dockerfile_header = """
# Tilt image
FROM golang:1.14 as tilt-helper
FROM golang:1.15.3 as tilt-helper
# Support live reloading with Tilt
RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/restart.sh && \
wget --output-document /start.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/start.sh && \
Expand Down Expand Up @@ -139,7 +139,7 @@ def enable_provider(name):
os.environ.update(substitutions)

# Apply the kustomized yaml for this provider
yaml = str(kustomizesub(context + "/deploy/default"))
yaml = str(kustomizesub(context + "/config"))
k8s_yaml(blob(yaml))

def kustomizesub(folder):
Expand Down
14 changes: 8 additions & 6 deletions apis/metal3.io/v1alpha1/baremetalhost_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ type CPU struct {

// Storage describes one storage device (disk, SSD, etc.) on the host.
type Storage struct {
// A name for the disk, e.g. "disk 1 (boot)"
// The Linux device name of the disk, e.g. "/dev/sda". Note that this
// may not be stable across reboots.
Name string `json:"name"`

// Whether this disk represents rotational storage
Expand Down Expand Up @@ -406,20 +407,21 @@ type VLAN struct {

// NIC describes one network interface on the host.
type NIC struct {
// The name of the NIC, e.g. "nic-1"
// The name of the network interface, e.g. "en0"
Name string `json:"name"`

// The name of the model, e.g. "virt-io"
// The vendor and product IDs of the NIC, e.g. "0x8086 0x1572"
Model string `json:"model"`

// The device MAC addr
// The device MAC address
// +kubebuilder:validation:Pattern=`[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}`
MAC string `json:"mac"`

// The IP address of the device
// The IP address of the interface. This will be an IPv4 address if one is
// present, and only an IPv6 address if there is no IPv4 address.
IP string `json:"ip"`

// The speed of the device
// The speed of the device in Gigabits per second
SpeedGbps int `json:"speedGbps"`

// The VLANs available
Expand Down
2 changes: 1 addition & 1 deletion cmd/make-bm-worker/templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kind: BareMetalHost
metadata:
name: {{ .Name }}
spec:
online: false
online: true
{{- if .HardwareProfile }}
hardwareProfile: {{ .HardwareProfile }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions cmd/make-bm-worker/templates/templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ kind: BareMetalHost
metadata:
name: hostname
spec:
online: false
online: true
hardwareProfile: hardware profile
bmc:
address: bmcAddress
Expand Down Expand Up @@ -86,7 +86,7 @@ kind: BareMetalHost
metadata:
name: hostname
spec:
online: false
online: true
bmc:
address: bmcAddress
credentialsName: hostname-bmc-secret
Expand Down Expand Up @@ -122,7 +122,7 @@ kind: BareMetalHost
metadata:
name: hostname
spec:
online: false
online: true
bmc:
address: bmcAddress
credentialsName: hostname-bmc-secret
Expand Down
2 changes: 1 addition & 1 deletion cmd/make-virt-host/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ kind: BareMetalHost
metadata:
name: {{ .Domain }}
spec:
online: false
online: true
bmc:
address: libvirt://192.168.122.1:{{ .BMCPort }}/
credentialsName: {{ .Domain }}-bmc-secret
Expand Down
1 change: 1 addition & 0 deletions config/basic-auth/default/credentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
Expand Down
3 changes: 2 additions & 1 deletion config/basic-auth/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: metal3
namespace: baremetal-operator-system
resources:
- ../../default
- ../../namespace

secretGenerator:
- name: ironic-credentials
Expand Down
1 change: 1 addition & 0 deletions config/basic-auth/tls/credentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
Expand Down
2 changes: 1 addition & 1 deletion config/basic-auth/tls/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: metal3
namespace: baremetal-operator-system
resources:
- ../../tls

Expand Down