Skip to content

Commit

Permalink
fix: Optimize field naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy-boo committed Mar 22, 2023
1 parent a88f519 commit e1f8259
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions apis/meta/v1alpha1/labels_annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ const (
// define custom PR revision prefixes
GitPRRevisionPrefixes = "gitPRRevisionPrefixes"

// PYPISubResourceSuffixKey Add the corresponding suffix to the specified subResource which for pypi.
// PYPISubResourceExtendedAddressSuffixKey Add the corresponding suffix to the specified subResource which for pypi.
// TODO: In the future, we need to adopt a better way to add
// an extended dependency repository address to the plug-in
PYPISubResourceSuffixKey = "pypiSubResourceSuffix"
PYPISubResourceExtendedAddressSuffixKey = "pypiSubResourceExtendedAddressSuffix"
)

// Attribute values for label source or manager
Expand Down
12 changes: 6 additions & 6 deletions apis/meta/v1alpha1/project_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ const (
// TODO: add more subtypes
)

// ExtendAddressKey The name of the plugin extension url, only dependencyAddress is supported for now.
// ExtendedAddress The name of the plugin extension url, only dependencyAddress is supported for now.
// TODO: add more key for the plugin extension url.
type ExtendAddressKey string
type ExtendedAddress string

const (
// DependencyAddressExtendKey describes the dependency repository address provided by the plugin
// DependencyExtendedAddressKey describes the dependency repository address provided by the plugin
// If the tool has an independent dependency repository address,
// use this field to indicate, if not, take the same value as address
DependencyAddressExtendKey ExtendAddressKey = "dependencyAddress"
DependencyExtendedAddressKey ExtendedAddress = "dependency"
)

var ProjectGVK = GroupVersion.WithKind("Project")
Expand Down Expand Up @@ -183,9 +183,9 @@ type ProjectSpec struct {
// +optional
Access *duckv1.Addressable `json:"access,omitempty"`

// ExtendAddress stores the tool extend url which has different repository than address.
// ExtendedAddresses stores the tool extend url which has different repository than address.
// +optional
ExtendAddress map[ExtendAddressKey]*duckv1.Addressable `json:"extendAddress,omitempty"`
ExtendedAddresses map[ExtendedAddress]*duckv1.Addressable `json:"extendedAddresses,omitempty"`

// project subtype
// +kubebuilder:default="Project"
Expand Down
4 changes: 0 additions & 4 deletions plugin/client/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ type ResourcePathFormatter interface {
GetResourcePathFmt() map[metav1alpha1.ResourcePathScene]string
// GetSubResourcePathFmt resource path format
GetSubResourcePathFmt() map[metav1alpha1.ResourcePathScene]string

// GetPYPIResourcePathFmt return a list of pypi resource fmt that can be used in get projects list api.
// TODO: we need remove this func after find better way to add suffix to pypi dependency url.
GetPYPIResourcePathFmt() map[metav1alpha1.ProjectSubType]string
}

// AuthChecker implements an authorization check method for plugins
Expand Down

0 comments on commit e1f8259

Please sign in to comment.