diff --git a/apis/artifacts/v1alpha1/upload.go b/apis/artifacts/v1alpha1/upload.go index 9fb8cc88..d24ff026 100644 --- a/apis/artifacts/v1alpha1/upload.go +++ b/apis/artifacts/v1alpha1/upload.go @@ -17,6 +17,7 @@ limitations under the License. package v1alpha1 import ( + authv1 "k8s.io/api/authorization/v1" "k8s.io/apimachinery/pkg/runtime" duckv1 "knative.dev/pkg/apis/duck/v1" ) @@ -37,3 +38,13 @@ type FileUploadParams struct { // if type is ContainerImage,The supported fields under properties is `tags` Properties *runtime.RawExtension `json:"properties,omitempty"` } + +// FileUploadResourceAttributes returns a ResourceAttribute object to be used in a filter +func FileUploadResourceAttributes(verb string) authv1.ResourceAttributes { + return authv1.ResourceAttributes{ + Group: GroupVersion.Group, + Version: GroupVersion.Version, + Resource: "artifactuploads", + Verb: verb, + } +}