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

Status update should not requeue request for the reconciliation #84

Open
mnkg561 opened this issue Jul 15, 2021 · 0 comments
Open

Status update should not requeue request for the reconciliation #84

mnkg561 opened this issue Jul 15, 2021 · 0 comments

Comments

@mnkg561
Copy link
Contributor

mnkg561 commented Jul 15, 2021

Is this a BUG REPORT or FEATURE REQUEST?:
BUG REPORT

What happened:
As part of this PR [https://github.com//pull/82] testing, we found that there is a delay in setting the status of IamRole resource and due to that same request comes again with the status "" instead of Ready which makes IamRole creation again. Apart from the fact, how to gracefully handle that scenario which is being take care in #82 but the issue in the first place is that the request came back for reconciliation. That is due to the fact that resource status got updated and that resulted in a requeue. We already implemented predicate function to ignore the reconciliation for the status update but looks like it is not working as expected.

What you expected to happen:

Status update should not result in reconciliation event there by a delay in setting iam role status should not impact the IamRole creation.

How to reproduce it (as minimally and precisely as possible):
Its an intermittent issue but attaching the logs

Anything else we need to know?:

Environment:

  • iam-manager version
  • 0.0.6
  • Kubernetes version :
$ kubectl version -o yaml

Other debugging information (if applicable):

- controller logs:

$ kubectl logs

2021-07-15T00:03:40.177Z DEBUG awsapi.iam.CreateRole Attaching Inline role policies {"request_id": "99ab2cab-dc2e-44d3-bf8e-e4d24db8f462", "roleName": "k8s-dev-patterns-iam-usw2-devp"}
2021-07-15T00:03:40.177Z DEBUG awsapi.iam.UpdateRole Initiating api call {"request_id": "99ab2cab-dc2e-44d3-bf8e-e4d24db8f462", "roleName": "k8s-dev-patterns-iam-usw2-devp"}
2021-07-15T00:03:40.270Z DEBUG awsapi.iam.UpdateRole Initiating api call {"request_id": "99ab2cab-dc2e-44d3-bf8e-e4d24db8f462", "roleName": "k8s-dev-patterns-iam-usw2-devp", "api": "UpdateAssumeRolePolicy"}
2021-07-15T00:03:40.373Z DEBUG awsapi.iam.UpdateRole AssumeRole Policy is successfully updated {"request_id": "99ab2cab-dc2e-44d3-bf8e-e4d24db8f462", "roleName": "k8s-dev-patterns-iam-usw2-devp"}
2021-07-15T00:03:40.373Z DEBUG awsapi.iam.AttachInlineRolePolicy Initiating api call {"request_id": "99ab2cab-dc2e-44d3-bf8e-e4d24db8f462", "roleName": "k8s-dev-patterns-iam-usw2-devp"}
2021-07-15T00:03:40.511Z DEBUG awsapi.iam.AttachInlineRolePolicy Successfully completed attaching InlineRolePolicy {"request_id": "99ab2cab-dc2e-44d3-bf8e-e4d24db8f462", "roleName": "k8s-dev-patterns-iam-usw2-devp"}
I0715 00:03:40.511563 1 event.go:281] Event(v1.ObjectReference{Kind:"Iamrole", Namespace:"dev-patterns-iam-usw2-devp", Name:"iamrole", UID:"0fe679b7-c327-4e04-843c-5ad9149f06e5", APIVersion:"iammanager.keikoproj.io/v1alpha1", ResourceVersion:"86803885", FieldPath:""}): type: 'Normal' reason: 'Ready' Successfully created/updated iam role
2021-07-15T00:03:40.521Z INFO controllers.iamrole_controller.HandleReconcile Successfully reconciled

^^ K8s event got created that State is ready but new request came backk again with State "" (You can see that in following logs)

{"request_id": "99ab2cab-dc2e-44d3-bf8e-e4d24db8f462", "iam_role_cr": "iamrole"}
2021-07-15T00:03:40.521Z INFO controllers.iamrole_controller.Reconcile Start of the request {"request_id": "96b21253-6307-4835-afed-dd7a798e8fe5"}
2021-07-15T00:03:40.521Z INFO controllers.iamrole_controller.HandleReconcile state of the custom resource {"request_id": "96b21253-6307-4835-afed-dd7a798e8fe5", "iam_role_cr": "iamrole", "state": ""}
2021-07-15T00:03:40.521Z DEBUG controllers.iamrole_controller.HandleReconcile roleName constructed successfully {"request_id": "96b21253-6307-4835-afed-dd7a798e8fe5", "iam_role_cr": "iamrole", "roleName": "k8s-dev-patterns-iam-usw2-devp"}
2021-07-15T00:03:40.521Z DEBUG internal.utils.utils.defaultTrustPolicy Default trust policy from cm {"request_id": "96b21253-6307-4835-afed-dd7a798e8fe5", "trust_policy": "{"Version": "2012-10-17","Statement": [{"Effect":

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant