-
Notifications
You must be signed in to change notification settings - Fork 949
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
feature: extend cri apis for remove volume #2124
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,12 @@ service ImageService { | |
rpc ImageFsInfo(ImageFsInfoRequest) returns (ImageFsInfoResponse) {} | ||
} | ||
|
||
// VolumeService defines the public APIs for managing volumes. | ||
service VolumeService { | ||
// RemoveVolume removes the volume. | ||
rpc RemoveVolume(RemoveVolumeRequest) returns (RemoveVolumeResponse) {} | ||
} | ||
|
||
message VersionRequest { | ||
// Version of the kubelet runtime API. | ||
string version = 1; | ||
|
@@ -181,6 +187,8 @@ message Mount { | |
bool selinux_relabel = 4; | ||
// Requested propagation mode. | ||
MountPropagation propagation = 5; | ||
// Name of volume | ||
string name = 100; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need add more param in Mount? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's enough for the moment. :) |
||
} | ||
|
||
// A NamespaceMode describes the intended namespace configuration for each | ||
|
@@ -1282,4 +1290,12 @@ message ReopenContainerLogRequest { | |
} | ||
|
||
message ReopenContainerLogResponse{ | ||
} | ||
} | ||
|
||
message RemoveVolumeRequest { | ||
// Name of the volume to remove | ||
string volume_name = 1; | ||
} | ||
|
||
message RemoveVolumeResponse { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,3 +400,16 @@ func (c *CriWrapper) ImageFsInfo(ctx context.Context, r *runtime.ImageFsInfoRequ | |
}() | ||
return c.CriManager.ImageFsInfo(ctx, r) | ||
} | ||
|
||
// RemoveVolume removes the volume. | ||
func (c *CriWrapper) RemoveVolume(ctx context.Context, r *runtime.RemoveVolumeRequest) (res *runtime.RemoveVolumeResponse, err error) { | ||
logrus.Infof("RemoveVolume %q", r.GetVolumeName()) | ||
defer func() { | ||
if err != nil { | ||
logrus.Errorf("RemoveVolume %q failed, error: %v", r.GetVolumeName(), err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. failed to do something There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll submit a single PR to format logs. |
||
} else { | ||
logrus.Infof("RemoveVolume %q returns successfully", r.GetVolumeName()) | ||
} | ||
}() | ||
return c.CriManager.RemoveVolume(ctx, r) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,6 @@ generateproto(){ | |
} | ||
|
||
main(){ | ||
API_ROOT="${DIR}/cri/apis/v1alpha1" YEAR_TIME=" $(date '+%Y')" generateproto | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why delete it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now we don't need to extend the API of CRI v1alpha1. :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we do not the extensive CRI advanced feature, should we find somewhere to record this change? @starnop There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
API_ROOT="${DIR}/cri/apis/v1alpha2" YEAR_TIME="" generateproto | ||
} | ||
main "$@" |
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.
TODO:
classify the anonymous volume or not.