Skip to content

Conversation

@BoxBoxJason
Copy link

@BoxBoxJason BoxBoxJason commented Nov 28, 2025

Description of your changes

The goal of this PR is to introduce a way to support application settings configuration for the gitlab instance using the provider. This is greatly inspired from the terraform gitlab provider application settings resource

Fixes #243

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

What was added:

  • A new "instance" api, in addition to the projects and groups, to update instance wide settings (for self hosted instances), it does not work on gitlab.com of course.
  • A new "ApplicationSettings" CRD / controller / api to reconcile gitlab instance settings
  • two generation function that are used to make type assignments / comparisons / generations from reflection of gitlab client-go types

How has this code been tested

  • I have a self hosted gitlab instance in my homelab (I can share the link with reviewers if required)

  • I don't use docker (and I don't have it installed), instead I use podman on my Fedora 43 (Workstation) machine

  • I setup a kind cluster with the KIND_EXPERIMENTAL_PROVIDER=podman, using kind create cluster --name gitlab

  • I install the crossplane helm chart

    1. helm repo add crossplane-stable https://charts.crossplane.io/stable
    2. helm install crossplane --namespace crossplane-system --create-namespace crossplane-stable/crossplane
  • I build the go code make go.build and then run it ./_output/bin/linux_amd64/provider --debug

  • I create the secret with my PAT (admin permissions) k create secret generic gitlab-credentials -n crossplane-system --from-literal=token=EXAMPLE_VALUE

  • I apply the providerconfig manifest:

    apiVersion: gitlab.m.crossplane.io/v1beta1
    kind: ProviderConfig
    metadata:
      name: gitlab-provider
      namespace: default
    spec:
      baseURL: https://REDACTED_URL/
      credentials:
        source: Secret
        method: PersonalAccessToken
        secretRef:
          namespace: crossplane-system
          name: gitlab-credentials
          key: token
  • I apply the applicationSettings manifest (this is a reduced number of values to not jam the description):

    apiVersion: instance.gitlab.m.crossplane.io/v1alpha1
    kind: ApplicationSettings
    metadata:
      name: boxboxjason-settings
      namespace: default
    spec:
      providerConfigRef:
        name: gitlab-provider
        kind: ProviderConfig
      forProvider:
        maxArtifactsSize: 222
        silentModeEnabled: true
  • I check that parameters are applied and no errors appears.

  • I update the CRD with new values and check again for errors / that they are applied

  • I update the gitlab settings manually and confirm that they are reconciled

  • I delete the resource and check that nothing new happens, the resource gets deleted properly

@BoxBoxJason BoxBoxJason force-pushed the feat/application-settings branch 3 times, most recently from b716312 to e76b029 Compare November 30, 2025 23:33
add a generator function for easy conversion on updates

Signed-off-by: BoxBoxJason <[email protected]>
@BoxBoxJason BoxBoxJason force-pushed the feat/application-settings branch 2 times, most recently from b44815f to ae5ec2b Compare December 2, 2025 22:17
@BoxBoxJason BoxBoxJason force-pushed the feat/application-settings branch from ae5ec2b to fe5ed77 Compare December 2, 2025 22:24
@BoxBoxJason BoxBoxJason marked this pull request as ready for review December 6, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Application Settings configuration

1 participant