open-cluster-management-io / api

Core APIs for open cluster management
https://open-cluster-management.io
Apache License 2.0
251 stars 77 forks source link

:bug: update RolloutStrategy embed struct #264

Closed haoqing0110 closed 1 year ago

haoqing0110 commented 1 year ago

Summary

When I have the below code, found the timeout field will not be created/patched, always empty value, update the embed struct can fix the issue.

            ginkgo.By("update cma to rolling update with timeout")
            cma, err = hubAddonClient.AddonV1alpha1().ClusterManagementAddOns().Get(context.Background(), cma.Name, metav1.GetOptions{})
            gomega.Expect(err).ToNot(gomega.HaveOccurred())
            cma.Spec.InstallStrategy.Placements[0].RolloutStrategy = clusterv1alpha1.RolloutStrategy{
                Type:        clusterv1alpha1.Progressive,
                Progressive: &clusterv1alpha1.RolloutProgressive{MaxConcurrency: intstr.FromString("50%"), Timeout: clusterv1alpha1.Timeout{Timeout: "2s"}},
            }
            patchClusterManagementAddOn(context.Background(), cma)

Related issue(s)

Fixes #

haoqing0110 commented 1 year ago

/assign @qiujian16

openshift-ci[bot] commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haoqing0110, qiujian16

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: - ~~[OWNERS](https://github.com/open-cluster-management-io/api/blob/main/OWNERS)~~ [qiujian16] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment