You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an error when creating a ResourceGraphDefinition that includes a CRD with openAPIV3Schema fields that do not have type set.
Initially I created a bug on the FluxCD Helm Controller; the Flux maintainers recommended that KRO handle x-kubernetes-preserve-unknown-fields
Observed Behavior:
ResourceGraphDefinition does not Sync successfully with reason: Faulty Graph
Expected Behavior:
RGD syncs succesfully
Reproduction Steps (Please include ResourceGraphDefinition and Instances files):
ResourceGraphDefinition:
---
apiVersion: kro.run/v1alpha1kind: ResourceGraphDefinitionmetadata:
name: gharunnerscalesetspec:
schema:
apiVersion: v1alpha1kind: GhaRunnerScaleSetspec:
name: string | default="example-gha-runner-scale-set"image: string | default="ghcr.io/actions/actions-runner:0.2.1"chartSourceName: string | default="ghcr-arc-charts"fluxNamespace: string | default="cluster-config"interval: string | default="1h0m0s" # increase to e.g. 1h0m0s when not testinggithubConfigUrl: string | default="https://github.com/MY_ORG/MY_REPO"githubConfigSecret: string | default="github-token"workloadClientId: string | default="<YOUR_WORKLOAD_CLIENT_ID>"nodeSelector: 'map[string]string | default={"MySelectorKey": "MySelectorValue"}'azAppConfigEndpoint: string | default="https://myappconfig.azconfig.io"azAppConfigLabelFilter: string | default="kubernetes" description="fetch values matching this label filter"# Define the resources this API will manage.resources:
- id: resourceNamespacetemplate:
apiVersion: v1kind: Namespacemetadata:
name: ${schema.spec.name}
- id: serviceAccounttemplate:
apiVersion: v1kind: ServiceAccountmetadata:
name: ${schema.spec.name}-workload-idnamespace: ${schema.spec.name}annotations:
azure.workload.identity/client-id: ${schema.spec.workloadClientId}
- id: azAppConfigProvidertemplate:
apiVersion: azconfig.io/v1kind: AzureAppConfigurationProvidermetadata:
name: ${schema.spec.name}namespace: ${schema.spec.name}spec:
endpoint: ${schema.spec.azAppConfigEndpoint}target:
configMapName: ${schema.spec.name}-az-app-configauth:
workloadIdentity:
serviceAccountName: ${serviceAccount.metadata.name}secret:
target:
secretName: ${schema.spec.name}-az-app-configauth:
workloadIdentity:
serviceAccountName: ${serviceAccount.metadata.name}configuration:
selectors:
- keyFilter: github_tokenlabelFilter: ${schema.spec.azAppConfigLabelFilter}# this may fail due to the openapi schema for this CRD not having the `type` set for some properties:# `values`, `kustomize`, `postRenderers`, `patchesStrategicMerge`# if this occurs, you can manually edit the CRD to have `type: object` for each offending property
- id: helmReleasetemplate:
apiVersion: helm.toolkit.fluxcd.io/v2kind: HelmReleasemetadata:
name: ${schema.spec.name}namespace: ${schema.spec.fluxNamespace}spec:
targetNamespace: ${schema.spec.name}releaseName: ${schema.spec.name}chart:
spec:
chart: gha-runner-scale-setsourceRef:
kind: HelmRepositoryname: ${schema.spec.chartSourceName}namespace: ${schema.spec.fluxNamespace}interval: "2m0s"install:
remediation:
retries: 3# https://github.com/actions/actions-runner-controller/tree/master/charts/gha-runner-scale-set/values.yamlvalues:
githubConfigUrl: ${schema.spec.githubConfigUrl}githubConfigSecret: ${azAppConfigProvider.spec.secret.target.secretName}listenerTemplate:
spec:
nodeSelector: ${schema.spec.nodeSelector}containers:
- name: listenertemplate:
metadata:
labels:
azure.workload.identity/use: "true"spec:
nodeSelector: ${schema.spec.nodeSelector}serviceAccountName: ${serviceAccount.metadata.name}initContainers:
- name: init-dind-externalsimage: ${schema.spec.image}command: ["cp", "-r", "-v", "/home/runner/externals/.", "/home/runner/tmpDir/"]volumeMounts:
- name: dind-externalsmountPath: /home/runner/tmpDircontainers:
- name: runnerimage: ${schema.spec.image}command: ["/home/runner/run.sh"]env:
- name: DOCKER_HOSTvalue: unix:///var/run/docker.sockvolumeMounts:
- name: workmountPath: /home/runner/_work
- name: dind-sockmountPath: /var/run
- name: dindimage: docker:dindargs:
- dockerd
- --host=unix:///var/run/docker.sock
- --group=$(DOCKER_GROUP_GID)env:
- name: DOCKER_GROUP_GIDvalue: "123"securityContext:
privileged: truevolumeMounts:
- name: workmountPath: /home/runner/_work
- name: dind-sockmountPath: /var/run
- name: dind-externalsmountPath: /home/runner/externalsvolumes:
- name: workemptyDir: {}
- name: dind-sockemptyDir: {}
- name: dind-externalsemptyDir: {}
No instance yaml needed, the error is on the RGD itself, not an instance of the RGD.
Versions:
kro version: 0.2.1
Kubernetes Version (kubectl version):
Client Version: v1.32.0
Kustomize Version: v5.5.0
Server Version: v1.31.5
Involved Controllers:
Controller URLs and Versions (if applicable):
Error Logs (if applicable)**:
failed to build resource "helmRelease": failed to generate dummy CR for resource helmRelease: error generating field spec: error generating field values: schema type is empty and has no properties
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Which option describes the most your issue?
No response
The text was updated successfully, but these errors were encountered:
jknutson
changed the title
KRO fails to generate ResourceGraphDefinition when type is not set
KRO fails to generate ResourceGraphDefinition when OpenAPI Schema type is not set
Feb 19, 2025
Description
I am encountering an error when creating a ResourceGraphDefinition that includes a CRD with openAPIV3Schema fields that do not have
type
set.Initially I created a bug on the FluxCD Helm Controller; the Flux maintainers recommended that KRO handle
x-kubernetes-preserve-unknown-fields
Observed Behavior:
ResourceGraphDefinition does not Sync successfully with reason: Faulty Graph
Expected Behavior:
RGD syncs succesfully
Reproduction Steps (Please include
ResourceGraphDefinition
andInstances
files):ResourceGraphDefinition:
No instance yaml needed, the error is on the RGD itself, not an instance of the RGD.
Versions:
kubectl version
):Involved Controllers:
Error Logs (if applicable)**:
Which option describes the most your issue?
No response
The text was updated successfully, but these errors were encountered: