Documentation ¶
Index ¶
- Constants
- type CustomResourceAdapter
- type ObjectState
- type ProjectClaimAdapter
- func (c *ProjectClaimAdapter) CreateFakeSecret() error
- func (c *ProjectClaimAdapter) DeleteFakeSecret() error
- func (c *ProjectClaimAdapter) EnsureCCSSecretFinalizer() (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) EnsureCCSSecretFinalizerDeleted() error
- func (c *ProjectClaimAdapter) EnsureFinalizer() (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) EnsureProjectClaimDeletionProcessed() (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) EnsureProjectClaimFakeProcessed() (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) EnsureProjectClaimFinalizerDeleted() error
- func (c *ProjectClaimAdapter) EnsureProjectClaimInitialized() (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) EnsureProjectClaimState(state gcpv1alpha1.ClaimStatus) (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) EnsureProjectClaimStatePending() (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) EnsureProjectClaimStatePendingProject() (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) EnsureProjectReferenceExists() (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) EnsureProjectReferenceLink() (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) EnsureRegionSupported() (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) FinalizeProjectClaim() (ObjectState, error)
- func (c *ProjectClaimAdapter) IsProjectClaimDeletion() bool
- func (c *ProjectClaimAdapter) IsProjectReferenceDeletion() bool
- func (c *ProjectClaimAdapter) IsRegionSupported() (bool, error)
- func (c *ProjectClaimAdapter) ProjectReferenceExists() (bool, error)
- func (c *ProjectClaimAdapter) SetProjectClaimCondition(conditionType gcpv1alpha1.ConditionType, reason string, err error) (gcputil.OperationResult, error)
- func (c *ProjectClaimAdapter) StatusUpdate() error
- func (c *ProjectClaimAdapter) UpdateFakeProjectClaimSpecs() (bool, error)
- func (c *ProjectClaimAdapter) UpdateFakeProjectClaimState() (bool, error)
- type ProjectClaimReconciler
- type ReconcileOperation
Constants ¶
const CCSSecretFinalizer string = "finalizer.gcp.managed.openshift.io/ccs" //#nosec G101 -- not a secret
const FakeProjectClaim string = "managed.openshift.com/fake"
const ProjectClaimFinalizer string = "finalizer.gcp.managed.openshift.io"
const RegionCheckFailed string = "RegionCheckFailed"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomResourceAdapter ¶
type CustomResourceAdapter interface { EnsureProjectClaimFakeProcessed() (gcputil.OperationResult, error) EnsureProjectClaimDeletionProcessed() (gcputil.OperationResult, error) ProjectReferenceExists() (bool, error) EnsureProjectClaimInitialized() (gcputil.OperationResult, error) EnsureProjectClaimStatePending() (gcputil.OperationResult, error) EnsureProjectClaimStatePendingProject() (gcputil.OperationResult, error) EnsureRegionSupported() (gcputil.OperationResult, error) EnsureProjectReferenceExists() (gcputil.OperationResult, error) EnsureProjectReferenceLink() (gcputil.OperationResult, error) EnsureFinalizer() (gcputil.OperationResult, error) EnsureCCSSecretFinalizer() (gcputil.OperationResult, error) FinalizeProjectClaim() (ObjectState, error) SetProjectClaimCondition(gcpv1alpha1.ConditionType, string, error) (gcputil.OperationResult, error) }
type ObjectState ¶
type ObjectState bool
const ( ObjectModified ObjectState = true ObjectUnchanged ObjectState = false )
type ProjectClaimAdapter ¶
type ProjectClaimAdapter struct {
// contains filtered or unexported fields
}
func NewProjectClaimAdapter ¶
func NewProjectClaimAdapter(projectClaim *gcpv1alpha1.ProjectClaim, logger logr.Logger, client client.Client, manager condition.Conditions) *ProjectClaimAdapter
func (*ProjectClaimAdapter) CreateFakeSecret ¶
func (c *ProjectClaimAdapter) CreateFakeSecret() error
func (*ProjectClaimAdapter) DeleteFakeSecret ¶
func (c *ProjectClaimAdapter) DeleteFakeSecret() error
func (*ProjectClaimAdapter) EnsureCCSSecretFinalizer ¶
func (c *ProjectClaimAdapter) EnsureCCSSecretFinalizer() (gcputil.OperationResult, error)
EnsureCCSSecretFinalizer adss finalizer to a CCSSecret
func (*ProjectClaimAdapter) EnsureCCSSecretFinalizerDeleted ¶
func (c *ProjectClaimAdapter) EnsureCCSSecretFinalizerDeleted() error
EnsureCCSSecretFinalizerDeleted deletes the finalizer for the access credentials secret to the CCS gcp project
func (*ProjectClaimAdapter) EnsureFinalizer ¶
func (c *ProjectClaimAdapter) EnsureFinalizer() (gcputil.OperationResult, error)
EnsureFinalizer adds finalizer to a ProjectClaim
func (*ProjectClaimAdapter) EnsureProjectClaimDeletionProcessed ¶
func (c *ProjectClaimAdapter) EnsureProjectClaimDeletionProcessed() (gcputil.OperationResult, error)
EnsureProjectClaimDeletionProcessed deletes ProjectClaim in cases a deletion was triggered
func (*ProjectClaimAdapter) EnsureProjectClaimFakeProcessed ¶
func (c *ProjectClaimAdapter) EnsureProjectClaimFakeProcessed() (gcputil.OperationResult, error)
func (*ProjectClaimAdapter) EnsureProjectClaimFinalizerDeleted ¶
func (c *ProjectClaimAdapter) EnsureProjectClaimFinalizerDeleted() error
EnsureProjectClaimFinalizerDeleted removes finalizer of a ProjectClaim
func (*ProjectClaimAdapter) EnsureProjectClaimInitialized ¶
func (c *ProjectClaimAdapter) EnsureProjectClaimInitialized() (gcputil.OperationResult, error)
EnsureProjectClaimInitialized initializes ProjectClaim fields with empty values
func (*ProjectClaimAdapter) EnsureProjectClaimState ¶
func (c *ProjectClaimAdapter) EnsureProjectClaimState(state gcpv1alpha1.ClaimStatus) (gcputil.OperationResult, error)
EnsureProjectClaimState sets the Status of a ProjectClaim
func (*ProjectClaimAdapter) EnsureProjectClaimStatePending ¶
func (c *ProjectClaimAdapter) EnsureProjectClaimStatePending() (gcputil.OperationResult, error)
EnsureProjectClaimStatePending sets a ProjectClaim State to Pending for the case ProjectReference CR is being set up
func (*ProjectClaimAdapter) EnsureProjectClaimStatePendingProject ¶
func (c *ProjectClaimAdapter) EnsureProjectClaimStatePendingProject() (gcputil.OperationResult, error)
EnsureProjectClaimStatePendingProject sets a ProjectClaim State to PendingProject for the case gcp project for the ProjectReference is being prepared
func (*ProjectClaimAdapter) EnsureProjectReferenceExists ¶
func (c *ProjectClaimAdapter) EnsureProjectReferenceExists() (gcputil.OperationResult, error)
EnsureProjectReferenceExists triggers Reconcile requeue for the case a ProjectReference for a ProjectClaim doesn't exist yet
func (*ProjectClaimAdapter) EnsureProjectReferenceLink ¶
func (c *ProjectClaimAdapter) EnsureProjectReferenceLink() (gcputil.OperationResult, error)
EnsureProjectReferenceLink the initial ProjectClaim to the ProjectReference that has been created
func (*ProjectClaimAdapter) EnsureRegionSupported ¶
func (c *ProjectClaimAdapter) EnsureRegionSupported() (gcputil.OperationResult, error)
EnsureRegionSupported modifies projectClaim.Status.State with result from IsRegionSupported. If a region is not supported it returns an error and sets projectClaim.Status.State to ClaimStatusError.
func (*ProjectClaimAdapter) FinalizeProjectClaim ¶
func (c *ProjectClaimAdapter) FinalizeProjectClaim() (ObjectState, error)
FinalizeProjectClaim handles the deletion of a ProjectClaim, including deletion of ProjectReference and Secret
func (*ProjectClaimAdapter) IsProjectClaimDeletion ¶
func (c *ProjectClaimAdapter) IsProjectClaimDeletion() bool
IsProjectClaimDeletion checks whether deletion was triggered for a ProjectClaim
func (*ProjectClaimAdapter) IsProjectReferenceDeletion ¶
func (c *ProjectClaimAdapter) IsProjectReferenceDeletion() bool
IsProjectReferenceDeletion checks whether deletion was triggered for a ProjectReference
func (*ProjectClaimAdapter) IsRegionSupported ¶
func (c *ProjectClaimAdapter) IsRegionSupported() (bool, error)
IsRegionSupported checks if current region is supported. It returns an error message if a region is not supported.
func (*ProjectClaimAdapter) ProjectReferenceExists ¶
func (c *ProjectClaimAdapter) ProjectReferenceExists() (bool, error)
ProjectReferenceExists checks whether a matching ProjectReference already exists
func (*ProjectClaimAdapter) SetProjectClaimCondition ¶
func (c *ProjectClaimAdapter) SetProjectClaimCondition(conditionType gcpv1alpha1.ConditionType, reason string, err error) (gcputil.OperationResult, error)
SetProjectClaimCondition calls SetCondition() with project claim conditions
func (*ProjectClaimAdapter) StatusUpdate ¶
func (c *ProjectClaimAdapter) StatusUpdate() error
StatusUpdate updates the project claim status
func (*ProjectClaimAdapter) UpdateFakeProjectClaimSpecs ¶
func (c *ProjectClaimAdapter) UpdateFakeProjectClaimSpecs() (bool, error)
func (*ProjectClaimAdapter) UpdateFakeProjectClaimState ¶
func (c *ProjectClaimAdapter) UpdateFakeProjectClaimState() (bool, error)
type ProjectClaimReconciler ¶
ProjectClaimReconciler reconciles a ProjectClaim object
func (*ProjectClaimReconciler) Reconcile ¶
func (r *ProjectClaimReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ProjectClaim object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.0/pkg/reconcile
func (*ProjectClaimReconciler) ReconcileHandler ¶
func (r *ProjectClaimReconciler) ReconcileHandler(adapter CustomResourceAdapter) (ctrl.Result, error)
ReconcileHandler reads that state of the cluster for a ProjectClaim object and makes changes based on the state read and what is in the ProjectClaim.Spec Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
func (*ProjectClaimReconciler) SetupWithManager ¶
func (r *ProjectClaimReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ReconcileOperation ¶
type ReconcileOperation func() (gcputil.OperationResult, error)