Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add back support for To|FromEnvironmentFieldPath type in environment patches #125

Conversation

truongnht
Copy link
Contributor

Resolves #123

@truongnht
Copy link
Contributor Author

I did run the tests with the result

Running tool: /opt/homebrew/bin/go test -timeout 30s -run ^TestRunFunction$ github.com/crossplane-contrib/function-patch-and-transform

=== RUN   TestRunFunction
=== RUN   TestRunFunction/PatchToCompositeWithEnvironmentPatches
--- PASS: TestRunFunction/PatchToCompositeWithEnvironmentPatches (0.00s)
=== RUN   TestRunFunction/ExtractCompositeConnectionDetails
--- PASS: TestRunFunction/ExtractCompositeConnectionDetails (0.00s)
=== RUN   TestRunFunction/OptionalFieldPathNotFound
--- PASS: TestRunFunction/OptionalFieldPathNotFound (0.00s)
=== RUN   TestRunFunction/EnvironmentPatchRequiredNotFoundError
--- PASS: TestRunFunction/EnvironmentPatchRequiredNotFoundError (0.00s)
=== RUN   TestRunFunction/PatchComposedResourceFromEnvironmentShadowedNotSet
--- PASS: TestRunFunction/PatchComposedResourceFromEnvironmentShadowedNotSet (0.00s)
=== RUN   TestRunFunction/ReplaceDesiredResource
--- PASS: TestRunFunction/ReplaceDesiredResource (0.00s)
=== RUN   TestRunFunction/DesiredResourcesArePassedThrough
--- PASS: TestRunFunction/DesiredResourcesArePassedThrough (0.00s)
=== RUN   TestRunFunction/RequiredFieldPathNotFound
--- PASS: TestRunFunction/RequiredFieldPathNotFound (0.00s)
=== RUN   TestRunFunction/ObservedResourceKeepsItsName
--- PASS: TestRunFunction/ObservedResourceKeepsItsName (0.00s)
=== RUN   TestRunFunction/EnvironmentPatchSupportsToEnvironmentFieldPath
--- PASS: TestRunFunction/EnvironmentPatchSupportsToEnvironmentFieldPath (0.00s)
=== RUN   TestRunFunction/PatchComposedResourceFromEnvironment
--- PASS: TestRunFunction/PatchComposedResourceFromEnvironment (0.00s)
=== RUN   TestRunFunction/NoInput
--- PASS: TestRunFunction/NoInput (0.00s)
=== RUN   TestRunFunction/PatchBaseTemplate
--- PASS: TestRunFunction/PatchBaseTemplate (0.00s)
=== RUN   TestRunFunction/PatchDesiredResource
--- PASS: TestRunFunction/PatchDesiredResource (0.00s)
=== RUN   TestRunFunction/NothingToPatch
--- PASS: TestRunFunction/NothingToPatch (0.00s)
=== RUN   TestRunFunction/PatchErrorIsFatal
--- PASS: TestRunFunction/PatchErrorIsFatal (0.00s)
=== RUN   TestRunFunction/PatchToComposite
--- PASS: TestRunFunction/PatchToComposite (0.00s)
=== RUN   TestRunFunction/EnvironmentPatchToEnvironment
--- PASS: TestRunFunction/EnvironmentPatchToEnvironment (0.00s)
=== RUN   TestRunFunction/PatchToCompositeSupportsFromEnvironmentFieldPath
--- PASS: TestRunFunction/PatchToCompositeSupportsFromEnvironmentFieldPath (0.00s)
=== RUN   TestRunFunction/RenderBaseTemplateWithoutPatches
--- PASS: TestRunFunction/RenderBaseTemplateWithoutPatches (0.00s)
=== RUN   TestRunFunction/PatchComposedResourceFromEnvironmentShadowedSet
--- PASS: TestRunFunction/PatchComposedResourceFromEnvironmentShadowedSet (0.00s)
=== RUN   TestRunFunction/OnlyEnvironmentPatchesIsAllowed
--- PASS: TestRunFunction/OnlyEnvironmentPatchesIsAllowed (0.00s)
=== RUN   TestRunFunction/EnvironmentPatchOptionalNotFoundSkipped
--- PASS: TestRunFunction/EnvironmentPatchOptionalNotFoundSkipped (0.00s)
--- PASS: TestRunFunction (0.01s)
PASS
ok      github.com/crossplane-contrib/function-patch-and-transform      0.246s

@phisco
Copy link
Collaborator

phisco commented May 29, 2024

can you also update

// +kubebuilder:validation:Enum=FromCompositeFieldPath;ToCompositeFieldPath;CombineFromComposite;CombineToComposite
?

@truongnht truongnht force-pushed the support-ToEnvironmentFieldPath-in-spec.environment.patches branch from de3467a to 4846fba Compare May 29, 2024 13:14
@phisco phisco changed the title Add support for To|FromEnvironmentFieldPath type in environment patches fix: Add back support for To|FromEnvironmentFieldPath type in environment patches May 29, 2024
@truongnht truongnht force-pushed the support-ToEnvironmentFieldPath-in-spec.environment.patches branch from 4846fba to cf8cbaa Compare May 29, 2024 13:18
@phisco phisco merged commit 4476a5b into crossplane-contrib:main May 29, 2024
6 checks passed
@truongnht truongnht deleted the support-ToEnvironmentFieldPath-in-spec.environment.patches branch May 29, 2024 13:27
@marcofranssen
Copy link

This is great. That would allow us to upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for ToEnvironmentFieldPath patch type in spec.environment.patches
3 participants