Skip to content

Remove existing Secret files in (deprovision) Pod#2425

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
2uasimojo:HIVE-2604/ProjectToDir-trunc
Aug 26, 2024
Merged

Remove existing Secret files in (deprovision) Pod#2425
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
2uasimojo:HIVE-2604/ProjectToDir-trunc

Conversation

@2uasimojo
Copy link
Member

@2uasimojo 2uasimojo commented Aug 22, 2024

For Pods with restartPolicy: OnFailure, a failed container may be rerun in the same Pod, which will reuse the same file system as the initial run. When we project Secrets (for credentials, certs, etc) to directories in such containers, those writes can fail the second time around because the file already exists. Fix by removing the file, if it exists, before we write it.

Note that at the time of this commit, this only affects deprovision pods:

  • imageset pods don't use ProjectToDir
  • provision pods have restartPolicy: Never

HIVE-2604

For Pods with `restartPolicy: OnFailure`, a failed container may be
rerun in the same Pod, which will reuse the same file system as the
initial run. When we project Secrets (for credentials, certs, etc) to
directories in such containers, those writes can fail the second time
around because the file already exists. Fix by removing the file, if it
exists, before we write it.

Note that at the time of this commit, this only affects deprovision
pods:
- imageset pods don't use ProjectToDir
- provision pods have `restartPolicy: Never`

HIVE-2604
@openshift-ci openshift-ci bot requested review from dlom and lleshchi August 22, 2024 23:03
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 22, 2024
@2uasimojo
Copy link
Member Author

/assign @dlom

@2uasimojo 2uasimojo mentioned this pull request Aug 22, 2024
@dlom
Copy link
Contributor

dlom commented Aug 22, 2024

/lgtm

I don't envy the backport process for this...

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

openshift-ci bot commented Aug 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 2uasimojo, dlom

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 23, 2024

@2uasimojo: all tests passed!

Full PR test history. Your PR dashboard.

Details

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-sigs/prow repository. I understand the commands that are listed here.

@codecov
Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 46.24%. Comparing base (1ec27ad) to head (94b9b7b).
Report is 2 commits behind head on master.

Files Patch % Lines
contrib/pkg/utils/generic.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2425      +/-   ##
==========================================
- Coverage   46.24%   46.24%   -0.01%     
==========================================
  Files         279      279              
  Lines       32797    32799       +2     
==========================================
  Hits        15167    15167              
- Misses      16357    16359       +2     
  Partials     1273     1273              
Files Coverage Δ
contrib/pkg/utils/generic.go 9.75% <0.00%> (-0.17%) ⬇️

@2uasimojo
Copy link
Member Author

/retest

@2uasimojo
Copy link
Member Author

/override "Red Hat Konflux / hive-operator-enterprise-contract / hive"

I don't envy the backport process for this...

Shouldn't be so bad, though I will probably have to one of them manually.

/cherry-pick mce-2.6 mce-2.5 mce-2.4 mce-2.3

@openshift-cherrypick-robot

@2uasimojo: once the present PR merges, I will cherry-pick it on top of mce-2.6 in a new PR and assign it to you.

Details

In response to this:

/override "Red Hat Konflux / hive-operator-enterprise-contract / hive"

I don't envy the backport process for this...

Shouldn't be so bad, though I will probably have to one of them manually.

/cherry-pick mce-2.6 mce-2.5 mce-2.4 mce-2.3

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-sigs/prow repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 26, 2024

@2uasimojo: Overrode contexts on behalf of 2uasimojo: Red Hat Konflux / hive-operator-enterprise-contract / hive

Details

In response to this:

/override "Red Hat Konflux / hive-operator-enterprise-contract / hive"

I don't envy the backport process for this...

Shouldn't be so bad, though I will probably have to one of them manually.

/cherry-pick mce-2.6 mce-2.5 mce-2.4 mce-2.3

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-sigs/prow repository.

@openshift-merge-bot openshift-merge-bot bot merged commit 5f116d9 into openshift:master Aug 26, 2024
@openshift-cherrypick-robot

@2uasimojo: new pull request created: #2426

Details

In response to this:

/override "Red Hat Konflux / hive-operator-enterprise-contract / hive"

I don't envy the backport process for this...

Shouldn't be so bad, though I will probably have to one of them manually.

/cherry-pick mce-2.6 mce-2.5 mce-2.4 mce-2.3

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-sigs/prow repository.

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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants