-
Notifications
You must be signed in to change notification settings - Fork 33
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
[test] Unit-tests for common/k8s_utils.go (part 3 of 3) & Unit-tests and improvements for common/yaml_decoder.go #195
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
art-tapin
added a commit
that referenced
this pull request
Jun 12, 2023
…mmediately (#167) With this change, the function terminates execution upon encountering a decoding error, providing more accurate error handling. This ensures that errors are not accumulated and allows the caller to handle the error appropriately. See: #195 (comment)
- when inputA and inputB have no common elements then return inputA as the result
- Refactor logger initialisation and document decoding to fail fast and return errors immediately - Enhanced empty doc check - Add comment to the function
art-tapin
force-pushed
the
issue167/tests_for_k8s_utils-3
branch
from
June 15, 2023 13:47
87bdaaf
to
f2d1ee1
Compare
didierofrivia
approved these changes
Jun 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
guicassolato
approved these changes
Jun 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent job, @art-tapin! Thank you! 🥇
guicassolato
added a commit
that referenced
this pull request
Jun 21, 2023
* Build images with replaces image (#193) * [makefile] Updating the `replaces` directive in CSV * [gh workflow] Adding `replacesVersion` as input for workflow_dispatch * [config] Adding default replaces operator value * [bundle] Updated bundle * Building the catalog with the replaces directive (#194) * [catalog] Building the catalog with the replaces directive * [catalog] Setting default replaces version to `0.0.0-alpha` * [bundle] Updating config and bundle with new default release version * upgrade operator-sdk v1.28.1 * fix verify-bundle task * Create a ServiceMeshMember, rather than mutating the ServiceMeshMemberRoll * Fixed access to servicemeshmember * [test] Unit-tests for common/k8s_utils.go (part 2 of 3) (#191) * test: Add unit-tests to StatusConditionsMarshalJSON (#167) * test: Add unit-tests to IsOwnedBy (#167) * refactor: Add comment to IsOwnedBy (#167) * test: Add unit-test to GetServicePortNumber (#167) * Update gateway-api module to v0.6.2 (#153) * Update gateway api dep to v0.6.2 Update controller runtime Set go version 1.19 Use github.com/onsi/ginkgo/v2 which is used by the latest version if controller-runtime (envtest). * Update GatewayClass, Gateway and HTTPRoute to v1beta1 Since v0.6.0 GatewayClass, Gateway and HTTPRoute have moved to the v1beta1 version of the API and support in v1alpha2 will be removed eventually. All references to these APIS are now updated to use v1beta1. PolicyTargetReference are still v1alpha2. * [test] Unit-tests for common/k8s_utils.go (part 3 of 3) & Unit-tests and improvements for common/yaml_decoder.go (#195) * test: Add test-case to TestObjectKeyListDifference (#167) - when inputA and inputB have no common elements then return inputA as the result * refactor: Rename tests for ObjectKeyListDifference (#167) * test: Add unit-tests to ContainsObjectKey (#167) * test: Add unit-tests to FindObjectKey (#167) * test: Add unit-tests to FindDeploymentStatusCondition (#167) * refactor: Clarify test name in TestStatusConditionsMarshalJSON (#167) * test: Add unit-tests to DecodeFile (#167) * refactor, improvements: DecodeFile YAML decoder (#167) - Refactor logger initialisation and document decoding to fail fast and return errors immediately - Enhanced empty doc check - Add comment to the function --------- Co-authored-by: dd di cesare <[email protected]> Co-authored-by: Eguzki Astiz Lezaun <[email protected]> Co-authored-by: Alex Snaps <[email protected]> Co-authored-by: artem_tiupin <[email protected]> Co-authored-by: Michael Nairn <[email protected]>
guicassolato
added a commit
that referenced
this pull request
Jul 14, 2023
* Build images with replaces image (#193) * [makefile] Updating the `replaces` directive in CSV * [gh workflow] Adding `replacesVersion` as input for workflow_dispatch * [config] Adding default replaces operator value * [bundle] Updated bundle * Building the catalog with the replaces directive (#194) * [catalog] Building the catalog with the replaces directive * [catalog] Setting default replaces version to `0.0.0-alpha` * [bundle] Updating config and bundle with new default release version * upgrade operator-sdk v1.28.1 * fix verify-bundle task * Create a ServiceMeshMember, rather than mutating the ServiceMeshMemberRoll * Fixed access to servicemeshmember * [test] Unit-tests for common/k8s_utils.go (part 2 of 3) (#191) * test: Add unit-tests to StatusConditionsMarshalJSON (#167) * test: Add unit-tests to IsOwnedBy (#167) * refactor: Add comment to IsOwnedBy (#167) * test: Add unit-test to GetServicePortNumber (#167) * Update gateway-api module to v0.6.2 (#153) * Update gateway api dep to v0.6.2 Update controller runtime Set go version 1.19 Use github.com/onsi/ginkgo/v2 which is used by the latest version if controller-runtime (envtest). * Update GatewayClass, Gateway and HTTPRoute to v1beta1 Since v0.6.0 GatewayClass, Gateway and HTTPRoute have moved to the v1beta1 version of the API and support in v1alpha2 will be removed eventually. All references to these APIS are now updated to use v1beta1. PolicyTargetReference are still v1alpha2. * [test] Unit-tests for common/k8s_utils.go (part 3 of 3) & Unit-tests and improvements for common/yaml_decoder.go (#195) * test: Add test-case to TestObjectKeyListDifference (#167) - when inputA and inputB have no common elements then return inputA as the result * refactor: Rename tests for ObjectKeyListDifference (#167) * test: Add unit-tests to ContainsObjectKey (#167) * test: Add unit-tests to FindObjectKey (#167) * test: Add unit-tests to FindDeploymentStatusCondition (#167) * refactor: Clarify test name in TestStatusConditionsMarshalJSON (#167) * test: Add unit-tests to DecodeFile (#167) * refactor, improvements: DecodeFile YAML decoder (#167) - Refactor logger initialisation and document decoding to fail fast and return errors immediately - Enhanced empty doc check - Add comment to the function * [istio] Updating registerIstioExternalAuthorizer * Reconciles also the Istio ConfigMap with the external authorizers * If the IstioOperator CR returns an error, it continues reconciling CM * [istio] Updating the unregisterExternalAuthorizerIstio * With the new functionality * [mesh config] Refactoring and testing mesh config functionality * [makefile] Splitting local deploy in different target * [istio] Refactoring using wrapper structs * [go] Fixing dependencies * [mesh config] Refactoring mesh config objects and fns * [controller] Fixing registering logic * Still relying on the istio CRD being installed. If not, means no istio * If it's 404, means it's installed other way than it's operator * If any other error happens, istio is installed, but an error occurred * [controller] Refactoring istio installation process * Added ENV for CM name * [refactor] Using apierrors.IsNotFound instead of crafting the error msg * kind: bump to 0.20.0 and pin image to kindest/node:v1.27.3 (#209) * Upgrade Authorino and Authorino Operator to latest (#211) * Authorino v0.14.0 * Authorino Operator v0.8.0 * workflow: use go1.19 to align with go.mod go version used (#213) * workflow: use go1.19 to align with go.mod go version used * doc: fix operator-sdk & kind versions used for development --------- Co-authored-by: dd di cesare <[email protected]> Co-authored-by: Eguzki Astiz Lezaun <[email protected]> Co-authored-by: Alex Snaps <[email protected]> Co-authored-by: artem_tiupin <[email protected]> Co-authored-by: Michael Nairn <[email protected]> Co-authored-by: dd di cesare <[email protected]> Co-authored-by: Kevin Fan <[email protected]>
KevFan
pushed a commit
to KevFan/kuadrant-operator
that referenced
this pull request
Aug 10, 2023
* Build images with replaces image (Kuadrant#193) * [makefile] Updating the `replaces` directive in CSV * [gh workflow] Adding `replacesVersion` as input for workflow_dispatch * [config] Adding default replaces operator value * [bundle] Updated bundle * Building the catalog with the replaces directive (Kuadrant#194) * [catalog] Building the catalog with the replaces directive * [catalog] Setting default replaces version to `0.0.0-alpha` * [bundle] Updating config and bundle with new default release version * upgrade operator-sdk v1.28.1 * fix verify-bundle task * Create a ServiceMeshMember, rather than mutating the ServiceMeshMemberRoll * Fixed access to servicemeshmember * [test] Unit-tests for common/k8s_utils.go (part 2 of 3) (Kuadrant#191) * test: Add unit-tests to StatusConditionsMarshalJSON (Kuadrant#167) * test: Add unit-tests to IsOwnedBy (Kuadrant#167) * refactor: Add comment to IsOwnedBy (Kuadrant#167) * test: Add unit-test to GetServicePortNumber (Kuadrant#167) * Update gateway-api module to v0.6.2 (Kuadrant#153) * Update gateway api dep to v0.6.2 Update controller runtime Set go version 1.19 Use github.com/onsi/ginkgo/v2 which is used by the latest version if controller-runtime (envtest). * Update GatewayClass, Gateway and HTTPRoute to v1beta1 Since v0.6.0 GatewayClass, Gateway and HTTPRoute have moved to the v1beta1 version of the API and support in v1alpha2 will be removed eventually. All references to these APIS are now updated to use v1beta1. PolicyTargetReference are still v1alpha2. * [test] Unit-tests for common/k8s_utils.go (part 3 of 3) & Unit-tests and improvements for common/yaml_decoder.go (Kuadrant#195) * test: Add test-case to TestObjectKeyListDifference (Kuadrant#167) - when inputA and inputB have no common elements then return inputA as the result * refactor: Rename tests for ObjectKeyListDifference (Kuadrant#167) * test: Add unit-tests to ContainsObjectKey (Kuadrant#167) * test: Add unit-tests to FindObjectKey (Kuadrant#167) * test: Add unit-tests to FindDeploymentStatusCondition (Kuadrant#167) * refactor: Clarify test name in TestStatusConditionsMarshalJSON (Kuadrant#167) * test: Add unit-tests to DecodeFile (Kuadrant#167) * refactor, improvements: DecodeFile YAML decoder (Kuadrant#167) - Refactor logger initialisation and document decoding to fail fast and return errors immediately - Enhanced empty doc check - Add comment to the function --------- Co-authored-by: dd di cesare <[email protected]> Co-authored-by: Eguzki Astiz Lezaun <[email protected]> Co-authored-by: Alex Snaps <[email protected]> Co-authored-by: artem_tiupin <[email protected]> Co-authored-by: Michael Nairn <[email protected]>
KevFan
pushed a commit
to KevFan/kuadrant-operator
that referenced
this pull request
Aug 14, 2023
* Build images with replaces image (Kuadrant#193) * [makefile] Updating the `replaces` directive in CSV * [gh workflow] Adding `replacesVersion` as input for workflow_dispatch * [config] Adding default replaces operator value * [bundle] Updated bundle * Building the catalog with the replaces directive (Kuadrant#194) * [catalog] Building the catalog with the replaces directive * [catalog] Setting default replaces version to `0.0.0-alpha` * [bundle] Updating config and bundle with new default release version * upgrade operator-sdk v1.28.1 * fix verify-bundle task * Create a ServiceMeshMember, rather than mutating the ServiceMeshMemberRoll * Fixed access to servicemeshmember * [test] Unit-tests for common/k8s_utils.go (part 2 of 3) (Kuadrant#191) * test: Add unit-tests to StatusConditionsMarshalJSON (Kuadrant#167) * test: Add unit-tests to IsOwnedBy (Kuadrant#167) * refactor: Add comment to IsOwnedBy (Kuadrant#167) * test: Add unit-test to GetServicePortNumber (Kuadrant#167) * Update gateway-api module to v0.6.2 (Kuadrant#153) * Update gateway api dep to v0.6.2 Update controller runtime Set go version 1.19 Use github.com/onsi/ginkgo/v2 which is used by the latest version if controller-runtime (envtest). * Update GatewayClass, Gateway and HTTPRoute to v1beta1 Since v0.6.0 GatewayClass, Gateway and HTTPRoute have moved to the v1beta1 version of the API and support in v1alpha2 will be removed eventually. All references to these APIS are now updated to use v1beta1. PolicyTargetReference are still v1alpha2. * [test] Unit-tests for common/k8s_utils.go (part 3 of 3) & Unit-tests and improvements for common/yaml_decoder.go (Kuadrant#195) * test: Add test-case to TestObjectKeyListDifference (Kuadrant#167) - when inputA and inputB have no common elements then return inputA as the result * refactor: Rename tests for ObjectKeyListDifference (Kuadrant#167) * test: Add unit-tests to ContainsObjectKey (Kuadrant#167) * test: Add unit-tests to FindObjectKey (Kuadrant#167) * test: Add unit-tests to FindDeploymentStatusCondition (Kuadrant#167) * refactor: Clarify test name in TestStatusConditionsMarshalJSON (Kuadrant#167) * test: Add unit-tests to DecodeFile (Kuadrant#167) * refactor, improvements: DecodeFile YAML decoder (Kuadrant#167) - Refactor logger initialisation and document decoding to fail fast and return errors immediately - Enhanced empty doc check - Add comment to the function --------- Co-authored-by: dd di cesare <[email protected]> Co-authored-by: Eguzki Astiz Lezaun <[email protected]> Co-authored-by: Alex Snaps <[email protected]> Co-authored-by: artem_tiupin <[email protected]> Co-authored-by: Michael Nairn <[email protected]>
KevFan
pushed a commit
to KevFan/kuadrant-operator
that referenced
this pull request
Aug 14, 2023
* Build images with replaces image (Kuadrant#193) * [makefile] Updating the `replaces` directive in CSV * [gh workflow] Adding `replacesVersion` as input for workflow_dispatch * [config] Adding default replaces operator value * [bundle] Updated bundle * Building the catalog with the replaces directive (Kuadrant#194) * [catalog] Building the catalog with the replaces directive * [catalog] Setting default replaces version to `0.0.0-alpha` * [bundle] Updating config and bundle with new default release version * upgrade operator-sdk v1.28.1 * fix verify-bundle task * Create a ServiceMeshMember, rather than mutating the ServiceMeshMemberRoll * Fixed access to servicemeshmember * [test] Unit-tests for common/k8s_utils.go (part 2 of 3) (Kuadrant#191) * test: Add unit-tests to StatusConditionsMarshalJSON (Kuadrant#167) * test: Add unit-tests to IsOwnedBy (Kuadrant#167) * refactor: Add comment to IsOwnedBy (Kuadrant#167) * test: Add unit-test to GetServicePortNumber (Kuadrant#167) * Update gateway-api module to v0.6.2 (Kuadrant#153) * Update gateway api dep to v0.6.2 Update controller runtime Set go version 1.19 Use github.com/onsi/ginkgo/v2 which is used by the latest version if controller-runtime (envtest). * Update GatewayClass, Gateway and HTTPRoute to v1beta1 Since v0.6.0 GatewayClass, Gateway and HTTPRoute have moved to the v1beta1 version of the API and support in v1alpha2 will be removed eventually. All references to these APIS are now updated to use v1beta1. PolicyTargetReference are still v1alpha2. * [test] Unit-tests for common/k8s_utils.go (part 3 of 3) & Unit-tests and improvements for common/yaml_decoder.go (Kuadrant#195) * test: Add test-case to TestObjectKeyListDifference (Kuadrant#167) - when inputA and inputB have no common elements then return inputA as the result * refactor: Rename tests for ObjectKeyListDifference (Kuadrant#167) * test: Add unit-tests to ContainsObjectKey (Kuadrant#167) * test: Add unit-tests to FindObjectKey (Kuadrant#167) * test: Add unit-tests to FindDeploymentStatusCondition (Kuadrant#167) * refactor: Clarify test name in TestStatusConditionsMarshalJSON (Kuadrant#167) * test: Add unit-tests to DecodeFile (Kuadrant#167) * refactor, improvements: DecodeFile YAML decoder (Kuadrant#167) - Refactor logger initialisation and document decoding to fail fast and return errors immediately - Enhanced empty doc check - Add comment to the function --------- Co-authored-by: dd di cesare <[email protected]> Co-authored-by: Eguzki Astiz Lezaun <[email protected]> Co-authored-by: Alex Snaps <[email protected]> Co-authored-by: artem_tiupin <[email protected]> Co-authored-by: Michael Nairn <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request completes the unit tests for the k8s_utils.go file, addressing the remaining functions and adding additional coverage and imporvements to the yaml_decoder.go file.
Changes Made:
k8s_utils.go
ObjectKeyListDifference
,ContainsObjectKey
,FindObjectKey
,FindDeploymentStatusCondition
yaml_decoder.go
DecodeFile
Changes made to DecodeFile, see c127731
Additional Information:
Please note that the previous PRs have been merged and this PR concludes the work for issue #167.
Note also that this PR includes unmerged commits from #191
Coverage: 83.8%.