You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b4294cc
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: cmd/xprin-helpers/claimtoxr/cmd.go
+25-12Lines changed: 25 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -37,9 +37,11 @@ type Cmd struct {
37
37
InputFilestring`arg:"" default:"-" help:"The Claim YAML file to be converted. If not specified or '-', stdin will be used." optional:"" predictor:"file" type:"path"`
38
38
39
39
// Flags.
40
-
OutputFilestring`help:"The file to write the generated XR YAML to. If not specified, stdout will be used." placeholder:"PATH" predictor:"file" short:"o" type:"path"`
41
-
Kindstring`help:"The kind to use for the XR. If not specified, 'X' will be prepended to the Claim's kind (e.g. Infra -> XInfra)." placeholder:"KIND" type:"string"`
42
-
Directbool`help:"Create a direct XR without Claim references and suffix." name:"direct" negatable:""`
40
+
OutputFilestring`help:"The file to write the generated XR YAML to. If not specified, stdout will be used." placeholder:"PATH" predictor:"file" short:"o" type:"path"`
41
+
Namestring`help:"The name to use for the XR. If empty, defaults to the Claim's name (direct mode) or the Claim's name with a random suffix (non-direct)." placeholder:"NAME" type:"string"`
42
+
Kindstring`help:"The kind to use for the XR. If not specified, 'X' will be prepended to the Claim's kind (e.g. Infra -> XInfra)." placeholder:"KIND" type:"string"`
43
+
Directbool`help:"Create a direct XR without Claim references and suffix." name:"direct" negatable:""`
44
+
GenUIDbool`help:"Set a fresh random metadata.uid on the generated XR." name:"gen-uid"`
43
45
44
46
fs afero.Fs
45
47
}
@@ -50,26 +52,32 @@ func (c *Cmd) Help() string {
50
52
Convert a Crossplane Claim YAML file to a Crossplane Composite Resource (XR) format.
51
53
52
54
This command will:
53
-
- Read the Claim from the provided YAML file
54
-
- Create an XR with the same spec as the Claim
55
-
- Set appropriate API version and kind for the XR
56
-
- Set up the Claim reference in the XR (unless --direct is used)
57
-
- Copy any composition selector
55
+
- Read the Claim from the provided YAML file
56
+
- Create an XR with the same spec as the Claim
57
+
- Set appropriate API version and kind for the XR
58
+
- Set up the Claim reference in the XR (unless --direct is used)
59
+
- Copy any composition selector
58
60
59
61
Examples:
60
62
61
63
# Convert claim.yaml to XR format and write to stdout (kind will be 'X' + Claim's kind)
62
64
xprin-helpers convert-claim-to-xr claim.yaml
63
65
64
-
# Convert claim.yaml to XR format with a specific kind
0 commit comments