fix: add ready condition to OAuth2ClientStatus (#122)

This commit is contained in:
andremarianiello
2023-03-27 11:34:35 -04:00
committed by GitHub
parent 6aba89e7a8
commit fdedbe52ad
18 changed files with 276 additions and 49 deletions

View File

@ -1,4 +1,4 @@
// Copyright © 2022 Ory Corp
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Package v1alpha1 contains API Schema definitions for the hydra v1alpha1 API group

View File

@ -1,4 +1,4 @@
// Copyright © 2022 Ory Corp
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
@ -132,8 +132,9 @@ type TokenEndpointAuthMethod string
// OAuth2ClientStatus defines the observed state of OAuth2Client
type OAuth2ClientStatus struct {
// ObservedGeneration represents the most recent generation observed by the daemon set controller.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
ReconciliationError ReconciliationError `json:"reconciliationError,omitempty"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
ReconciliationError ReconciliationError `json:"reconciliationError,omitempty"`
Conditions []OAuth2ClientCondition `json:"conditions,omitempty"`
}
// ReconciliationError represents an error that occurred during the reconciliation process
@ -144,6 +145,27 @@ type ReconciliationError struct {
Description string `json:"description,omitempty"`
}
// OAuth2ClientCondition contains condition information for an OAuth2Client
type OAuth2ClientCondition struct {
Type OAuth2ClientConditionType `json:"type"`
Status ConditionStatus `json:"status"`
}
type OAuth2ClientConditionType string
const (
OAuth2ClientConditionReady = "Ready"
)
// +kubebuilder:validation:Enum=True;False;Unknown
type ConditionStatus string
const (
ConditionTrue ConditionStatus = "True"
ConditionFalse ConditionStatus = "False"
ConditionUnknown ConditionStatus = "Unknown"
)
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

View File

@ -1,4 +1,4 @@
// Copyright © 2022 Ory Corp
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package v1alpha1

View File

@ -1,9 +1,24 @@
// Copyright © 2022 Ory Corp
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
@ -33,7 +48,7 @@ func (in *OAuth2Client) DeepCopyInto(out *OAuth2Client) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuth2Client.
@ -54,6 +69,21 @@ func (in *OAuth2Client) DeepCopyObject() runtime.Object {
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OAuth2ClientCondition) DeepCopyInto(out *OAuth2ClientCondition) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuth2ClientCondition.
func (in *OAuth2ClientCondition) DeepCopy() *OAuth2ClientCondition {
if in == nil {
return nil
}
out := new(OAuth2ClientCondition)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OAuth2ClientList) DeepCopyInto(out *OAuth2ClientList) {
*out = *in
@ -137,6 +167,11 @@ func (in *OAuth2ClientSpec) DeepCopy() *OAuth2ClientSpec {
func (in *OAuth2ClientStatus) DeepCopyInto(out *OAuth2ClientStatus) {
*out = *in
out.ReconciliationError = in.ReconciliationError
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]OAuth2ClientCondition, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuth2ClientStatus.