-
Notifications
You must be signed in to change notification settings - Fork 18
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
remove toolchaincluster resources creation #107
remove toolchaincluster resources creation #107
Conversation
How about the ServiceAccount creation? toolchain-cicd/scripts/add-cluster.sh Lines 33 to 39 in 4828b26
shouldn't we drop that too? |
@MatousJobanek I tried but I think we need to get rid of toolchain-cicd/scripts/add-cluster.sh Line 282 in 35e64c7
|
I think we will remove that once we create the ToolchainCluster from the controller as well, right ? |
it's not about creating ToolchainCluster CR, but rather about timing when the SA is created. |
if [[ -n `oc get rolebinding ${SA_NAME} 2>/dev/null` ]]; then | ||
oc delete rolebinding ${SA_NAME} -n ${OPERATOR_NS} ${OC_ADDITIONAL_PARAMS} | ||
fi |
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.
Shouldn't we update the ToolchainCluster_resources controller to delete the rolebinding before applying the templates before we remove this?
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.
Good point @rajivnathan !
TBH I wasn't aware of this limitation - and this might complicate things a bit since the resource controller is not aware of which resources is creating, it should be generic.
Maybe @MatousJobanek might know better if this is still required ?
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.
The deletion part was there just to make sure that the RoleBinding can be updated also in the cases when we would change the name of the Role that is referenced there - you know, it's not possible to update roleRef
for an already existing RoleBinding.
I guess that this is from the time when we were doing many changes in the content of the script/resources.
That being said, I think that it's fine to keep it as it is in the Toolchaincluster resources controller 👍 we can change it later in the case when we would need to update the roleRef
.
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.
Ok , thanks for the background . Thus we can avoid the deletion part in the controller atm.
CLUSTER_ROLE_NAME=${SA_NAME}-${OPERATOR_NS}-toolchaincluster | ||
# we need to delete the binding since we cannot change the roleRef of the existing binding | ||
if [[ -n `oc get ClusterRoleBinding ${CLUSTER_ROLE_NAME} ${OC_ADDITIONAL_PARAMS} 2>/dev/null` ]]; then | ||
oc delete ClusterRoleBinding ${CLUSTER_ROLE_NAME} ${OC_ADDITIONAL_PARAMS} |
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.
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.
yeah, the same reason - to be able to update ClusterRole name in the roleRef
section
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.
thanks
* add wait for service account function
This PR removes toolchaincluster resouce creation that now is covered by the toolchainresources_controller.
Related PRs:
Replaces:
Jira: https://issues.redhat.com/browse/KUBESAW-24