-
Notifications
You must be signed in to change notification settings - Fork 843
Manage labels via YAML (GitOps) #24473
Copy link
Copy link
Closed
2 / 22 of 2 issues completedLabels
#g-orchestrationOrchestration product groupOrchestration product group:productProduct Design department (shows up on 🦢 Drafting board)Product Design department (shows up on 🦢 Drafting board)customer-eponymcustomer-fairbankcustomer-numacustomer-olympuscustomer-ramzelcustomer-rosnerprospect-chaucerstoryA user story defining an entire featureA user story defining an entire feature~customer promiseA feature request, or user story for a request, that Fleet has contractually agreed to deliverA feature request, or user story for a request, that Fleet has contractually agreed to deliver
Milestone
Metadata
Metadata
Assignees
Labels
#g-orchestrationOrchestration product groupOrchestration product group:productProduct Design department (shows up on 🦢 Drafting board)Product Design department (shows up on 🦢 Drafting board)customer-eponymcustomer-fairbankcustomer-numacustomer-olympuscustomer-ramzelcustomer-rosnerprospect-chaucerstoryA user story defining an entire featureA user story defining an entire feature~customer promiseA feature request, or user story for a request, that Fleet has contractually agreed to deliverA feature request, or user story for a request, that Fleet has contractually agreed to deliver
Type
Projects
Status
Done
Goal
Key result
Deliver prioritized customer requests
Original requests
Context
Changes
Product
default.yml)Engineering
helpmenu)Technical Design Plan #
In the
GitOpsFromFileimplementation inpkg/spec/gitops.go:label:key in YAML file (if it exists), read in any files referenced bypath, validate syntax and add labels to gitops config var.In the
gitopsCommandimplementation incmd/fleetctl/gitops.go(where gitops YAML is parsed):labels:key exists at the top level of the global YML file. If not, populateconfig.Labelswith the currently-persisted labels as if they'd been specified in the YAML. This is for backwards-compatibility so that customers don't blow away all their labels the next time they run gitops because they haven't populatedlabels:yet.config.Labels. If any used labels would not exist after the gitops run, bail out and output warning likeLabel XXX would be not exist after this run, but is referenced by the following entities: software installer with url "http://foo.bar", query "Get outdated software", etc.In the
DoGitOpsimplementation inserver/service/client.go(where the parsed spec is prepped for sending to the API, and deletions are processed)In the
ApplyGroupimplementation inserver/service/client.goQA
Risk assessment
Manual testing steps
Test plan
default.yml. Run GitOps.default.yml. Run GitOps.default.yml: include thelabelskey but do not define any labels.default.ymland reference it in configuration profile targets. Run GitOps. Remove the label and run GitOps again.default.ymland reference it in software installation targets. Run GitOps. Remove the label and run GitOps again.default.ymland reference it in query targets. Run GitOps. Remove the label and run GitOps again.labelsis an optional key: remove thelabelskey fromdefault.yml. Now, create some labels in the UI. After applying GitOps changes, labels created via the UI should still exist.author_idis included.Testing notes
Confirmation