Skip to content

[V2] Status of GitLab resource v2beta1

Hossein Pursultani requested to merge 1511-gitlab-cr-v2beta1-status into v2

🔵 This MR is part of the implementation of Operator V2.

Summary

This is the first draft of the status for version v1beta1 of GitLab resource. It provides a generic structure for reporting the state of a GitLab instance.

Required

  • Merge Request Title and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for omnibus-gitlab opened
  • Validate potential values for new configuration settings. Formats such as integer 10, duration 10s, URI scheme://user:passwd@host:port may require quotation or other special handling when rendered in a template and written to a configuration file.

Background

See:

Key Changes

  • A new structure for GitLab resource status that relies on Condition
  • Tagged Go data types that can be serialized into JSON and used with Kubernetes code generation tooling. The CRD specification can be generated with controller-gen.

Benefits

Further Work

  • Extending the list of known Types and Reasons for various Conditions.
  • Document Go data types. It is required for documentation of OpenAPI specification.
  • Tagging Go data types with CRD validation markers

Overview

GitLab

classDiagram
  GitLab --|> TypeMeta
  GitLab --> ObjectMeta : metadata
  GitLab --> GitLabSpec : spec
  GitLab --> GitLabStatus : status

  GitLabList --|> TypeMeta
  GitLabList --> ListMeta : metadata
  GitLabList --o GitLab : items

GitLabStatus

classDiagram
  GitLabStatus --o Condition : conditions
  GitLabStatus --o ComponentStatus : componentStatuses

  ComponentStatus --> "0..1" ComponentStateWaiting : waiting
  ComponentStatus --> "0..1" ComponentStateRunning : running

Examples

Example 1

apiVersion: gitlab.com/v2beta1
kind: GitLab
metadata:
  name: example-1
spec:
  version: 16.10.0
  # ...

status:
  observedGeneration: 5
  version: 16.9.1
  conditions:
    - type: Initialized
      status: True
      lastTransitionTime: "2023-03-10T04:12:34Z"
    - type: PersistentBackendsReady
      status: False
      lastTransitionTime: "2023-03-10T04:12:34Z"
    - type: GitalyReady
      status: False
      lastTransitionTime: "2023-03-10T04:12:34Z"
  componentStatuses:
    - name: ApplicationServer
      waiting:
        reason: GitalyNotResponding
        message: Gitaly is not responding
    - name: JobProcessor
      running:
        startedAt: "2023-03-10T04:12:34Z"
  ready: false

Related issues

Edited by Hossein Pursultani

Merge request reports