argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
15.11k stars 3.21k forks source link

build: don't minimize CRD for `WorkflowEventBinding` and `WorkflowArtifactGCTask`. Fixes #12166 #13754

Closed MasonM closed 1 month ago

MasonM commented 1 month ago

Fixes #12166. Partial fix for #8190

Motivation

The CRDs under manifests/base/crds/minimal/ are minimized as a workaround for https://github.com/kubernetes/kubernetes/issues/82292. However, WorkflowEventBinding and WorkflowArtifactGCTask are small enough that minimization isn't necessary. Including the full CRD enables users to use kubectl explain to explore the CRD definitions.

Modifications

Verification

Ran make start and verified kubectl explain returns spec details for the CRDs:

Click here for kubectl explain --recursive WorkflowEventBinding output ``` $ kubectl explain --recursive WorkflowEventBinding GROUP: argoproj.io KIND: WorkflowEventBinding VERSION: v1alpha1 DESCRIPTION: FIELDS: apiVersion kind metadata -required- annotations creationTimestamp deletionGracePeriodSeconds deletionTimestamp finalizers <[]string> generateName generation labels managedFields <[]ManagedFieldsEntry> apiVersion fieldsType fieldsV1 manager operation subresource time name namespace ownerReferences <[]OwnerReference> apiVersion -required- blockOwnerDeletion controller kind -required- name -required- uid -required- resourceVersion selfLink uid spec -required- event -required- selector -required- submit arguments artifacts <[]Object> archive none tar compressionLevel zip archiveLogs artifactGC podMetadata annotations labels serviceAccountName strategy artifactory passwordSecret key -required- name optional url -required- usernameSecret key -required- name optional azure accountKeySecret key -required- name optional blob -required- container -required- endpoint -required- useSDKCreds deleted from fromExpression gcs bucket key -required- serviceAccountKeySecret key -required- name optional git branch depth disableSubmodules fetch <[]string> insecureIgnoreHostKey passwordSecret key -required- name optional repo -required- revision singleBranch sshPrivateKeySecret key -required- name optional usernameSecret key -required- name optional globalName hdfs addresses <[]string> dataTransferProtection force hdfsUser krbCCacheSecret key -required- name optional krbConfigConfigMap key -required- name optional krbKeytabSecret key -required- name optional krbRealm krbServicePrincipalName krbUsername path -required- http auth basicAuth passwordSecret key -required- name optional usernameSecret key -required- name optional clientCert clientCertSecret key -required- name optional clientKeySecret key -required- name optional oauth2 clientIDSecret key -required- name optional clientSecretSecret key -required- name optional endpointParams <[]Object> key -required- value scopes <[]string> tokenURLSecret key -required- name optional headers <[]Object> name -required- value -required- url -required- mode name -required- optional oss accessKeySecret key -required- name optional bucket createBucketIfNotPresent endpoint key -required- lifecycleRule markDeletionAfterDays markInfrequentAccessAfterDays secretKeySecret key -required- name optional securityToken useSDKCreds path raw data -required- recurseMode s3 accessKeySecret key -required- name optional bucket caSecret key -required- name optional createBucketIfNotPresent objectLocking encryptionOptions enableEncryption kmsEncryptionContext kmsKeyId serverSideCustomerKeySecret key -required- name optional endpoint insecure key region roleARN secretKeySecret key -required- name optional sessionTokenSecret key -required- name optional useSDKCreds subPath parameters <[]Object> default description enum <[]string> globalName name -required- value valueFrom configMapKeyRef key -required- name optional default event expression jqFilter jsonPath parameter path supplied metadata workflowTemplateRef -required- clusterScope name ```
Click here for kubectl explain --recursive WorkflowArtifactGCTask output ``` $ kubectl explain --recursive WorkflowArtifactGCTask GROUP: argoproj.io KIND: WorkflowArtifactGCTask VERSION: v1alpha1 DESCRIPTION: FIELDS: apiVersion kind metadata -required- annotations creationTimestamp deletionGracePeriodSeconds deletionTimestamp finalizers <[]string> generateName generation labels managedFields <[]ManagedFieldsEntry> apiVersion fieldsType fieldsV1 manager operation subresource time name namespace ownerReferences <[]OwnerReference> apiVersion -required- blockOwnerDeletion controller kind -required- name -required- uid -required- resourceVersion selfLink uid spec -required- artifactsByNode archiveLocation archiveLogs artifactory passwordSecret key -required- name optional url -required- usernameSecret key -required- name optional azure accountKeySecret key -required- name optional blob -required- container -required- endpoint -required- useSDKCreds gcs bucket key -required- serviceAccountKeySecret key -required- name optional git branch depth disableSubmodules fetch <[]string> insecureIgnoreHostKey passwordSecret key -required- name optional repo -required- revision singleBranch sshPrivateKeySecret key -required- name optional usernameSecret key -required- name optional hdfs addresses <[]string> dataTransferProtection force hdfsUser krbCCacheSecret key -required- name optional krbConfigConfigMap key -required- name optional krbKeytabSecret key -required- name optional krbRealm krbServicePrincipalName krbUsername path -required- http auth basicAuth passwordSecret key -required- name optional usernameSecret key -required- name optional clientCert clientCertSecret key -required- name optional clientKeySecret key -required- name optional oauth2 clientIDSecret key -required- name optional clientSecretSecret key -required- name optional endpointParams <[]Object> key -required- value scopes <[]string> tokenURLSecret key -required- name optional headers <[]Object> name -required- value -required- url -required- oss accessKeySecret key -required- name optional bucket createBucketIfNotPresent endpoint key -required- lifecycleRule markDeletionAfterDays markInfrequentAccessAfterDays secretKeySecret key -required- name optional securityToken useSDKCreds raw data -required- s3 accessKeySecret key -required- name optional bucket caSecret key -required- name optional createBucketIfNotPresent objectLocking encryptionOptions enableEncryption kmsEncryptionContext kmsKeyId serverSideCustomerKeySecret key -required- name optional endpoint insecure key region roleARN secretKeySecret key -required- name optional sessionTokenSecret key -required- name optional useSDKCreds artifacts archive none tar compressionLevel zip archiveLogs artifactGC podMetadata annotations labels serviceAccountName strategy artifactory passwordSecret key -required- name optional url -required- usernameSecret key -required- name optional azure accountKeySecret key -required- name optional blob -required- container -required- endpoint -required- useSDKCreds deleted from fromExpression gcs bucket key -required- serviceAccountKeySecret key -required- name optional git branch depth disableSubmodules fetch <[]string> insecureIgnoreHostKey passwordSecret key -required- name optional repo -required- revision singleBranch sshPrivateKeySecret key -required- name optional usernameSecret key -required- name optional globalName hdfs addresses <[]string> dataTransferProtection force hdfsUser krbCCacheSecret key -required- name optional krbConfigConfigMap key -required- name optional krbKeytabSecret key -required- name optional krbRealm krbServicePrincipalName krbUsername path -required- http auth basicAuth passwordSecret key -required- name optional usernameSecret key -required- name optional clientCert clientCertSecret key -required- name optional clientKeySecret key -required- name optional oauth2 clientIDSecret key -required- name optional clientSecretSecret key -required- name optional endpointParams <[]Object> key -required- value scopes <[]string> tokenURLSecret key -required- name optional headers <[]Object> name -required- value -required- url -required- mode name -required- optional oss accessKeySecret key -required- name optional bucket createBucketIfNotPresent endpoint key -required- lifecycleRule markDeletionAfterDays markInfrequentAccessAfterDays secretKeySecret key -required- name optional securityToken useSDKCreds path raw data -required- recurseMode s3 accessKeySecret key -required- name optional bucket caSecret key -required- name optional createBucketIfNotPresent objectLocking encryptionOptions enableEncryption kmsEncryptionContext kmsKeyId serverSideCustomerKeySecret key -required- name optional endpoint insecure key region roleARN secretKeySecret key -required- name optional sessionTokenSecret key -required- name optional useSDKCreds subPath status artifactResultsByNode artifactResults error name -required- success ```
MasonM commented 1 month ago

@agilgur5 Thanks for the review! I added additional safeguards in a2ca08019bb42ce5301677de61edc199968589ea. I also discovered there's a secondary issue preventing us from generating the full CRDs for workflows.argoproj.io and a few others: k8s rejects it with errors like this:

The CustomResourceDefinition "workflowtasksets.argoproj.io" is invalid: 
* spec.validation.openAPIV3Schema.properties[spec].properties[tasks].additionalProperties.properties[dag].properties[tasks].items.properties[inline].type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[tasks].additionalProperties.properties[steps].items.items: Required value: must be specifiedk

I think this is related to the kubebuilder issues mentioned at https://github.com/argoproj/argo-workflows/pull/3809#discussion_r472383090