Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #911 from fao89/inventorylabels
Browse files Browse the repository at this point in the history
Add labels to the invetory secret
  • Loading branch information
fao89 authored May 31, 2024
2 parents da79a1e + 1bde1f9 commit 96c565b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/deployment/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ func GenerateNodeSetInventory(ctx context.Context, helper *helper.Helper,
"inventory": string(invData),
}
secretName := fmt.Sprintf("dataplanenodeset-%s", instance.Name)
labels := map[string]string{
"openstack.org/operator-name": "dataplane",
"openstackdataplanenodeset": instance.Name,
"inventory": "true",
}
for key, val := range instance.ObjectMeta.Labels {
labels[key] = val
}
template := []utils.Template{
// Secret
{
Expand All @@ -180,7 +188,7 @@ func GenerateNodeSetInventory(ctx context.Context, helper *helper.Helper,
Type: utils.TemplateTypeNone,
InstanceType: instance.Kind,
CustomData: secretData,
Labels: instance.ObjectMeta.Labels,
Labels: labels,
},
}
err = secret.EnsureSecrets(ctx, helper, instance, template, nil)
Expand Down

0 comments on commit 96c565b

Please sign in to comment.