Open hugoShaka opened 2 hours ago
A potential fix would be a custom JSON unmarshaler:
// UnmarshalJSON serializes a JSON string into a spec. This override is required to deal with the
// MaxAge field which is special case because it's an object embedded into the spec.
func (spec TeleportOIDCConnectorSpec) UnmarshalJSON(data []byte) error {
type Alias TeleportOIDCConnectorSpec
temp := struct {
MaxAge types.Duration `json:"max_age"`
Alias
}{
Alias: (Alias)(spec),
}
if err := json.Unmarshal(data, &temp); err != nil {
return trace.Wrap(err, "unmarshalling custom teleport oidc connector spec")
}
spec.MaxAge = &types.MaxAge{Value: temp.MaxAge}
return nil
}
Expected behavior:
I create a
teleport_oidc_connector
CR withspec.max_age
set and the operator reconciles it.Current behavior:
The operator fails to convert the resource:
Bug details:
spec.max_age