Documentation
¶
Overview ¶
Package v1alpha1 stores definitions and methods to handle artifact definitions and methods +kubebuilder:object:generate=true +k8s:deepcopy-gen=package +groupName=artifacts.pkg.katanomi.dev
Index ¶
- Constants
- Variables
- func AsDigestStringArray(uris ...URI) (array []string)
- func ExtractRepositoryDigestTag(value string) (url, digest, tag string)
- func FileUploadResourceAttributes(verb string) authv1.ResourceAttributes
- func GenerateDockerAuth(username, password []byte) string
- func GetAuthFromDockerConfigJson(registry string, dockerConfigJsonBytes []byte) (username, password string, err error)
- type AllFilter
- type AnyFilter
- type ArtifactType
- type ArtifactTypeBinaryProperties
- type ArtifactVersion
- func ContainerImageTransformFunc(artifact ArtifactVersion) ArtifactVersion
- func GetBinaryObjectFromValues(ctx context.Context, array []string) (versions []ArtifactVersion)
- func GetContainerImageFromValues(ctx context.Context, array []string) (versions []ArtifactVersion)
- func GetContainerImageObjectFromURLValues(ctx context.Context, url, digest string, tags ...string) (versions []ArtifactVersion)
- func GetHelmChartFromValues(ctx context.Context, array []string) (versions []ArtifactVersion)
- func GetHelmChartObjectFromURLValues(ctx context.Context, url string, tags ...string) (versions []ArtifactVersion)
- func GetOCIArtifactFromValues(ctx context.Context, array []string, ...) (versions []ArtifactVersion)
- func HelmChartTransformFunc(artifact ArtifactVersion) ArtifactVersion
- type ArtifactVersionCollection
- type ArtifactVersions
- type DigestAlgorithm
- type DockerAuthItem
- type DockerConfigJson
- type EnvFilter
- type FileUploadBinaryProperties
- type FileUploadParams
- type Filter
- func NewAllFilter(all []v1alpha1.ArtifactFilter) Filter
- func NewAnyFilter(any []v1alpha1.ArtifactFilter) Filter
- func NewEnvFilter(f v1alpha1.ArtifactEnvFilter) Filter
- func NewFilter(filters ...v1alpha1.ArtifactFilterSet) Filter
- func NewLabelFilter(f v1alpha1.ArtifactLabelFilter) Filter
- func NewTagFilter(f v1alpha1.ArtifactTagFilter) Filter
- type FilterResult
- type Filters
- type ImageAuths
- type ImageConfig
- type LabelFilter
- type OCIArtifactTransformationFunc
- type Protocol
- type TagFilter
- type URI
- func (in *URI) DeepCopy() *URI
- func (in *URI) DeepCopyInto(out *URI)
- func (u URI) DigestString() string
- func (u URI) Repository() string
- func (u URI) String() string
- func (u URI) Validate() error
- func (u URI) ValidateDigest() error
- func (u URI) ValidateHost() error
- func (u URI) ValidatePath() error
- func (u URI) ValidateProtocol() error
- func (u URI) ValidateTag() error
- func (u URI) Version() string
- func (u URI) WithDigestString() string
Constants ¶
const ( // BinaryArtifactTypeDirectory for directory type BinaryArtifactTypeDirectory = "directory" // BinaryArtifactTypeFile for file type BinaryArtifactTypeFile = "file" )
const ( // ArtifactTypeContainerImage artifact type as container image ArtifactTypeContainerImage ArtifactType = "ContainerImage" DeprecatedArtifactTypeOCIContainerImage = "OCIContainerImage" // ArtifactTypeHelmChart artifact type helm chart ArtifactTypeHelmChart ArtifactType = "HelmChart" DeprecatedArtifactTypeOCIHelmChart = "OCIHelmChart" // ArtifactTypeBinary binary artifact ArtifactTypeBinary ArtifactType = "Binary" // ArtifactTypeMaven maven artifact ArtifactTypeMaven ArtifactType = "Maven" // OCIHelmMediaType media type used for OCI helm chart artifact OCIHelmMediaType = "application/vnd.cncf.helm.config.v1+json" // OCIHelmChartContentType content type for a chart tar file when using OCI // registry as storage OCIHelmChartContentType = "application/vnd.cncf.helm.chart.content.v1.tar+gzip" // OCITarGzipContentType Tar gzip file as a content type // used in helm 3.6 and prior as media type for the layer storing // the chart tar package. From helm 3.7 onwars started using // "application/vnd.cncf.helm.chart.content.v1.tar+gzip" OCITarGzipContentType = "application/tar+gzip" // DeprecatedOCIHelmChartContentType uses "application/tar+gzip" on // helm 3.6 and prior. Was replaced by "application/vnd.cncf.helm.chart.content.v1.tar+gzip" // on helm 3.7 onwards DeprecatedOCIHelmChartContentType = OCITarGzipContentType // HelmChartDigestAnnotationKey annotation key used to store a digest // generated by pkg/hash.HashFolder method and used to compare content equality HelmChartDigestAnnotationKey = "digest.katanomi.dev/chart" )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "artifacts.pkg.katanomi.dev", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func AsDigestStringArray ¶
AsDigestStringArray returns list of uri as a string array
func ExtractRepositoryDigestTag ¶
ExtractRepositoryDigestTag takes a oci artifact url and extracts url, digest and tag
func FileUploadResourceAttributes ¶ added in v0.8.0
func FileUploadResourceAttributes(verb string) authv1.ResourceAttributes
FileUploadResourceAttributes returns a ResourceAttribute object to be used in a filter DEPRECATED: use ArtifactFileSubResourceAttributes instead
func GenerateDockerAuth ¶ added in v0.11.0
GenerateDockerAuth generate docker auth by input.
Types ¶
type AllFilter ¶
type AllFilter struct {
// contains filtered or unexported fields
}
AllFilter will use AND logic between items in other words, it equals item[0] && item[1] && ... item[n] (n>=0)
func (*AllFilter) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllFilter.
func (*AllFilter) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AnyFilter ¶
type AnyFilter struct {
// contains filtered or unexported fields
}
AnyFilter will use OR logic between items in other words, it equals item[0] || item[1] || ... item[n] (n>=0)
func (*AnyFilter) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnyFilter.
func (*AnyFilter) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ArtifactType ¶
type ArtifactType string
type ArtifactTypeBinaryProperties ¶ added in v0.9.0
type ArtifactTypeBinaryProperties struct { // Type of display type of artifact: directory, file Type string `json:"type"` // Name of artifact Name string `json:"name"` // Context of artifact Context string `json:"context"` // Size of artifact Size int64 `json:"size"` }
ArtifactTypeBinaryProperties properties for binary artifact type
func (*ArtifactTypeBinaryProperties) DeepCopy ¶ added in v0.9.0
func (in *ArtifactTypeBinaryProperties) DeepCopy() *ArtifactTypeBinaryProperties
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactTypeBinaryProperties.
func (*ArtifactTypeBinaryProperties) DeepCopyInto ¶ added in v0.9.0
func (in *ArtifactTypeBinaryProperties) DeepCopyInto(out *ArtifactTypeBinaryProperties)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ArtifactVersion ¶
type ArtifactVersion struct { // Type of artifact Type ArtifactType `json:"type"` // URL of artifact URL string `json:"url"` // Digest means artifact digest // can be used to store a unique identifier // of the artifact version Digest string `json:"digest,omitempty"` // Versions of current artifact // +optional Versions []string `json:"versions,omitempty"` }
ArtifactVersion artifacts
func ContainerImageTransformFunc ¶
func ContainerImageTransformFunc(artifact ArtifactVersion) ArtifactVersion
ContainerImageTransformFunc transform into a container image
func GetBinaryObjectFromValues ¶
func GetBinaryObjectFromValues(ctx context.Context, array []string) (versions []ArtifactVersion)
func GetContainerImageFromValues ¶
func GetContainerImageFromValues(ctx context.Context, array []string) (versions []ArtifactVersion)
GetContainerImageFromValues return a list of container image artifacts using url, digest and tags
func GetContainerImageObjectFromURLValues ¶
func GetContainerImageObjectFromURLValues(ctx context.Context, url, digest string, tags ...string) (versions []ArtifactVersion)
GetContainerImageObjectFromURLValues return a container image artifact using url, digest and a list of tags
func GetHelmChartFromValues ¶
func GetHelmChartFromValues(ctx context.Context, array []string) (versions []ArtifactVersion)
GetHelmChartFromValues return a list of helm chart artifacts using url, digest and tags
func GetHelmChartObjectFromURLValues ¶
func GetHelmChartObjectFromURLValues(ctx context.Context, url string, tags ...string) (versions []ArtifactVersion)
GetHelmChartObjectFromURLValues return a helm chart artifact using url and a list of tags
func GetOCIArtifactFromValues ¶
func GetOCIArtifactFromValues(ctx context.Context, array []string, transformFunc ...OCIArtifactTransformationFunc) (versions []ArtifactVersion)
GetOCIArtifactFromValues return a list of container image artifacts using url, digest and tags
func HelmChartTransformFunc ¶
func HelmChartTransformFunc(artifact ArtifactVersion) ArtifactVersion
HelmChartTransformFunc transform into a helm chart
func (*ArtifactVersion) DeepCopy ¶
func (in *ArtifactVersion) DeepCopy() *ArtifactVersion
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactVersion.
func (*ArtifactVersion) DeepCopyInto ¶
func (in *ArtifactVersion) DeepCopyInto(out *ArtifactVersion)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (ArtifactVersion) IsSameResult ¶
func (n ArtifactVersion) IsSameResult(compared ArtifactVersion) bool
IsSameResult implements method for generic comparable usage and checking if lists have the same results
type ArtifactVersionCollection ¶
type ArtifactVersionCollection struct { // ArtifactVersions all the artifacts ArtifactVersions []ArtifactVersion `json:"artifactVersions"` }
ArtifactVersionCollection collection of artifacts versions
func (*ArtifactVersionCollection) DeepCopy ¶
func (in *ArtifactVersionCollection) DeepCopy() *ArtifactVersionCollection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactVersionCollection.
func (*ArtifactVersionCollection) DeepCopyInto ¶
func (in *ArtifactVersionCollection) DeepCopyInto(out *ArtifactVersionCollection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ArtifactVersions ¶
type ArtifactVersions []ArtifactVersion
ArtifactVersions list of artifacts versions
func (ArtifactVersions) DeepCopy ¶
func (in ArtifactVersions) DeepCopy() ArtifactVersions
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactVersions.
func (ArtifactVersions) DeepCopyInto ¶
func (in ArtifactVersions) DeepCopyInto(out *ArtifactVersions)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DigestAlgorithm ¶
type DigestAlgorithm string
DigestAlgorithm artifact digest algorithm
const ( // SHA256 artifact digest algorithm is sha256 SHA256 DigestAlgorithm = "sha256" )
func ParseFirstDigest ¶
func ParseFirstDigest(line string) (algorithm DigestAlgorithm, digest string, ok bool)
ParseFirstDigest parse first digest from text string
type DockerAuthItem ¶
type DockerAuthItem struct { // Username username Username string `json:"username"` // Password authentication password Password string `json:"password"` // Auth authentication token, generated with username:password base64 Auth string `json:"auth"` // Eamil user eamil Eamil string `json:"email"` // Scope project scope for credential authentication Scope string `json:"scope"` }
DockerAuthItem docker credential information for a single repository
func (*DockerAuthItem) DeepCopy ¶
func (in *DockerAuthItem) DeepCopy() *DockerAuthItem
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerAuthItem.
func (*DockerAuthItem) DeepCopyInto ¶
func (in *DockerAuthItem) DeepCopyInto(out *DockerAuthItem)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DockerConfigJson ¶
type DockerConfigJson struct {
Auths map[string]DockerAuthItem `json:"auths"`
}
DockerConfigJson docker credentials data
func (*DockerConfigJson) DeepCopy ¶
func (in *DockerConfigJson) DeepCopy() *DockerConfigJson
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfigJson.
func (*DockerConfigJson) DeepCopyInto ¶
func (in *DockerConfigJson) DeepCopyInto(out *DockerConfigJson)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type EnvFilter ¶
type EnvFilter struct {
v1alpha1.ArtifactEnvFilter
}
EnvFilter represents artifact env filter
func (*EnvFilter) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvFilter.
func (*EnvFilter) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type FileUploadBinaryProperties ¶ added in v0.9.0
type FileUploadBinaryProperties struct { // Name for file key name Name string `json:"name"` // Overwrite allows to overwrite the file if it already exists Overwrite bool `json:"overwrite,omitempty"` }
FileUploadBinaryProperties Upload file expandable fields for binary artifact
func (*FileUploadBinaryProperties) DeepCopy ¶ added in v0.9.0
func (in *FileUploadBinaryProperties) DeepCopy() *FileUploadBinaryProperties
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileUploadBinaryProperties.
func (*FileUploadBinaryProperties) DeepCopyInto ¶ added in v0.9.0
func (in *FileUploadBinaryProperties) DeepCopyInto(out *FileUploadBinaryProperties)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type FileUploadParams ¶ added in v0.8.0
type FileUploadParams struct { // Address target repo's address Address *duckv1.Addressable `json:"address,omitempty"` // Type for support upload file type,ContainerImage, HelmChart, Binary // current only support ContainerImage. Type ArtifactType `json:"type,omitempty"` // Name for artifact identity name Name string `json:"name"` // Checksum generate unique path value Checksum string `json:"checksum"` // Properties Upload file expandable fields // if type is ContainerImage,The supported fields under properties is `tags` Properties *runtime.RawExtension `json:"properties,omitempty"` }
FileUploadParams Parameters required in ui upload file.
func (*FileUploadParams) DeepCopy ¶ added in v0.8.0
func (in *FileUploadParams) DeepCopy() *FileUploadParams
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileUploadParams.
func (*FileUploadParams) DeepCopyInto ¶ added in v0.8.0
func (in *FileUploadParams) DeepCopyInto(out *FileUploadParams)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Filter ¶
type Filter interface { // Filter compute the predicate on the provided event and returns the result of the matching // message will be match details when not pass Filter(ctx context.Context, artifact v1alpha1.Artifact) (res FilterResult, message string, err error) }
Filter is artifact filter interfact +k8s:deepcopy-gen=false
func NewAllFilter ¶
func NewAllFilter(all []v1alpha1.ArtifactFilter) Filter
NewAllFilter will construct all filter
func NewAnyFilter ¶
func NewAnyFilter(any []v1alpha1.ArtifactFilter) Filter
NewAnyFilter will construct filters using OR logic
func NewEnvFilter ¶
func NewEnvFilter(f v1alpha1.ArtifactEnvFilter) Filter
NewEnvFilter will construct artifact env filter
func NewFilter ¶
func NewFilter(filters ...v1alpha1.ArtifactFilterSet) Filter
NewFilter create Filter by filters, will use AND logic between items
func NewLabelFilter ¶
func NewLabelFilter(f v1alpha1.ArtifactLabelFilter) Filter
NewLabelFilter will construct artifact label filter
func NewTagFilter ¶
func NewTagFilter(f v1alpha1.ArtifactTagFilter) Filter
NewTagFilter will construct artifact tag filter
type FilterResult ¶
type FilterResult string
FilterResult has the result of the filtering operation.
const ( // indicates pass filter result PassFilter FilterResult = "pass" // indicates fail filter result FailFilter FilterResult = "fail" // indicates no filter result NoFilter FilterResult = "no_filter" )
func NewFilterResult ¶
func NewFilterResult(matched bool) FilterResult
NewFilterResult will parse bool to filterresult
func (FilterResult) And ¶
func (x FilterResult) And(y FilterResult) FilterResult
And will use AND logic between two filter result if any one is NoFilter will return other one if all are pass will return pass if one is fail will return fail
func (FilterResult) Not ¶
func (x FilterResult) Not() FilterResult
Not if current FilterResult is pass , will retrun fail if current FilterResult is faile, will return pass if current FilterResult is no filter , will return no filter
func (FilterResult) Or ¶
func (x FilterResult) Or(y FilterResult) FilterResult
Or will use OR logic between two filter result if any one is NoFilter will return other one if any one is pass will return pass if all items are fail will return fail
type Filters ¶
type Filters []Filter
Filters is a wrapper that runs each filter and performs the and +k8s:deepcopy-gen=false
func NewArtifactFilter ¶
func NewArtifactFilter(filter v1alpha1.ArtifactFilter) Filters
NewArtifactFilter will construct a ArtifactFilter
type ImageAuths ¶
type ImageAuths map[string][]DockerAuthItem
ImageAuths sever and DockerAuthItem list
func (ImageAuths) DeepCopy ¶
func (in ImageAuths) DeepCopy() ImageAuths
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageAuths.
func (ImageAuths) DeepCopyInto ¶
func (in ImageAuths) DeepCopyInto(out *ImageAuths)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ImageConfig ¶
type ImageConfig struct {
ImageAuths ImageAuths `json:"auths"`
}
ImageConfig define sever and multiple docker credentials related content.
func (*ImageConfig) DeepCopy ¶
func (in *ImageConfig) DeepCopy() *ImageConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageConfig.
func (*ImageConfig) DeepCopyInto ¶
func (in *ImageConfig) DeepCopyInto(out *ImageConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LabelFilter ¶
type LabelFilter struct {
v1alpha1.ArtifactLabelFilter
}
LabelFilter artifact label filter
func (*LabelFilter) DeepCopy ¶
func (in *LabelFilter) DeepCopy() *LabelFilter
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelFilter.
func (*LabelFilter) DeepCopyInto ¶
func (in *LabelFilter) DeepCopyInto(out *LabelFilter)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (LabelFilter) Filter ¶
func (filter LabelFilter) Filter(ctx context.Context, artifact v1alpha1.Artifact) (FilterResult, string, error)
Filter will filter artifacts by artifact labels
type OCIArtifactTransformationFunc ¶
type OCIArtifactTransformationFunc func(ArtifactVersion) ArtifactVersion
OCIArtifactTransformationFunc transformation function to use when converting a string array into ArtifactVersion +k8s:deepcopy-gen=false
type Protocol ¶
type Protocol string
Protocol represent artifact transport protocol
var ( // ProtocolDocker docker protocol ProtocolDocker Protocol = "docker" // ProtocolHelmChart helm chart protocol ProtocolHelmChart Protocol = "chart" // ProtocolOCI oci protocol ProtocolOCI Protocol = "oci" ErrInvalidProtocol = "invalid protocol format" ErrInvalidReference = "invalid reference" )
type TagFilter ¶
type TagFilter struct {
v1alpha1.ArtifactTagFilter
}
TagFilter represents artifact tag filter
func (*TagFilter) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TagFilter.
func (*TagFilter) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type URI ¶
type URI struct { // Protocol represent artifact transport protocol, it is optional, default value is docker Protocol string // Host represent artifact host Host string // Path represent artifact path Path string // Tag represent artifact tag Tag string // Digest represent artifact digest Digest string // Algorithm digest algorithm Algorithm DigestAlgorithm // Raw represent original uri Raw string }
URI represents artifact uri , like docker://gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/nop:v0.37.1@sha256:04411f239bc7144c3248b53af6741c2726eaddbe9b9cf62a24cf812689cc3223
func ParseURI ¶
func ParseURI(uri string, t ArtifactType) (URI, error)
ParseURI parse uri to URI struct
func (*URI) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new URI.
func (*URI) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (URI) DigestString ¶
DigestString will return format of Algorithm:Digest
func (URI) Repository ¶
func (URI) ValidateDigest ¶
ValidateDigest validates the a digest.
func (URI) ValidateProtocol ¶ added in v0.12.0
ValidateProtocol validates the protocol.
func (URI) WithDigestString ¶
WithDigestString return uri string, including tag and digest.