diff --git a/config/crd/bases/boot.ironcore.dev_httpbootconfigs.yaml b/config/crd/bases/boot.ironcore.dev_httpbootconfigs.yaml new file mode 100644 index 00000000..1f4bb221 --- /dev/null +++ b/config/crd/bases/boot.ironcore.dev_httpbootconfigs.yaml @@ -0,0 +1,80 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: httpbootconfigs.boot.ironcore.dev +spec: + group: boot.ironcore.dev + names: + kind: HTTPBootConfig + listKind: HTTPBootConfigList + plural: httpbootconfigs + singular: httpbootconfig + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: HTTPBootConfig is the Schema for the httpbootconfigs API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: HTTPBootConfigSpec defines the desired state of HTTPBootConfig + properties: + cmdLine: + type: string + ignitionSecretRef: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? + type: string + type: object + x-kubernetes-map-type: atomic + initrdURL: + type: string + kernelURL: + type: string + squashfsURL: + type: string + systemIP: + items: + type: string + type: array + systemUUID: + type: string + type: object + status: + description: HTTPBootConfigStatus defines the observed state of HTTPBootConfig + properties: + state: + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/boot.ironcore.dev_ipxebootconfigs.yaml b/config/crd/bases/boot.ironcore.dev_ipxebootconfigs.yaml index 40d798f9..a4d42a29 100644 --- a/config/crd/bases/boot.ironcore.dev_ipxebootconfigs.yaml +++ b/config/crd/bases/boot.ironcore.dev_ipxebootconfigs.yaml @@ -82,9 +82,8 @@ spec: description: IPXEBootConfigStatus defines the observed state of IPXEBootConfig properties: state: - description: |- - INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - Important: Run "make" to regenerate code after modifying this file + description: 'Important: Run "make" to regenerate code after modifying + this file' type: string type: object type: object diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 468db5f7..cd557415 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -12,6 +12,32 @@ rules: - get - list - watch +- apiGroups: + - boot.ironcore.dev + resources: + - httpbootconfigs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - boot.ironcore.dev + resources: + - httpbootconfigs/finalizers + verbs: + - update +- apiGroups: + - boot.ironcore.dev + resources: + - httpbootconfigs/status + verbs: + - get + - patch + - update - apiGroups: - boot.ironcore.dev resources: @@ -77,3 +103,11 @@ rules: - get - patch - update +- apiGroups: + - metal.ironcore.dev + resources: + - servers + verbs: + - get + - list + - watch diff --git a/internal/controller/serverbootconfiguration_controller.go b/internal/controller/serverbootconfiguration_controller.go index 9ea99c02..b3e7830d 100644 --- a/internal/controller/serverbootconfiguration_controller.go +++ b/internal/controller/serverbootconfiguration_controller.go @@ -45,6 +45,7 @@ type ServerBootConfigurationReconciler struct { //+kubebuilder:rbac:groups=metal.ironcore.dev,resources=serverbootconfigurations/finalizers,verbs=update //+kubebuilder:rbac:groups=boot.ironcore.dev,resources=ipxebootconfig,verbs=get;list;watch;create;delete;patch //+kubebuilder:rbac:groups=boot.ironcore.dev,resources=ipxebootconfig/status,verbs=get +//+kubebuilder:rbac:groups=metal.ironcore.dev,resources=servers,verbs=get;list;watch // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state.