Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

[TT-8499] Fix panic caused while uploading certificate#607

Merged
singhpr merged 16 commits intomasterfrom
fix/TT-8499/fix-certificate-issue
Apr 20, 2023
Merged

[TT-8499] Fix panic caused while uploading certificate#607
singhpr merged 16 commits intomasterfrom
fix/TT-8499/fix-certificate-issue

Conversation

@komalsukhani
Copy link
Contributor

@komalsukhani komalsukhani commented Apr 10, 2023

Description

  • Refactored secret-cert-controller code
  • Fixed panic which was caused by a assignment of value to nil slice. Fixed in commit 032789e

Related Issue

TT-8499

Motivation and Context

Operator was panicking while setting Certificates field of APIDefinition when talking to OSS gateway.

Test Coverage For This Change

  • Added integration tests
  • Verified the issue is not reproducible.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). If PRing from your fork, don't come from your master!
  • Make sure you are making a pull request against our master branch (left side). Also, it would be best if you started your change off our latest master.
  • Make sure you are updating CHANGELOG.md based on your changes.
  • My change requires a change to the documentation.
    • If you've changed APIs, describe what needs to be updated in the documentation.
  • I have updated the documentation accordingly.
  • If you've changed API models, please update CRDs.
    • make manifests
    • make helm
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Check your code additions will not fail linting checks:
    • gofmt -s -w .
    • go vet ./...
    • golangci-lint run

@komalsukhani komalsukhani changed the title [TT-8499]fix certificate issue [TT-8499] Fix panic caused while uploading certificate Apr 11, 2023
@komalsukhani komalsukhani marked this pull request as ready for review April 11, 2023 11:41
@komalsukhani komalsukhani requested a review from a team as a code owner April 11, 2023 11:41
@komalsukhani komalsukhani requested review from buraksekili and removed request for a team April 11, 2023 11:41
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@singhpr singhpr merged commit b2b1be5 into master Apr 20, 2023
@singhpr singhpr deleted the fix/TT-8499/fix-certificate-issue branch April 20, 2023 09:54
buger pushed a commit that referenced this pull request May 22, 2024
* Validate certificate slice is not nil before assigning value

* Fix config samples

* Move delete operation to a different function

* Remove some checks which are not required anymore

* Move check for secret type to the top

* Remove `apiDefUpstreamCertificateHasBeenUpdated` field

* Delete oas config sample file

* Add test for Certificates

* Upload secret only once

* Move up the logic to add finalizer

* Refactor code

* Improve error handling

* Fix linter errors

* Add changelog

* Fix error handling
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants