-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: pass platform component labels and annotations to BuildPlan
Without this patch the BuildPlan resulting from a Platform that has components with labels and annotations does not have the labels or annotations of the source component. Holos should copy the labels and annotations defined on each of the Platform.spec.components to the resulting BuildPlan so end users can see clearly where a BuildPlan originated from, and filter with selectors the intermediate output BuildPlan the same way we filter with selectors the original Platform spec components list. Result: ``` holos init platform v1alpha5 --force holos show buildplans | head ``` ```yaml kind: BuildPlan apiVersion: v1alpha5 metadata: name: podinfo labels: app.holos.run/cluster: local app.holos.run/name: podinfo annotations: app.holos.run/description: podinfo for cluster local ```
- Loading branch information
1 parent
791c0a9
commit 864d7d4
Showing
12 changed files
with
154 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
package holos | ||
|
||
import "github.com/holos-run/holos/api/core/v1alpha5:core" | ||
import ( | ||
"encoding/json" | ||
|
||
"github.com/holos-run/holos/api/core/v1alpha5:core" | ||
) | ||
|
||
// Note: tags should have a reasonable default value for cue export. | ||
_Tags: { | ||
// Standardized parameters | ||
component: core.#Component & { | ||
name: string | *"no-name" @tag(holos_component_name, type=string) | ||
path: string | *"no-path" @tag(holos_component_path, type=string) | ||
|
||
_labels_json: string | *"" @tag(holos_component_labels, type=string) | ||
_labels: {} | ||
if _labels_json != "" { | ||
_labels: json.Unmarshal(_labels_json) | ||
} | ||
for k, v in _labels { | ||
labels: (k): v | ||
} | ||
|
||
_annotations_json: string | *"" @tag(holos_component_annotations, type=string) | ||
_annotations: {} | ||
if _annotations_json != "" { | ||
_annotations: json.Unmarshal(_annotations_json) | ||
} | ||
for k, v in _annotations { | ||
annotations: (k): v | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters