Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Conversation

@jrushford
Copy link
Contributor

@jrushford jrushford commented Aug 1, 2018

Modified grovetccfg to read a grove server profile from the traffic_ops and write a grove.cfg from that profile id there have been changes. Fixes #2607 and depends on #2517 and #2523. Both #2517 and #2523 are merged onto master.

@asfgit
Copy link
Contributor

asfgit commented Aug 1, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2160/
Test FAILed.

@asfgit
Copy link
Contributor

asfgit commented Aug 1, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2161/
Test FAILed.

@asfgit
Copy link
Contributor

asfgit commented Aug 2, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2165/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Aug 2, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2166/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Aug 2, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2167/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Aug 2, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2170/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Aug 2, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2171/
Test PASSed.

@jrushford jrushford force-pushed the cdn-2099 branch 2 times, most recently from c0b9154 to 4243453 Compare August 2, 2018 16:23
@asfgit
Copy link
Contributor

asfgit commented Aug 2, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2172/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Aug 2, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2174/
Test PASSed.

@dangogh dangogh added grove related to the "grove" HTTP caching server implementation new feature A new feature, capability or behavior labels Aug 2, 2018
Copy link
Member

Choose a reason for hiding this comment

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

Go local variables should be camelCase not snake_case

Copy link
Member

Choose a reason for hiding this comment

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

This is unnecessary, Go zero-initializes all variables, so err is already nil.

Copy link
Member

Choose a reason for hiding this comment

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

A switch would be cleaner here.

switch name {
case "rfc_compliant":
  cfg.RFCCompliant, err = strconv.ParseBool(value)
case "remap_rules_file":
  cfg.RemapRulesFile = value
...
}
return err

Copy link
Member

Choose a reason for hiding this comment

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

bkup_dir should be camel case, and while Go favors brevity bkup is a bit extreme, I'd recommend backupDir

Copy link
Member

Choose a reason for hiding this comment

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

If host == nil, this gets passed to createRulesOldAPI which will panic. This should check if host == nil, and print a good error message and os.Exit(1).

That will also reduce indentation, and reduce variable pre-declarations too, which will make this block much nicer.

Copy link
Member

Choose a reason for hiding this comment

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

update_required should be updateRequired

Copy link
Member

Choose a reason for hiding this comment

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

The config file is duplicated in GroveConfigPath. Can you change the variables to

const GroveConfigFile = "grove.cfg"
const GroveConfigPath = "/etc/grove/" + GroveConfigFile

To get rid of the magic string?

Copy link
Member

Choose a reason for hiding this comment

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

All these strings duplicating the JSON tags aren't great, but unfortunately, I don't think Go has a better way to do this

Copy link
Member

Choose a reason for hiding this comment

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

Would you mind moving this to traffic_control/lib/go-tc/enum.go? Profile types should be there, so other apps like the TO client can use them.

@rob05c
Copy link
Member

rob05c commented Aug 6, 2018

Ok, I commented on all the formatting things I saw. I didn't do an actual review, because that will take longer, and I'll need to install and run it against a TO instance with the expected profile. I'll try to do that as soon as I can find the time.

Feel free to fix the things noted now, or wait until the full review, whatever you prefer.

@asfgit
Copy link
Contributor

asfgit commented Aug 6, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2189/
Test FAILed.

@jrushford
Copy link
Contributor Author

jrushford commented Aug 6, 2018 via email

@asfgit
Copy link
Contributor

asfgit commented Aug 6, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2191/
Test FAILed.

@asfgit
Copy link
Contributor

asfgit commented Aug 6, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2193/
Test PASSed.

the current server and generate a new 'grove.cfg'
file if there are changes.
@asfgit
Copy link
Contributor

asfgit commented Aug 6, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2194/
Test PASSed.

@jrushford
Copy link
Contributor Author

@rob05c How’s the review of this coming along?

@jrushford
Copy link
Contributor Author

@dewrich, @dangogh, @DylanVolz can i get a review of this pr. It is pretty straight forward. It writes a grove.cfg file for a server when a grove profile is used.

@dewrich dewrich merged commit df57136 into apache:master Aug 28, 2018
@asfgit
Copy link
Contributor

asfgit commented Aug 28, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2352/
Test PASSed.

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

Labels

grove related to the "grove" HTTP caching server implementation new feature A new feature, capability or behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants