-
Notifications
You must be signed in to change notification settings - Fork 288
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
Add methods to fetch upgrader image from bundle #7283
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7283 +/- ##
==========================================
+ Coverage 71.65% 71.73% +0.07%
==========================================
Files 556 559 +3
Lines 43185 43416 +231
==========================================
+ Hits 30944 31144 +200
- Misses 10532 10553 +21
- Partials 1709 1719 +10 ☔ View full report in Codecov by Sentry. |
007680d
to
aa260aa
Compare
@@ -168,14 +166,20 @@ func (r *NodeUpgradeReconciler) reconcile(ctx context.Context, log logr.Logger, | |||
return ctrl.Result{}, nil | |||
} | |||
|
|||
configMap := &corev1.ConfigMap{} | |||
if err := remoteClient.Get(ctx, types.NamespacedName{Name: constants.UpgraderConfigMapName, Namespace: constants.EksaSystemNamespace}, configMap); err != nil { |
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.
Other option is so pass in the config map from here to node upgrade object, just so that if node upgrader is run on it's own for any reason, we can pass in any config map. If we decide to mount the config map to the upgrader pod directly, then that gives us a different amount of flexibility where we can deploy the pod directly with a different config map mounted. Just some thoughts that I have to consider.
c1599f2
to
72f570c
Compare
72f570c
to
d16f35a
Compare
if configMap.Data == nil { | ||
return ctrl.Result{}, errors.New("upgrader config map is empty") | ||
} | ||
upgraderImage := configMap.Data[nodeUpgrade.Spec.KubernetesVersion] |
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.
this check if configMap.Data == nil {
just verifies that the configmap data is still nil but not if the configmap contains an entry for the EKS Distro/K8s version we are looking for
We can keep that but can we also add something like this?
upgraderImage := configMap.Data[nodeUpgrade.Spec.KubernetesVersion] | |
upgraderImage, ok := configMap.Data[nodeUpgrade.Spec.KubernetesVersion] | |
if !ok { | |
return ctrl.Result{}, fmt.Errorf("upgrader image corresponding to EKS Distro version %s not found in the configmp", nodeUpgrade.Spec.KubernetesVersion) | |
} |
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.
Ah yes. I totally agree. Thanks!
if _, ok := upgraderConfigMap.Data[version]; !ok { | ||
upgraderConfigMap.Data[version] = image | ||
} |
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.
I think for this case, when a version is already in the configmap, we should override it instead of preserving the older version
if _, ok := upgraderConfigMap.Data[version]; !ok { | |
upgraderConfigMap.Data[version] = image | |
} | |
upgraderConfigMap.Data[version] = image |
d16f35a
to
0d2b99b
Compare
/approve |
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavmpandey08 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 |
Issue #, if available:
Description of changes:
The eks-a controller will be responsible for creating the custom CP/MD upgrade resources for in-place upgrades. We need a way to fetch the upgrader image from the bundle so this adds methods that will be used in the controller to pull the bundle and fetch the images. The images will be stored in a config map. This upgrader config map will then be fetched by the node upgrader when the image is needed.
ConfigMap:
Testing (if applicable):
performed in-place upgrade with image from bundle
Documentation added/planned (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.