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

feat: add fileupload ResourceAttribute. #430

Merged
merged 1 commit into from
Apr 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
}
}