Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ILS-233 Add additional check to prevent adding terminating namespace to OperatorGroup #946

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

alicenoknow
Copy link
Member

Follow-up to: #945

Currently terminating namespace can be added by our operandrequests-discovery feature to the OpertorGroup. In such case operator cannot create bindings in that namespace and crashes.

Signed-off-by: Alicja Niewiadomska <[email protected]>
Signed-off-by: Alicja Niewiadomska <[email protected]>
Signed-off-by: Alicja Niewiadomska <[email protected]>
Signed-off-by: Alicja Niewiadomska <[email protected]>
Signed-off-by: Alicja Niewiadomska <[email protected]>
@ibm-ci-bot ibm-ci-bot added size/M and removed size/S labels Nov 5, 2024
@ibm-ci-bot ibm-ci-bot added size/S and removed size/M labels Nov 5, 2024
@ljeda
Copy link
Member

ljeda commented Nov 5, 2024

just for the context, this is not really a real scenario as the normal scenario would be:

  • Namespace gets created,
  • OperandRequest gets created,
  • LS creates bindings,
  • Namespace gets removed (and it stucks in Terminating state for a while).

In such scenario I assume LS will not crash (at least immediately) as the bindings were already created.

Anyway, this is not a regression, so this does not need to be included in SC2 4.6.8.

controllers/operandrequest_discovery.go Outdated Show resolved Hide resolved
Signed-off-by: Alicja Niewiadomska <[email protected]>
Signed-off-by: Alicja Niewiadomska <[email protected]>
@alicenoknow
Copy link
Member Author

alicenoknow commented Nov 6, 2024

Test scenarios

  1. OperandRequest from terminating namespace -> LS should not add namespace to OperatorGroup
  2. Terminating namespace in OperatorGroup -> LS should remove namespace from OperatorGroup (job runs every 1h)
  3. OperandRequest from non-existing namespace -> LS should not add namespace to OperatorGroup
  4. Non-existing namespace already in OperatorGroup -> LS should remove namespace from OperatorGroup (job runs every 1h)

LS operator image:

docker-na-public.artifactory.swg-devops.com/hyc-cloud-private-scratch-docker-local/ibmcom/ibm-licensing-operator:ILS-233-operandrequest-terminating

controllers/operatorgroup_cleaner.go Outdated Show resolved Hide resolved
controllers/operatorgroup_cleaner.go Outdated Show resolved Hide resolved
Comment on lines 98 to 103
if err != nil {
if client.IgnoreNotFound(err) != nil {
return true, err
return false, err
}
return false, nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this just be like so now?

if err != nil {
	return false, err
}

Signed-off-by: Alicja Niewiadomska <[email protected]>
Signed-off-by: Alicja Niewiadomska <[email protected]>
@ibm-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alicenoknow, kflorianski-ibm, ljeda

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [alicenoknow,kflorianski-ibm,ljeda]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Alicja Niewiadomska <[email protected]>
@ibm-ci-bot ibm-ci-bot added size/M and removed size/S labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants