Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
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.
670 changes: 467 additions & 203 deletions .obs/chartfile/elemental-operator-crds-helm/templates/crds.yaml

Large diffs are not rendered by default.

169 changes: 11 additions & 158 deletions .obs/chartfile/elemental-operator-helm/templates/cluster_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ rules:
- ""
resources:
- configmaps
- pods
- secrets
- services
verbs:
- create
- delete
Expand All @@ -22,42 +25,14 @@ rules:
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods/log
verbs:
- get
- apiGroups:
- ""
resources:
- pods/status
- services/status
verbs:
- get
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand All @@ -68,24 +43,6 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- services/status
verbs:
- get
- apiGroups:
- cluster.x-k8s.io
resources:
Expand All @@ -98,47 +55,12 @@ rules:
- elemental.cattle.io
resources:
- machineinventories
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- elemental.cattle.io
resources:
- machineinventories/status
verbs:
- get
- patch
- update
- apiGroups:
- elemental.cattle.io
resources:
- machineinventoryselectors
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- elemental.cattle.io
resources:
- machineinventoryselectors/status
verbs:
- get
- list
- patch
- update
- apiGroups:
- elemental.cattle.io
resources:
- machineregistrations
- managedosimages
- managedosversionchannels
- managedosversions
- seedimages
verbs:
- create
- delete
Expand All @@ -150,94 +72,25 @@ rules:
- apiGroups:
- elemental.cattle.io
resources:
- machineinventories/status
- machineregistrations/status
- seedimages/status
verbs:
- get
- patch
- update
- apiGroups:
- elemental.cattle.io
resources:
- managedosimages
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- elemental.cattle.io
resources:
- machineinventoryselectors/status
- managedosimages/status
verbs:
- get
- list
- patch
- update
- apiGroups:
- elemental.cattle.io
resources:
- managedosversionchannels
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- elemental.cattle.io
resources:
- managedosversionchannels/status
verbs:
- get
- list
- patch
- update
- apiGroups:
- elemental.cattle.io
resources:
- managedosversions
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- elemental.cattle.io
resources:
- managedosversions/status
verbs:
- get
- list
- patch
- update
- apiGroups:
- elemental.cattle.io
resources:
- seedimages
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- elemental.cattle.io
resources:
- seedimages/status
verbs:
- get
- patch
- update
- apiGroups:
- fleet.cattle.io
resources:
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
export ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
CHART?=$(shell find $(ROOT_DIR) -type f -name "elemental-operator-$(CHART_VERSION).tgz" -print)
CHART_CRDS?=$(shell find $(ROOT_DIR) -type f -name "elemental-operator-crds-$(CHART_VERSION).tgz" -print)
KUBE_VERSION?="v1.27.10"
KUBE_VERSION?="v1.34.1"
CLUSTER_NAME?="operator-e2e"
COMMITDATE?=$(shell git log -n1 --format="%as")
GO_TPM_TAG?=$(shell grep google/go-tpm-tools go.mod | awk '{print $$2}')
Expand All @@ -39,20 +39,20 @@ GO_INSTALL := ./scripts/go_install.sh

# Binaries.
# Need to use abspath so we can invoke these from subdirectories
CONTROLLER_GEN_VER := v0.14.0
CONTROLLER_GEN_VER := v0.19.0
CONTROLLER_GEN := $(ABS_TOOLS_DIR)/controller-gen-$(CONTROLLER_GEN_VER)
CONTROLLER_GEN_PKG := sigs.k8s.io/controller-tools/cmd/controller-gen

GINKGO_VER := $(shell go list -m github.com/onsi/ginkgo/v2 | awk '{print $$2}')
GINKGO := $(ABS_TOOLS_DIR)/ginkgo-$(GINKGO_VER)
GINKGO_PKG := github.com/onsi/ginkgo/v2/ginkgo

SETUP_ENVTEST_VER := v0.0.0-20240213082838-4282ca1767dc
SETUP_ENVTEST_VER := release-0.22
SETUP_ENVTEST := $(ABS_TOOLS_DIR)/setup-envtest-$(SETUP_ENVTEST_VER)
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest

# See: https://storage.googleapis.com/kubebuilder-tools
ENVTEST_K8S_VERSION := 1.27.1
ENVTEST_K8S_VERSION := 1.34.1

KUSTOMIZE_VER := v5.3.0
KUSTOMIZE := $(ABS_TOOLS_DIR)/kustomize-$(KUSTOMIZE_VER)
Expand Down Expand Up @@ -173,7 +173,7 @@ validate:

.PHONY: unit-tests
unit-tests: $(SETUP_ENVTEST) $(GINKGO)
KUBEBUILDER_ASSETS="$(shell $(SETUP_ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(ABS_TOOLS_DIR) -p path)" $(GINKGO) -v -r --trace --race --covermode=atomic --coverprofile=coverage.out --coverpkg=github.com/rancher/elemental-operator/... ./pkg/... ./controllers/... ./cmd/...
KUBEBUILDER_ASSETS="$(shell $(SETUP_ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(ABS_TOOLS_DIR) -p path)" $(GINKGO) -vv -r --trace --race --covermode=atomic --coverprofile=coverage.out --coverpkg=github.com/rancher/elemental-operator/... ./pkg/... ./controllers/... ./cmd/...

.PHONY: airgap-script-test
airgap-script-test:
Expand Down
3 changes: 3 additions & 0 deletions cmd/register/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package main
import (
"errors"
"fmt"
"path/filepath"
"strings"
"time"

"github.com/jaypipes/ghw"
Expand Down Expand Up @@ -229,6 +231,7 @@ func initConfig(fs vfs.FS) error {
// Set final config path
log.Infof("Using base configuration file: %s", configPath)
viper.SetConfigFile(configPath)
viper.SetConfigType(strings.TrimLeft(filepath.Ext(configPath), "."))
// Merge config (considering bound flags)
if err := viper.MergeInConfig(); err != nil {
return fmt.Errorf("merging config: %w", err)
Expand Down
43 changes: 6 additions & 37 deletions config/crd/bases/elemental.cattle.io_machineinventories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.19.0
name: machineinventories.elemental.cattle.io
spec:
group: elemental.cattle.io
Expand Down Expand Up @@ -39,24 +39,8 @@ spec:
properties:
ipAddressClaims:
additionalProperties:
description: |-
ObjectReference contains enough information to let you inspect or modify the referred object.
---
New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs.
1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage.
2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular
restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted".
Those cannot be well described when embedded.
3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen.
4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity
during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple
and the version of the actual struct is irrelevant.
5. We cannot easily change it. Because this type is embedded in many locations, updates to this type
will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control.


Instead of using this type, create a locally provided and used type that is well-focused on your reference.
For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .
description: ObjectReference contains enough information to let
you inspect or modify the referred object.
properties:
apiVersion:
description: API version of the referent.
Expand All @@ -70,7 +54,6 @@ spec:
the event) or if no container name is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only to have some well-defined way of
referencing a part of an object.
TODO: this design is not final and this field is subject to change in the future.
type: string
kind:
description: |-
Expand Down Expand Up @@ -172,16 +155,8 @@ spec:
description: Conditions describe the state of the machine inventory
object.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
Expand Down Expand Up @@ -222,12 +197,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
Expand Down Expand Up @@ -261,7 +231,6 @@ spec:
the event) or if no container name is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only to have some well-defined way of
referencing a part of an object.
TODO: this design is not final and this field is subject to change in the future.
type: string
kind:
description: |-
Expand Down
Loading
Loading