Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResourceCleaner ¶
type ResourceCleaner struct {
// contains filtered or unexported fields
}
ResourceCleaner hold the context required for cleaning
func NewResourceCleaner ¶
func NewResourceCleaner(log *logrus.Entry, env env.Core, shouldDelete checkFn, dryRun bool) (*ResourceCleaner, error)
NewResourceCleaner instantiates the new RC object
func (*ResourceCleaner) CleanOrphanedE2EServicePrincipals ¶
func (rc *ResourceCleaner) CleanOrphanedE2EServicePrincipals(ctx context.Context, ttl time.Duration) error
CleanOrphanedE2EServicePrincipals removes orphaned service principals created during e2e test runs. It processes two types of identities:
- Cluster service principals (aro-v4-e2e-*)
- Mock MSI service principals for MIWI tests (mock-msi-*)
Safety mechanisms prevent deletion of:
- Service principals without V{BUILDID} pattern
- Service principals whose resource groups have the 'persist' tag
- Service principals younger than the TTL
This function only processes the first page of results (~100 items per prefix) from Microsoft Graph API. Since the cleanup runs on a schedule, orphaned resources will eventually be cleaned across multiple runs.
func (*ResourceCleaner) CleanResourceGroups ¶
func (rc *ResourceCleaner) CleanResourceGroups(ctx context.Context) error
CleanResourceGroups loop through the resourgroups in the subscription and deleted everything that is not marked for deletion The deletion check is performed by passed function: DeleteCheck