Add ready conditon and cleanup finalizer and status patching (#186)

This change adds a ready condition. It also sets a standard for status
fields and documentation. It makes use of helper functions from FluxCD
to better manage patching of finalizers and status.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
Philip Laine
2026-04-21 15:42:11 +02:00
committed by GitHub
parent 1bcd58a7cd
commit af11e31b28
19 changed files with 250 additions and 181 deletions
@@ -14,10 +14,17 @@ spec:
singular: group
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: Group is the Schema for the groups API
description: Group is the Schema for the groups API.
properties:
apiVersion:
description: |-
@@ -37,21 +44,22 @@ spec:
metadata:
type: object
spec:
description: spec defines the desired state of Group
description: GroupSpec defines the desired state of Group.
properties:
name:
description: name of the group.
description: Name of the group.
minLength: 1
type: string
required:
- name
type: object
status:
description: status defines the observed state of Group
default:
observedGeneration: -1
description: GroupStatus defines the observed state of Group.
properties:
conditions:
description: The status of each condition is one of True, False, or
Unknown.
description: Conditions holds the conditions for the Group.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
@@ -111,7 +119,12 @@ spec:
- type
x-kubernetes-list-type: map
groupID:
description: GroupID is the id of the created group.
type: string
observedGeneration:
description: ObservedGeneration is the last reconciled generation.
format: int64
type: integer
type: object
required:
- spec
@@ -14,10 +14,17 @@ spec:
singular: setupkey
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: SetupKey is the Schema for the setupkeys API
description: SetupKey is the Schema for the setupkeys API.
properties:
apiVersion:
description: |-
@@ -37,11 +44,11 @@ spec:
metadata:
type: object
spec:
description: spec defines the desired state of SetupKey
description: SetupKeySpec defines the desired state of SetupKey.
properties:
autoGroups:
description: Groups that will be automatically assigned to resources
using setup key.
description: AutoGroups are groups that will be automatically assigned
to peers using setup key.
items:
properties:
id:
@@ -84,11 +91,12 @@ spec:
- ephemeral
type: object
status:
description: status defines the observed state of SetupKey
default:
observedGeneration: -1
description: SetupKeyStatus defines the observed state of SetupKey.
properties:
conditions:
description: The status of each condition is one of True, False, or
Unknown.
description: Conditions holds the conditions for the SetupKey.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
@@ -147,8 +155,12 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
observedGeneration:
description: ObservedGeneration is the last reconciled generation.
format: int64
type: integer
setupKeyID:
description: SetupKeyID of the setup key.
description: SetupKeyID is the id of the created setup key.
type: string
type: object
required: