Coder Social home page Coder Social logo

Comments (2)

negz avatar negz commented on June 19, 2024

@daniel-maganto I'm having a hard time following the problem.

It looks like you're applying a manifest with keys, but no values.

It seems like the problem you're seeing is that:

  • When you create the Composition, the missing values are set to null.
  • When you update a Composition, the missing values are set/reduced to an empty object ({}).

Is that right?

Can you explain why you're providing a manifest with keys but no values? I actually didn't know this was valid YAML, and would have expected it to be rejected.

from crossplane.

daniel-maganto avatar daniel-maganto commented on June 19, 2024

Hi @negz , many thanks for your answer and yes that's right.

About these empty keys are later patched like this:

        - combine:
            strategy: string
            string:
              fmt: '%s-%s-executionpolicy'
            variables:
            - fromFieldPath: spec.parameters.family
            - fromFieldPath: spec.resourceConfig.env
          toFieldPath: spec.forProvider.inlinePolicy[0].name
          type: CombineFromComposite
        - combine:
            strategy: string
            string:
              fmt: |
                {
                    "Version": "2012-10-17",
                    "Statement": [
                        {
                            "Action": [
                                "ecr:BatchCheckLayerAvailability",
                                "ecr:BatchGetImage",
                                "ecr:GetAuthorizationToken",
                                "ecr:GetDownloadUrlForLayer",
                                "logs:CreateLogStream",
                                "logs:PutLogEvents",
                                "sts:GetServiceBearerToken"
                            ],
                            "Resource": "*",
                            "Effect": "Allow"
                        },
                        {
                            "Action": "kms:Decrypt",
                            "Resource": "%[1]s",
                            "Effect": "Allow"
                        },
                        {
                            "Action": [
                                "secretsmanager:DescribeSecret",
                                "secretsmanager:GetSecretValue"
                            ],
                            "Resource": %[2]s,
                            "Effect": "Allow"
                        }
                    ]
                }
            variables:
            - fromFieldPath: kmsARN
            - fromFieldPath: secretsJSON
          toFieldPath: spec.forProvider.inlinePolicy[0].policy
          type: CombineFromEnvironment

We start doing in this way checking the AWS Crossplane Blueprints, for instance. I never found which is the proper way, if define a default, leave it empty or not define.

For me, the key problem is that depends what is the moment that you apply a composition you have different results.

from crossplane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.