crossplane-contrib / provider-upjet-aws

AWS Provider for Crossplane.
https://marketplace.upbound.io/providers/upbound/provider-family-aws/
Apache License 2.0
146 stars 122 forks source link

Object Level patching support #664

Closed piyushrsrivastava closed 1 month ago

piyushrsrivastava commented 1 year ago

What problem are you facing?

Is there a way to patch objects in compositions. Fro example , Lets say we have BucketLifeCycleConfiguration for S3. We dont need all the attributes to be added in our composition. We want the one who creates claim just give us a yaml schema to patch instead of attribute level.

Example Claim :

apiVersion: s3.aws.upbound.io/v1beta1
kind: Bucket
metadata:
  name: my-test-bucket
spec:
  forProvider:
    region: my-region

example composition:

apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
  name: my-name
  labels:
    provider: aws
spec:
  compositeTypeRef:
    apiVersion: myversion/v1alpha1
    kind: mykind
  writeConnectionSecretsToNamespace: my-namespace
  resources:
    - name: bucket
      base:
        apiVersion: s3.aws.upbound.io/v1beta1
        kind: Bucket
        metadata: {}
        spec:
          deletionPolicy: Delete
      patches:
        - fromFieldPath: "spec.parameters.bucketName"
          toFieldPath: "metadata.name"
        - fromFieldPath: "spec.parameters"
          toFieldPath: "spec.forProvider"

example definition:

apiVersion: apiextensions.crossplane.io/v1
kind: CompositeResourceDefinition
metadata:
  name: my-name
spec:
  group: mygroup
  names:
    kind: mykind
    plural: mykind
  claimNames:
    kind: ObjectStorage
    plural: objectstorages
  versions:
  - name: v1alpha1
    served: true
    referenceable: true
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              parameters:
                type: object
                properties:
                  bucketName:
                    type: string
                  region:
                    type: string

so here i am trying to patch everything under parameters as is under forProvider

How could Official AWS Provider help solve your problem?

Provide guidance and solution

github-actions[bot] commented 6 months ago

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] commented 2 months ago

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] commented 1 month ago

This issue is being closed since there has been no activity for 14 days since marking it as stale. If you still need help, feel free to comment or reopen the issue!