Giter VIP home page Giter VIP logo

Comments (2)

negz avatar negz commented on May 28, 2024

Uhh, except I guess this isn't the case? At least the two managers don't seem to be sharing the field.

I edited the E2E test like so:

diff --git a/test/e2e/apiextensions_test.go b/test/e2e/apiextensions_test.go
index b227e866..839b2128 100644
--- a/test/e2e/apiextensions_test.go
+++ b/test/e2e/apiextensions_test.go
@@ -189,11 +189,11 @@ func TestCompositionFunctions(t *testing.T) {
                        Assess("ClaimHasPatchedField",
                                funcs.ResourcesHaveFieldValueWithin(5*time.Minute, manifests, "claim.yaml", "status.coolerField", "I'M COOLER!"),
                        ).
-                       WithTeardown("DeleteClaim", funcs.AllOf(
-                               funcs.DeleteResources(manifests, "claim.yaml"),
-                               funcs.ResourcesDeletedWithin(2*time.Minute, manifests, "claim.yaml"),
-                       )).
-                       WithTeardown("DeletePrerequisites", funcs.ResourcesDeletedAfterListedAreGone(3*time.Minute, manifests, "setup/*.yaml", nopList)).
+                       // WithTeardown("DeleteClaim", funcs.AllOf(
+                       //      funcs.DeleteResources(manifests, "claim.yaml"),
+                       //      funcs.ResourcesDeletedWithin(2*time.Minute, manifests, "claim.yaml"),
+                       // )).
+                       // WithTeardown("DeletePrerequisites", funcs.ResourcesDeletedAfterListedAreGone(3*time.Minute, manifests, "setup/*.yaml", nopList)).
                        Feature(),
        )
 }

Then ran:

E2E_TEST_FLAGS="-test.v -v=4 -test.failfast -destroy-kind-cluster=false -test.run ^TestCompositionFunctions" make e2e

After about 20 minutes I see the following. Note that status.coolerField is only managed by apiextensions.crossplane.io/composite, not crossplane. 🤔

[
  {
    "apiVersion": "nop.example.org/v1alpha1",
    "fieldsType": "FieldsV1",
    "fieldsV1": {
      "f:spec": {
        "f:resourceRefs": {}
      }
    },
    "manager": "apiextensions.crossplane.io/composite",
    "operation": "Apply",
    "time": "2024-02-03T03:16:41Z"
  },
  {
    "apiVersion": "nop.example.org/v1alpha1",
    "fieldsType": "FieldsV1",
    "fieldsV1": {
      "f:status": {
        "f:coolerField": {}
      }
    },
    "manager": "apiextensions.crossplane.io/composite",
    "operation": "Apply",
    "subresource": "status",
    "time": "2024-02-03T03:16:41Z"
  },
  {                                                                                                                                                                                                                              [4/1993]
    "apiVersion": "nop.example.org/v1alpha1",
    "fieldsType": "FieldsV1",
    "fieldsV1": {
      "f:metadata": {
        "f:finalizers": {
          ".": {},
          "v:\"composite.apiextensions.crossplane.io\"": {}
        },
        "f:generateName": {},
        "f:labels": {
          ".": {},
          "f:crossplane.io/claim-name": {},
          "f:crossplane.io/claim-namespace": {},
          "f:crossplane.io/composite": {}
        }
      },
      "f:spec": {
        ".": {},
        "f:claimRef": {
          ".": {},
          "f:apiVersion": {},
          "f:kind": {},
          "f:name": {},
          "f:namespace": {}
        },
        "f:compositionRef": {
          ".": {},
          "f:name": {}
        },
        "f:compositionRevisionRef": {
          ".": {},
          "f:name": {}
        },
        "f:compositionUpdatePolicy": {},
        "f:coolField": {}
      }
    },
    "manager": "crossplane",
    "operation": "Update",
    "time": "2024-02-03T03:16:33Z"
  },
  {
    "apiVersion": "nop.example.org/v1alpha1",
    "fieldsType": "FieldsV1",
    "fieldsV1": {
      "f:status": {
        ".": {},
        "f:conditions": {
          ".": {},
          "k:{\"type\":\"Ready\"}": {
            ".": {},
            "f:lastTransitionTime": {},
            "f:reason": {},
            "f:status": {},
            "f:type": {}
          },
          "k:{\"type\":\"Synced\"}": {
            ".": {},
            "f:lastTransitionTime": {},
            "f:reason": {},
            "f:status": {},
            "f:type": {}
          }
        }
      }
    },
    "manager": "crossplane",
    "operation": "Update",
    "subresource": "status",
    "time": "2024-02-03T03:17:21Z"
  }
]

Maybe an Update operation doesn't become a manager of a pre-existing field created by an Apply operation (by a different manager) even if it updates to the same value?

from crossplane.

negz avatar negz commented on May 28, 2024

AFAICT nothing is actually broken here.

I do think though that it might be worth updating the FunctionComposer to just use Update to update the XR's status. I don't think we're getting much from using SSA there.

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.