@@ -23,6 +23,7 @@ import (
2323
2424 generate "github.com/aws-controllers-k8s/code-generator/pkg/generate"
2525 ackgenerate "github.com/aws-controllers-k8s/code-generator/pkg/generate/ack"
26+ ackoutput "github.com/aws-controllers-k8s/code-generator/pkg/generate/output"
2627 "github.com/aws-controllers-k8s/code-generator/pkg/model"
2728)
2829
4243
4344// apiCmd is the command that generates service API types
4445var apisCmd = & cobra.Command {
45- Use : "apis <service>" ,
46- Short : "Generate Kubernetes API type definitions for an AWS service API" ,
47- RunE : generateAPIs ,
46+ Use : "apis <service>" ,
47+ Short : "Generate Kubernetes API type definitions for an AWS service API" ,
48+ RunE : generateAPIs ,
49+ PostRunE : saveGeneratedArtifactMetadata ,
4850}
4951
5052func init () {
@@ -54,6 +56,19 @@ func init() {
5456 rootCmd .AddCommand (apisCmd )
5557}
5658
59+ // saveGeneratedArtifactMetadata saves the parameters used to generate APIs and checksum
60+ // of the generated code.
61+ func saveGeneratedArtifactMetadata (cmd * cobra.Command , args []string ) error {
62+ err := ackoutput .CreateArtifact (
63+ optGenVersion ,
64+ filepath .Join (optOutputPath , "apis" ),
65+ ackoutput .UpdateReasonAPIGeneration ,
66+ optAWSSDKGoVersion ,
67+ optGeneratorConfigPath ,
68+ )
69+ return err
70+ }
71+
5772// generateAPIs generates the Go files for each resource in the AWS service
5873// API.
5974func generateAPIs (cmd * cobra.Command , args []string ) error {
0 commit comments