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

added certz4.1 #3350

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open

added certz4.1 #3350

wants to merge 34 commits into from

Conversation

priyacj
Copy link

@priyacj priyacj commented Aug 2, 2024

certz4.1Trust Bundle

@priyacj priyacj requested review from a team as code owners August 2, 2024 00:14
@OpenConfigBot
Copy link

OpenConfigBot commented Aug 2, 2024

Pull Request Functional Test Report for #3350 / 82c56df

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
# CERTZ-4: gNSI Trust Bundle
Cisco 8000E status
# CERTZ-4: gNSI Trust Bundle
Cisco XRd status
# CERTZ-4: gNSI Trust Bundle
Juniper ncPTX status
# CERTZ-4: gNSI Trust Bundle
Nokia SR Linux status
# CERTZ-4: gNSI Trust Bundle
Openconfig Lemming status
# CERTZ-4: gNSI Trust Bundle

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
# CERTZ-4: gNSI Trust Bundle
Cisco 8808 status
# CERTZ-4: gNSI Trust Bundle
Juniper PTX10008 status
# CERTZ-4: gNSI Trust Bundle
Nokia 7250 IXR-10e status
# CERTZ-4: gNSI Trust Bundle

Help

@coveralls
Copy link

coveralls commented Aug 2, 2024

Pull Request Test Coverage Report for Build 12602096852

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 55.268%

Totals Coverage Status
Change from base Build 12592967837: 0.0%
Covered Lines: 1983
Relevant Lines: 3588

💛 - Coveralls

Copy link
Contributor

@morrowc morrowc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please address static-analysis issues.

//a valid check for trust not empty
if len(trust) == 0 {
return &certzpb.CertificateChain{}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion to not use the else here is valid.

} else {
var prevCert *certzpb.CertificateChain
var bundleToReturn *certzpb.CertificateChain
for i := len(trust) - 1; i >= 0; i-- {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the purpose of this for loop?
why iterate with an integer counter instead of just:
for _, t := range trust {}

this pattern seems more golang-oriented, and avoids (I think) the -1 requirement.

var prevCert *certzpb.CertificateChain
var bundleToReturn *certzpb.CertificateChain
for i := len(trust) - 1; i >= 0; i-- {
if i == len(trust)-1 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if/else appears to serve 1 purpose: "Fill bundleToReturn on the first iteration"
Why not just fill that before the for loop?
If you fill the initial conditions before starting the loop you don' t need the if/else at all.

t.Fatalf("Error sending rotate request: %v", err)
}
rotateResponse := &certzpb.RotateCertificateResponse{}
for i := 0; i < 6; i++ {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is 6 here? why magic number?

@priyacj priyacj requested a review from a team as a code owner January 2, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants