Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "--cache-ttl" flag missing unit in duration #35

Merged
merged 1 commit into from Feb 7, 2022
Merged

Fix "--cache-ttl" flag missing unit in duration #35

merged 1 commit into from Feb 7, 2022

Conversation

zzl221000
Copy link
Contributor

Google Cloud document: Using Kaniko cache

The syntax is --cache-ttl=XXh where XX is time in hours. For example, --cache-ttl=6h sets the cache expiration to 6 hours. If you run builds using the gcloud builds submit --tag [IMAGE] command, the default value of the --cache-ttl flag is 6 hours. If you are using the Kaniko executor image directly, the default value is 2 weeks.

Copy link
Contributor

@shubham149 shubham149 left a comment

Choose a reason for hiding this comment

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

Default value of cache ttl is 2 weeks in kaniko https://github.com/GoogleContainerTools/kaniko#--cache-ttl-duration. Also, timeout is by default in hours

@zzl221000
Copy link
Contributor Author

@shubham149
Here is the source code for parsing the cache-ttl parameter:

RootCmd.PersistentFlags().DurationVarP(&opts.CacheTTL, "cache-ttl", "", time.Hour*336, "Cache timeout in hours. Defaults to two weeks.")

kaniko does not have default time units.

@shubham149
Copy link
Contributor

@zzl221000 Thanks for the update. LGTM

@shubham149 shubham149 merged commit d381ac6 into drone:main Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants