Skip to content

Commit

Permalink
feat: add fileupload ResourceAttribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy-boo committed Apr 15, 2023
1 parent e2fb201 commit eeeea71
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apis/artifacts/v1alpha1/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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,
}
}

0 comments on commit eeeea71

Please sign in to comment.