Merge pull request #3693 from irbekrm/3683_remove_renew_before_expiry_flag

Removes the deprecated renew-before-expiry flag
This commit is contained in:
jetstack-bot 2021-02-22 11:50:47 +01:00 committed by GitHub
commit a43e3309c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 17 deletions

View File

@ -238,8 +238,7 @@ func buildControllerContext(ctx context.Context, stopCh <-chan struct{}, opts *o
DefaultAutoCertificateAnnotations: opts.DefaultAutoCertificateAnnotations,
},
CertificateOptions: controller.CertificateOptions{
EnableOwnerRef: opts.EnableCertificateOwnerRef,
RenewBeforeExpiryDuration: opts.RenewBeforeExpiryDuration,
EnableOwnerRef: opts.EnableCertificateOwnerRef,
},
SchedulerOptions: controller.SchedulerOptions{
MaxConcurrentChallenges: opts.MaxConcurrentChallenges,

View File

@ -7,7 +7,6 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/certmanager:go_default_library",
"//pkg/apis/certmanager/v1:go_default_library",
"//pkg/controller/acmechallenges:go_default_library",
"//pkg/controller/acmeorders:go_default_library",
"//pkg/controller/certificaterequests/acme:go_default_library",

View File

@ -24,7 +24,6 @@ import (
"github.com/spf13/pflag"
cm "github.com/jetstack/cert-manager/pkg/apis/certmanager"
cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"
challengescontroller "github.com/jetstack/cert-manager/pkg/controller/acmechallenges"
orderscontroller "github.com/jetstack/cert-manager/pkg/controller/acmeorders"
cracmecontroller "github.com/jetstack/cert-manager/pkg/controller/certificaterequests/acme"
@ -69,7 +68,6 @@ type ControllerOptions struct {
ClusterIssuerAmbientCredentials bool
IssuerAmbientCredentials bool
RenewBeforeExpiryDuration time.Duration
// Default issuer/certificates details consumed by ingress-shim
DefaultIssuerName string
@ -114,7 +112,6 @@ const (
defaultClusterIssuerAmbientCredentials = true
defaultIssuerAmbientCredentials = false
defaultRenewBeforeExpiryDuration = cmapi.DefaultRenewBefore
defaultTLSACMEIssuerName = ""
defaultTLSACMEIssuerKind = "Issuer"
@ -175,7 +172,6 @@ func NewControllerOptions() *ControllerOptions {
EnabledControllers: defaultEnabledControllers,
ClusterIssuerAmbientCredentials: defaultClusterIssuerAmbientCredentials,
IssuerAmbientCredentials: defaultIssuerAmbientCredentials,
RenewBeforeExpiryDuration: defaultRenewBeforeExpiryDuration,
DefaultIssuerName: defaultTLSACMEIssuerName,
DefaultIssuerKind: defaultTLSACMEIssuerKind,
DefaultIssuerGroup: defaultTLSACMEIssuerGroup,
@ -249,11 +245,6 @@ func (s *ControllerOptions) AddFlags(fs *pflag.FlagSet) {
"Whether an issuer may make use of ambient credentials. 'Ambient Credentials' are credentials drawn from the environment, metadata services, or local files which are not explicitly configured in the Issuer API object. "+
"When this flag is enabled, the following sources for credentials are also used: "+
"AWS - All sources the Go SDK defaults to, notably including any EC2 IAM roles available via instance metadata.")
fs.DurationVar(&s.RenewBeforeExpiryDuration, "renew-before-expiry-duration", defaultRenewBeforeExpiryDuration, ""+
"The default 'renew before expiry' time for Certificates. "+
"Once a certificate is within this duration until expiry, a new Certificate "+
"will be attempted to be issued.")
fs.MarkDeprecated("renew-before-expiry-duration", "Deprecated. Please set the Certificate.Spec.RenewBefore field.")
fs.StringSliceVar(&s.DefaultAutoCertificateAnnotations, "auto-certificate-annotations", defaultAutoCertificateAnnotations, ""+
"The annotation consumed by the ingress-shim controller to indicate a ingress is requesting a certificate")

View File

@ -215,7 +215,7 @@ func (c *controllerWrapper) Register(ctx *controllerpkg.Context) (workqueue.Rate
ctx.KubeSharedInformerFactory,
ctx.SharedInformerFactory,
PolicyChain,
ctx.CertificateOptions.RenewBeforeExpiryDuration,
cmapi.DefaultRenewBefore,
)
c.controller = ctrl

View File

@ -138,10 +138,6 @@ type CertificateOptions struct {
// EnableOwnerRef controls whether the certificate is configured as an owner of
// secret where the effective TLS certificate is stored.
EnableOwnerRef bool
// RenewBeforeExpiryDuration is the default 'renew before expiry' time for Certificates.
// Once a certificate is within this duration until expiry, a new Certificate
// will be attempted to be issued.
RenewBeforeExpiryDuration time.Duration
}
type SchedulerOptions struct {