You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"expiration": {
Type: schema.TypeString,
Description:"Expiration of service account. Must be between NOW+15min & NOW+365d",
Optional:true,
Default:"1970-01-01T00:00:00Z",
ValidateDiagFunc: validateExpiration,
DiffSuppressFunc: suppressTimeDiffs,
},
Since its optional with a default, if nothing is passed in the upjet generated provider, it will set the value to 1970-01-01T00:00:00Z and ONLY in crossplane provider, it will trigger an error caused by this validation.
funcvalidateExpiration(valany, p cty.Path) diag.Diagnostics {
vardiags diag.Diagnosticsvalue:=val.(string)
expiration, err:=time.Parse(time.RFC3339, value)
iferr!=nil {
diags=append(diags, diag.Diagnostic{
Severity: diag.Error,
Summary: "Invalid expiration",
Detail: fmt.Sprintf("%q cannot be parsed as RFC3339 Timestamp Format", value),
})
}
key_duration:=time.Until(expiration)
ifkey_duration<15*time.Minute||key_duration>365*24*60*time.Minute {
diags=append(diags, diag.Diagnostic{
Severity: diag.Error,
Summary: "Invalid expiration",
Detail: "Expiration must between 15 minutes and 365 days in the future",
})
}
returndiags
}
Is there any mechanism in upjet which can change the default logic? I.e. removing the default value for the field?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have an issue with provider minio.
This is the block for a field expiration
Since its optional with a default, if nothing is passed in the upjet generated provider, it will set the value to
1970-01-01T00:00:00Zand ONLY in crossplane provider, it will trigger an error caused by this validation.Is there any mechanism in upjet which can change the default logic? I.e. removing the default value for the field?
All reactions