Skip to content
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

chore: deploy configmaps as a part of pipeline #375

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

ksimon1
Copy link
Member

@ksimon1 ksimon1 commented Apr 18, 2024

What this PR does / why we need it:
chore: deploy configmaps as a part of pipeline

this change will remove the step, when user has to manually create the necessary ConfigMaps needed by VM. They are now deployed and removed by the Pipeline.
Added new parameter acceptEula - By setting this parameter, user is agreeing to the applicable Microsoft end user license agreement(s) for each deployment or installation for the Microsoft product(s). If param is set to false, or empty, pipeline will exit immediatelly
Snímek obrazovky z 2024-05-07 15-13-04
Release note:

Windows Pipelines now deploy/remove example ConfiMaps with (auto)unattend.xml file
Added new parameter acceptEula - By setting this parameter to true, user is accepting Eula specified in autounattend.xml file in ConfigMap

@kubevirt-bot kubevirt-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Apr 18, 2024
@openshift-ci openshift-ci bot requested a review from jcanocan April 18, 2024 07:34
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 18, 2024
@ksimon1
Copy link
Member Author

ksimon1 commented Apr 18, 2024

/cc @dominikholler

@ksimon1
Copy link
Member Author

ksimon1 commented Apr 18, 2024

/retest

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 30, 2024
@ksimon1 ksimon1 force-pushed the apply-configmaps branch from 1cc32fe to c89d715 Compare May 7, 2024 12:52
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 7, 2024
@ksimon1 ksimon1 force-pushed the apply-configmaps branch 2 times, most recently from f8e1986 to 53844de Compare May 7, 2024 13:20
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 13, 2024
@ksimon1 ksimon1 force-pushed the apply-configmaps branch from 53844de to 86a6b69 Compare May 23, 2024 14:28
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 23, 2024
@ksimon1 ksimon1 force-pushed the apply-configmaps branch from 86a6b69 to 89d5876 Compare May 23, 2024 14:31
@ksimon1
Copy link
Member Author

ksimon1 commented May 27, 2024

/retest

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 30, 2024
@ksimon1 ksimon1 force-pushed the apply-configmaps branch from 89d5876 to da9248f Compare May 30, 2024 06:44
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 30, 2024
@ksimon1 ksimon1 changed the title [WIP] chore: deploy configmaps as a part of pipeline chore: deploy configmaps as a part of pipeline May 30, 2024
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 30, 2024
@akrejcir
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 31, 2024
@ksimon1 ksimon1 force-pushed the apply-configmaps branch from da9248f to 8e3d46d Compare June 3, 2024 07:20
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2024
- name: delete-imported-configmaps
params:
- name: SCRIPT
value: oc delete -f $(params.autounattendXMLConfigMapsURL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we cache the config map somewhere? If it changes during the pipeline run, then the delete might not work as expected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use the customizeConfigMapName or autounattendConfigMapName params to delete the correct configmaps instead of URL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem will be, if the URL contains multiple configmaps, then it will delete only single CM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you return the created config maps as a result in import-unattend-configmaps and use that result to delete them in delete-imported-configmaps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, because the task does not have results defined in manifest https://github.com/tektoncd/catalog/blob/main/task/openshift-client/0.2/openshift-client.yaml#L14

Copy link
Member

@0xFelix 0xFelix Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you perhaps cache the ConfigMaps file in a Workspace instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken, the workspaces requires record in PipelinerRun (see the note in https://tekton.dev/docs/pipelines/workspaces/#specifying-workspaces-in-pipelineruns). That means, we would break triggering of the pipeline from the UI. Users would have to build their own manifest for triggering the pipeline, which would go against the idea of this pipeline.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunate. I'm just concerned this will be handed back to us as a possible bug in the future. If there's not other way, maybe we can at least document it in the description or somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point, let me update it tomorrow

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documented in 4bda75d

this change will remove the step, when user has to manually create
the necessary ConfigMaps needed by VM. They are now deployed
and removed by the Pipeline.

Added new parameter acceptEula - By setting this parameter to true,
user is accepting Eula specified in autounattend.xml file in ConfigMap.
If param is set to false, pipeline will exit immediatelly

Signed-off-by: Karel Simon <[email protected]>
@ksimon1 ksimon1 force-pushed the apply-configmaps branch from 8e3d46d to 5ec350f Compare June 3, 2024 08:28
during the Pipeline run

The contents of autounattendXMLConfigMapsURL may change during the
Pipeline run. This commit documents that if this happens, Pipeline
may not be able to remove all deployed ConfigMaps.

Signed-off-by: Karel Simon <[email protected]>
Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 4, 2024
Copy link

openshift-ci bot commented Jun 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 0xFelix, ksimon1

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ksimon1
Copy link
Member Author

ksimon1 commented Jun 4, 2024

/retest

1 similar comment
@ksimon1
Copy link
Member Author

ksimon1 commented Jun 4, 2024

/retest

@ksimon1 ksimon1 merged commit 9bc150d into kubevirt:main Jun 4, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants