-
Notifications
You must be signed in to change notification settings - Fork 1.4k
✨ Add CertificateValidityPeriod and CACertificateValidityPeriod to KubeadmConfig #12335
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
base: main
Are you sure you want to change the base?
Changes from all commits
7f713bb
29ee524
1680d8a
2834127
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,7 @@ func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { | |
spokeJoinControlPlaneFuzzer, | ||
spokeTimeoutsFuzzer, | ||
hubJoinConfigurationFuzzer, | ||
hubClusterConfigurationFuzzer, | ||
} | ||
} | ||
|
||
|
@@ -95,8 +96,13 @@ func spokeClusterConfigurationFuzzer(obj *ClusterConfiguration, c randfill.Conti | |
|
||
obj.Proxy = Proxy{} | ||
obj.EncryptionAlgorithm = "" | ||
obj.CACertificateValidityPeriod = nil | ||
obj.CertificateValidityPeriod = nil | ||
|
||
if obj.CertificateValidityPeriod != nil { | ||
obj.CertificateValidityPeriod = ptr.To[metav1.Duration](metav1.Duration{Duration: time.Duration(c.Int31()%24) * time.Hour * 24}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since there is no built in methods in time package to use time.Days(), I was facing round trip errors while converting hours to Days back and forth due to round off of minute field. Please suggest if there are any better ways to handle this. |
||
} | ||
if obj.CACertificateValidityPeriod != nil { | ||
obj.CACertificateValidityPeriod = ptr.To[metav1.Duration](metav1.Duration{Duration: time.Duration(c.Int31()%24) * time.Hour * 24}) | ||
} | ||
|
||
// Drop the following fields as they have been removed in v1beta2, so we don't have to preserve them. | ||
obj.Networking.ServiceSubnet = "" | ||
|
@@ -179,6 +185,18 @@ func hubJoinConfigurationFuzzer(obj *bootstrapv1.JoinConfiguration, c randfill.C | |
} | ||
} | ||
|
||
func hubClusterConfigurationFuzzer(obj *bootstrapv1.ClusterConfiguration, c randfill.Continue) { | ||
c.FillNoCustom(obj) | ||
|
||
if obj.CertificateValidityPeriodDays != nil { | ||
obj.CertificateValidityPeriodDays = ptr.To[int32](*obj.CertificateValidityPeriodDays % 24) | ||
} | ||
|
||
if obj.CACertificateValidityPeriodDays != nil { | ||
obj.CACertificateValidityPeriodDays = ptr.To[int32](*obj.CACertificateValidityPeriodDays % 24) | ||
} | ||
} | ||
|
||
func spokeBootstrapToken(in *BootstrapToken, c randfill.Continue) { | ||
c.FillNoCustom(in) | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.