-
Notifications
You must be signed in to change notification settings - Fork 191
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
Fix multiple installersets for tektonaddon #574
Fix multiple installersets for tektonaddon #574
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.
@savitaashture can we have some tests ? (not sure how easy it would be but still)
eeeb699
to
ee232ad
Compare
Updated e2e test to verify installerSets for addon based on label |
ee232ad
to
95c0925
Compare
TriggersResourcesInstallerSet = "TriggersResources" | ||
ConsoleCLIInstallerSet = "ConsoleCLI" | ||
MiscellaneousResourcesInstallerSet = "MiscellaneousResources" | ||
CreatedByValue = "TektonAddon" |
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.
these are addon specific const right?
should we keep them in addon pkg? and not in tektoninstallerset?
ctIs, err := oc.OperatorV1alpha1().TektonInstallerSets(). | ||
Get(ctx, compInstallerSet, metav1.GetOptions{}) | ||
// Delete installer sets if exist more than one | ||
if len(installerSets.Items) > 1 { |
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.
here if there are more than 1 installer set we are deleting all right?
then do we need to continue after deleting?
as after deleting
we are looping on items
for i := range installerSets.Items {
but we have already deleted all
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.
we need a return statement I think after deleting
@@ -369,26 +354,34 @@ func (r *Reconciler) ensureClusterTasks(ctx context.Context, ta *v1alpha1.Tekton | |||
// and if installer set which already exist is of older version then it deletes and return false to create a new | |||
// installer set | |||
func checkIfInstallerSetExist(ctx context.Context, oc clientset.Interface, relVersion string, |
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.
as this is more generalised now, can we move this to installer Set pkg
so that other component can use the same?
something like installerSet.GetByLabel()
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.
@sm43 Shall i do that as separate PR once @pradeepitm12 changes are also in for this multiple installerset fix for Pipeline and Triggers
and together will do one refactoring PR
WDYT?
/cc @nikhil-thomas
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.
separate pr sound fine.
could you create and issue (or jira) to track this.
95c0925
to
29222a5
Compare
@sm43 @nikhil-thomas I have addressed review comments except refactoring part WDYT? |
@@ -134,7 +131,7 @@ func (oe openshiftExtension) PostReconcile(ctx context.Context, comp v1alpha1.Te | |||
} | |||
|
|||
// spec hash stored on installerSet | |||
lastAppliedHash := installedTIS.GetAnnotations()[tektoninstallerset.LastAppliedHashKey] | |||
lastAppliedHash := installedTIS.Items[0].GetAnnotations()[tektoninstallerset.LastAppliedHashKey] |
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.
should we have a check for len
for Items ? just to be safe before accessing
29222a5
to
ec659de
Compare
@savitaashture could you make 2 changes
|
ec659de
to
7401a02
Compare
@nikhil-thomas Addressed Thank you 👍 |
7401a02
to
99edd78
Compare
✅ lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nikhil-thomas 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:
Approvers can indicate their approval by writing |
LGTM |
Changes
This PR fixes creation of multiple installer set for clustertasks addon
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Release Notes