This is an automated email from the ASF dual-hosted git repository.

zrhoffman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new ea5099d105 T3c apply metadata (#7366)
ea5099d105 is described below

commit ea5099d105f0f37482f959468ac0f7ea4c7bdc4a
Author: Joe Pappano <[email protected]>
AuthorDate: Tue Feb 28 10:44:25 2023 -0500

    T3c apply metadata (#7366)
    
    * removed timestamp from metadata file
    
    * add changelog entry
    
    * fix formatting error and updated changelog entry
---
 CHANGELOG.md                        |  1 +
 cache-config/t3c-apply/t3c-apply.go |  1 -
 cache-config/t3cutil/t3cutil.go     | 14 --------------
 3 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d9e2f9b196..ddbb1b9e93 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -42,6 +42,7 @@ The format is based on [Keep a 
Changelog](http://keepachangelog.com/en/1.0.0/).
 - [#7242](https://github.com/apache/trafficcontrol/pull/7276) *Traffic Portal* 
Now depends on NodeJS version 16 or later.
 - [#7120](https://github.com/apache/trafficcontrol/pull/7120) *Docs* Update 
t3c documentation regarding parent.config parent_retry.
 - [#7044](https://github.com/apache/trafficcontrol/issues/7044) *CDN in a Box* 
[CDN in a Box, the t3c integration tests, and the tc health client integration 
tests now use Apache Traffic Server 9.1.
+- [#7366](https://github.com/apache/trafficcontrol/pull/7366) *t3c* Removed 
timestamp from metadata file since it's changing every minute and causing 
excessive commits to git repo.
 
 ### Fixed
 - [#7340](https://github.com/apache/trafficcontrol/pull/7340) *Traffic Router* 
Fixed TR logging for the `cqhv` field when absent.
diff --git a/cache-config/t3c-apply/t3c-apply.go 
b/cache-config/t3c-apply/t3c-apply.go
index d543705610..a84810d79e 100644
--- a/cache-config/t3c-apply/t3c-apply.go
+++ b/cache-config/t3c-apply/t3c-apply.go
@@ -423,7 +423,6 @@ const MetaDataFileMode = 0600
 //
 // On error, an error is written to the log, but no error is returned.
 func WriteMetaData(cfg config.Cfg, metaData *t3cutil.ApplyMetaData) {
-       metaData.SetTime(time.Now())
        bts, err := metaData.Format()
        if err != nil {
                log.Errorln("formatting metadata file: " + err.Error())
diff --git a/cache-config/t3cutil/t3cutil.go b/cache-config/t3cutil/t3cutil.go
index c33bdc569e..b59a57fc85 100644
--- a/cache-config/t3cutil/t3cutil.go
+++ b/cache-config/t3cutil/t3cutil.go
@@ -34,7 +34,6 @@ import (
        "sort"
        "strings"
        "syscall"
-       "time"
 
        "github.com/apache/trafficcontrol/lib/go-log"
 )
@@ -281,12 +280,6 @@ type ApplyMetaData struct {
        // metadata files from different servers.
        ServerHostName string `json:"server-hostname"`
 
-       // Time is an RFC3339Nano timestamp of the time t3c-apply ran for this 
metadata.
-       // This should be treated as approximate, as it could be the start 
time, end time, or
-       // any inexact time in-between.
-       // However, times of different metadata files should always be 
monotonically increasing.
-       Time string `json:"time"`
-
        // ReloadedATS is whether this run restarted ATS.
        // Note this is whether ATS was actually restarted, not whether it 
would have been,
        // e.g. because of --report-only or --service-action.
@@ -371,13 +364,6 @@ func (md *ApplyMetaData) Format() ([]byte, error) {
        return bts, nil
 }
 
-// SetTime sets the Time field in the prescribed format, based on the given 
time.
-// To set to the current time, call SetTime(time.Now()).
-// The format is UTC RFC3339Nano. See ApplyMetaData.
-func (md *ApplyMetaData) SetTime(tm time.Time) {
-       md.Time = tm.UTC().Format(time.RFC3339Nano)
-}
-
 // CombineOwnedFilePaths combines the owned file paths of two metadata objects.
 //
 // This is primarily useful when a config run, such as revalidate, adds owned 
files, but not

Reply via email to