Skip to content

Commit 3242121

Browse files
authored
Remove the last modification timestamp and the OS/Arch from ack-generate-metadata.yaml file. (#188)
Recently we introduced a new generate metadata file to all the apiVersions directory (e.g [EC2 v1alpha1](https://github.com/aws-controllers-k8s/ec2-controller/blob/main/apis/v1alpha1/ack-generate-metadata.yaml)). However after few weeks we realized the `last_modification_info` and `ack_generate_info` were too verbose and often caused merge conflicts since our contributors don't use the same `OS`/`Arch` for compiling `ack-generate` binary. This patch removes the last modification timestamp and the OS/Arch from ack generate information. Description of changes: - Remove the `OS`/`Arch` from `pkg/metadata.ackGenerateInfo` - Remove last update timestamp from `pkg/metadata.lastMoficationInfo` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 394e829 commit 3242121

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pkg/metadata/generation_metadata.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"io/ioutil"
2121
"os"
2222
"path/filepath"
23-
"time"
23+
"runtime"
2424

2525
"github.com/ghodss/yaml"
2626

@@ -82,8 +82,6 @@ type generatorConfigInfo struct {
8282

8383
// last modification information
8484
type lastModificationInfo struct {
85-
// UTC Timestamp
86-
Timestamp string `json:"timestamp"`
8785
// Modification reason
8886
Reason UpdateReason `json:"reason"`
8987
}
@@ -112,15 +110,14 @@ func CreateGenerationMetadata(
112110
APIVersion: apiVersion,
113111
APIDirectoryChecksum: hash,
114112
LastModification: lastModificationInfo{
115-
Timestamp: time.Now().UTC().String(),
116-
Reason: modificationReason,
113+
Reason: modificationReason,
117114
},
118115
AWSSDKGoVersion: awsSDKGo,
119116
ACKGenerateInfo: ackGenerateInfo{
120117
Version: version.Version,
121118
BuildDate: version.BuildDate,
122119
BuildHash: version.BuildHash,
123-
GoVersion: version.GoVersion,
120+
GoVersion: runtime.Version(),
124121
},
125122
GeneratorConfigInfo: generatorConfigInfo{
126123
OriginalFileName: filepath.Base(generatorFileName),

0 commit comments

Comments
 (0)