1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-09-16 09:26:22 +02:00

disable resources in another way

This commit is contained in:
Googlom
2025-07-15 15:36:56 +03:00
parent fa3163d800
commit 02b15b3159
2 changed files with 8 additions and 3 deletions

View File

@@ -100,7 +100,8 @@ func (cfg *{{ .StepName }}Options) readInValues() error {
// {{.CobraCmdFuncName}} {{.Short}}
func {{.CobraCmdFuncName}}() *cobra.Command {
var stepConfig {{.StepName}}Options
var commonPipelineEnvironment {{ .StepName }}CommonPipelineEnvironment
{{- range $notused, $oRes := .OutputResources }}
var {{ index $oRes "name" }} {{ index $oRes "objectname" }}{{ end }}
var dummyTelemetryData telemetry.CustomData
var {{.StepName}}Cmd = &cobra.Command{
@@ -555,6 +556,9 @@ func getOutputResourceDetails(stepData *config.StepData) ([]map[string]string, e
currentResource["objectname"] = envResource.StructName()
outputResources = append(outputResources, currentResource)
case "influx":
continue // disable this resource
var influxResource InfluxResource
influxResource.Name = res.Name
influxResource.StepName = stepData.Metadata.Name
@@ -585,6 +589,9 @@ func getOutputResourceDetails(stepData *config.StepData) ([]map[string]string, e
currentResource["objectname"] = influxResource.StructName()
outputResources = append(outputResources, currentResource)
case "reports":
continue // disable this resource
var reportsResource ReportsResource
reportsResource.Name = res.Name
reportsResource.StepName = stepData.Metadata.Name

View File

@@ -172,7 +172,6 @@ func (i *{{ .StepName }}{{ .Name | title}}) persist(path, resourceName string) {
// StructString returns the golang coding for the struct definition of the InfluxResource
func (i *InfluxResource) StructString() (string, error) {
return "", nil // disable this resource
funcMap := template.FuncMap{
"title": piperutils.Title,
"golangName": golangName,
@@ -255,7 +254,6 @@ func (p *ReportsResource) StructName() string {
// StructString returns the golang coding for the struct definition of the environment resource
func (p *ReportsResource) StructString() (string, error) {
return "", nil // disable this resource
funcMap := template.FuncMap{
"title": piperutils.Title,
"golangName": golangName,