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

Fix access denied when killing stopped container #1447

Merged

Conversation

gabriel-samfira
Copy link
Contributor

This change fixes access denied errors when killing an already stopped host process container.

This change also uses errors.Is() to compare errors in various functions of the hcs error package. This allows error wrapping while still properly validating that a wrapped error is of a certain type.

Signed-off-by: Gabriel Adrian Samfira gsamfira@cloudbasesolutions.com

@gabriel-samfira gabriel-samfira requested a review from a team as a code owner July 1, 2022 15:53
@gabriel-samfira gabriel-samfira force-pushed the fix-access-denied-error-on-kill branch from 4930b4c to 071d095 Compare July 1, 2022 16:19
This change fixes access denied errors when killing an already stopped
host process container.

This change also uses errors.Is() to compare errors in various functions
of the hcs error package. This allows error wrapping while still
properly validating that a wrapped error is of a certain type.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
@gabriel-samfira gabriel-samfira force-pushed the fix-access-denied-error-on-kill branch from 071d095 to 9e72a85 Compare July 1, 2022 16:45
Copy link
Contributor

@helsaawy helsaawy left a comment

Choose a reason for hiding this comment

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

If we are switching over to go1.13 style errors, should we also add Is( implementations as well so we can get rid of the getInnerError in all the Is<Error>( functions?

func (e *HcsError) Is(target error) bool {
    target = getInnerError
    return errors.Is(e.Err, target)
}

@dcantah
Copy link
Contributor

dcantah commented Jul 7, 2022

@helsaawy Good idea.. wanna take this up as a follow-up?

@helsaawy
Copy link
Contributor

helsaawy commented Jul 8, 2022

@helsaawy Good idea.. wanna take this up as a follow-up?

Am I being voluntold? 😅

@dcantah
Copy link
Contributor

dcantah commented Jul 8, 2022

LOL possibly.. 😆

@dcantah dcantah merged commit a6e4876 into microsoft:master Jul 8, 2022
kiashok pushed a commit to kiashok/hcsshim that referenced this pull request Jul 11, 2022
This change fixes access denied errors when killing an already stopped
host process container.

This change also uses errors.Is() to compare errors in various functions
of the hcs error package. This allows error wrapping while still
properly validating that a wrapped error is of a certain type.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
anmaxvl pushed a commit that referenced this pull request Feb 7, 2023
princepereira pushed a commit to princepereira/hcsshim that referenced this pull request Aug 29, 2024
This change fixes access denied errors when killing an already stopped
host process container.

This change also uses errors.Is() to compare errors in various functions
of the hcs error package. This allows error wrapping while still
properly validating that a wrapped error is of a certain type.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants