-
Notifications
You must be signed in to change notification settings - Fork 23
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
Dont create deployment without a pull secret #343
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@idlewis Looks good. Thank you. Added a comment to move more code into util.
if instance.Spec.ServiceAccountName != nil && *instance.Spec.ServiceAccountName != "" { | ||
saName = *instance.Spec.ServiceAccountName | ||
} | ||
saErr := appstacksutils.PullSecretExists(saName, instance.Namespace, r.GetClient()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To minimize the amount of changes needed for each controller, it'll be good if the above logic to determine the service account name is also moved into the util method. The variable ba
(of type common.BaseComponent) can be passed instead of saName and instance.Namespace. They can be retrieved from ba
along with CR fields (i.e. ba.GetServiceAccountName()). Util method CustomizeRoute is a good reference. It's fine to pass in client along with ba.
Suggested name for the method: ServiceAccountPullSecretExists
The cluster automatically creates pull secrets for the service account. This can take a while. Sometimes, the controller creates the deployment before the pull secret is created. This causes the pods to go into an image pull backoff loop. Check that the pull secret exists before the deployment is created, to prevent this
@leochr review comments addressed, pls could you take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@idlewis Looks good. Thank you.
The cluster automatically creates pull secrets for the service account.
This can take a while.
Sometimes, the controller creates the deployment before the pull secret
is created. This causes the pods to go into an image pull backoff loop.
Check that the pull secret exists before the deployment is created, to
prevent this
This will help us to fix issue OpenLiberty/open-liberty-operator#312