diff --git a/pipelines/types/common.go b/pipelines/types/common.go index aa61408..8dfc460 100644 --- a/pipelines/types/common.go +++ b/pipelines/types/common.go @@ -767,14 +767,13 @@ const StepActionGrafanaManage = "GrafanaManage" type GrafanaManageStep struct { StepMeta `json:",inline"` - GrafanaName string `json:"grafanaName"` - Location string `json:"location"` - SKU string `json:"sku,omitempty"` - MajorVersion string `json:"majorVersion,omitempty"` - ZoneRedundancy string `json:"zoneRedundancy,omitempty"` - CrossTenantSecurityGroup string `json:"crossTenantSecurityGroup,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - Timeout string `json:"timeout,omitempty"` + GrafanaName Value `json:"grafanaName"` + Location Value `json:"location"` + SKU Value `json:"sku,omitempty"` + MajorVersion Value `json:"majorVersion,omitempty"` + ZoneRedundancy Value `json:"zoneRedundancy,omitempty"` + CrossTenantSecurityGroup Value `json:"crossTenantSecurityGroup,omitempty"` + Timeout string `json:"timeout,omitempty"` // IdentityFrom specifies the managed identity with which this deployment will run in Ev2. IdentityFrom Input `json:"identityFrom,omitempty"` @@ -786,10 +785,12 @@ func (s *GrafanaManageStep) Description() string { func (s *GrafanaManageStep) RequiredInputs() []StepDependency { var deps []StepDependency - for _, val := range []Input{s.IdentityFrom} { - deps = append(deps, val.StepDependency) + for _, val := range []Value{s.GrafanaName, s.Location, s.SKU, s.MajorVersion, s.ZoneRedundancy, s.CrossTenantSecurityGroup} { + if val.Input != nil { + deps = append(deps, val.Input.StepDependency) + } } - + deps = append(deps, s.IdentityFrom.StepDependency) slices.SortFunc(deps, SortDependencies) deps = slices.Compact(deps) return deps diff --git a/pipelines/types/common_test.go b/pipelines/types/common_test.go index b2e5e63..e635a7e 100644 --- a/pipelines/types/common_test.go +++ b/pipelines/types/common_test.go @@ -293,10 +293,14 @@ func TestRequiredInputs(t *testing.T) { { name: "grafana manage full", input: &GrafanaManageStep{ - IdentityFrom: Input{StepDependency: StepDependency{ResourceGroup: "rg", Step: "step"}}, + GrafanaName: Value{Input: &Input{StepDependency: StepDependency{ResourceGroup: "rg", Step: "step1"}}}, + Location: Value{Input: &Input{StepDependency: StepDependency{ResourceGroup: "rg", Step: "step2"}}}, + IdentityFrom: Input{StepDependency: StepDependency{ResourceGroup: "rg", Step: "step3"}}, }, expected: []StepDependency{ - {ResourceGroup: "rg", Step: "step"}, + {ResourceGroup: "rg", Step: "step1"}, + {ResourceGroup: "rg", Step: "step2"}, + {ResourceGroup: "rg", Step: "step3"}, }, }, { diff --git a/pipelines/types/pipeline.schema.v1.json b/pipelines/types/pipeline.schema.v1.json index 3569cb2..1a69faa 100644 --- a/pipelines/types/pipeline.schema.v1.json +++ b/pipelines/types/pipeline.schema.v1.json @@ -752,33 +752,22 @@ "const": "GrafanaManage" }, "grafanaName": { - "type": "string" + "$ref": "#/definitions/value" }, "location": { - "type": "string" + "$ref": "#/definitions/value" }, "sku": { - "type": "string" + "$ref": "#/definitions/value" }, "majorVersion": { - "type": "string" + "$ref": "#/definitions/value" }, "zoneRedundancy": { - "type": "string", - "enum": [ - "Enabled", - "Disabled" - ] + "$ref": "#/definitions/value" }, "crossTenantSecurityGroup": { - "type": "string" - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Azure resource tags for the Grafana instance" + "$ref": "#/definitions/value" }, "timeout": { "$ref": "#/definitions/durationString" diff --git a/tools/grafanactl/cmd/manage/cmd.go b/tools/grafanactl/cmd/manage/cmd.go index 4846340..9006d60 100644 --- a/tools/grafanactl/cmd/manage/cmd.go +++ b/tools/grafanactl/cmd/manage/cmd.go @@ -90,10 +90,6 @@ func (o *CompletedReconcileOptions) Run(ctx context.Context) error { if o.CrossTenantSecurityGroup != "" { tags["AMG.CrossTenant.SecurityGroup"] = &o.CrossTenantSecurityGroup } - for k, v := range o.Tags { - vCopy := v - tags[k] = &vCopy - } discoveredIDs, err := o.ResourceGraphDiscoveryClient.DiscoverMonitorWorkspaceIDs(ctx) if err != nil { diff --git a/tools/grafanactl/cmd/manage/options.go b/tools/grafanactl/cmd/manage/options.go index 217f395..c501791 100644 --- a/tools/grafanactl/cmd/manage/options.go +++ b/tools/grafanactl/cmd/manage/options.go @@ -33,7 +33,6 @@ type RawReconcileOptions struct { MajorVersion string ZoneRedundancy string CrossTenantSecurityGroup string - Tags map[string]string } type validatedReconcileOptions struct { @@ -75,7 +74,6 @@ func BindReconcileOptions(opts *RawReconcileOptions, cmd *cobra.Command) error { flags.StringVar(&opts.MajorVersion, "major-version", opts.MajorVersion, "Grafana major version (e.g. 11)") flags.StringVar(&opts.ZoneRedundancy, "zone-redundancy", opts.ZoneRedundancy, "Zone redundancy mode: Enabled or Disabled") flags.StringVar(&opts.CrossTenantSecurityGroup, "cross-tenant-security-group", opts.CrossTenantSecurityGroup, "Cross-tenant security group (format: GroupObjectId;TenantId)") - flags.StringToStringVar(&opts.Tags, "tags", opts.Tags, "Additional Azure resource tags for the Grafana instance (key=value,key2=value2)") return nil }