github.com/redhat-appstudio/release-service@v0.0.0-20240507143925-083712697924/metadata/labels.go (about)

     1  /*
     2  Copyright 2022.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package metadata
    18  
    19  import "fmt"
    20  
    21  // Common constants
    22  const (
    23  	// rhtapDomain is the prefix of the application label
    24  	rhtapDomain = "appstudio.openshift.io"
    25  
    26  	// MaxLabelLength is the maximum allowed characters in a label value
    27  	MaxLabelLength = 63
    28  )
    29  
    30  // Labels used by the release api package
    31  var (
    32  	// AttributionLabel is the label name for the standing-attribution label
    33  	AttributionLabel = fmt.Sprintf("release.%s/standing-attribution", rhtapDomain)
    34  
    35  	// AutoReleaseLabel is the label name for the auto-release setting
    36  	AutoReleaseLabel = fmt.Sprintf("release.%s/auto-release", rhtapDomain)
    37  
    38  	// AuthorLabel is the label name for the user who creates a CR
    39  	AuthorLabel = fmt.Sprintf("release.%s/author", rhtapDomain)
    40  
    41  	// AutomatedLabel is the label name for marking a Release as automated
    42  	AutomatedLabel = fmt.Sprintf("release.%s/automated", rhtapDomain)
    43  
    44  	// ReleasePlanAdmissionLabel is the ReleasePlan label for the name of the ReleasePlanAdmission to use
    45  	ReleasePlanAdmissionLabel = fmt.Sprintf("release.%s/releasePlanAdmission", rhtapDomain)
    46  )
    47  
    48  // Prefixes to be used by Release Pipelines labels
    49  var (
    50  	// pipelinesLabelPrefix is the prefix of the pipelines label
    51  	pipelinesLabelPrefix = fmt.Sprintf("pipelines.%s", rhtapDomain)
    52  
    53  	// releaseLabelPrefix is the prefix of the release labels
    54  	releaseLabelPrefix = fmt.Sprintf("release.%s", rhtapDomain)
    55  )
    56  
    57  // Labels to be used within Release PipelineRuns
    58  var (
    59  	// ApplicationNameLabel is the label used to specify the application associated with the PipelineRun
    60  	ApplicationNameLabel = fmt.Sprintf("%s/%s", rhtapDomain, "application")
    61  
    62  	// ManagedPipelineType is the value to be used in the PipelinesTypeLabel for managed Pipelines
    63  	ManagedPipelineType = "managed"
    64  
    65  	// PipelinesTypeLabel is the label used to describe the type of pipeline
    66  	PipelinesTypeLabel = fmt.Sprintf("%s/%s", pipelinesLabelPrefix, "type")
    67  
    68  	// ReleaseNameLabel is the label used to specify the name of the Release associated with the PipelineRun
    69  	ReleaseNameLabel = fmt.Sprintf("%s/%s", releaseLabelPrefix, "name")
    70  
    71  	// ReleaseNamespaceLabel is the label used to specify the namespace of the Release associated with the PipelineRun
    72  	ReleaseNamespaceLabel = fmt.Sprintf("%s/%s", releaseLabelPrefix, "namespace")
    73  
    74  	// ReleaseSnapshotLabel is the label used to specify the snapshot associated with the PipelineRun
    75  	ReleaseSnapshotLabel = fmt.Sprintf("%s/%s", rhtapDomain, "snapshot")
    76  )