Skip to content

Commit

Permalink
Merge pull request from GHSA-2gvw-w6fj-7m3c
Browse files Browse the repository at this point in the history
Signed-off-by: pashakostohrys <pavel@codefresh.io>
  • Loading branch information
pasha-codefresh authored Apr 15, 2024
1 parent e94f6a8 commit c5a252c
Show file tree
Hide file tree
Showing 4 changed files with 364 additions and 95 deletions.
18 changes: 18 additions & 0 deletions pkg/apis/application/v1alpha1/app_project_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
)

type ErrApplicationNotAllowedToUseProject struct {
application string
namespace string
project string
}

func NewErrApplicationNotAllowedToUseProject(application, namespace, project string) error {
return &ErrApplicationNotAllowedToUseProject{
application: application,
namespace: namespace,
project: project,
}
}

func (err *ErrApplicationNotAllowedToUseProject) Error() string {
return fmt.Sprintf("application '%s' in namespace '%s' is not allowed to use project %s", err.application, err.namespace, err.project)
}

// AppProjectList is list of AppProject resources
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppProjectList struct {
Expand Down
Loading

0 comments on commit c5a252c

Please sign in to comment.