jpappa200 commented on code in PR #7652:
URL: https://github.com/apache/trafficcontrol/pull/7652#discussion_r1272739691


##########
cache-config/t3c-apply/torequest/torequest.go:
##########
@@ -1030,6 +1034,45 @@ func (r *TrafficOpsReq) ProcessPackages() error {
        return nil
 }
 
+func pkgMetaDataToMap(pmd []string) map[string]bool {
+       pkgMap := map[string]bool{}
+       for _, pkg := range pmd {
+               pkgMap[pkg] = true
+       }
+       return pkgMap
+}
+
+func pkgMatch(pkgMetaData []string, pk string) bool {
+       for _, pkg := range pkgMetaData {
+               if ok := strings.Contains(pk, pkg); ok {
+                       return true
+               }
+       }
+       return false
+
+}
+
+func (r *TrafficOpsReq) ProcessPackagesWithMetaData(packageMetaData []string) 
error {
+       pkgs, err := getPackages(r.Cfg)
+       pkgMdataMap := pkgMetaDataToMap(packageMetaData)
+       if err != nil {
+               return errors.New("getting packages: " + err.Error())

Review Comment:
   updated `return fmt.Errorf("getting packages: %w", err)` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to