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
[1] Currently, this works under the assumption that the token can authenticate the devfile and the parent devfile; both devfiles are in the same repository.
49
+
50
+
[2] In this scenario, the token will be used to authenticate the main devfile.
15
51
16
52
## Usage
17
53
@@ -35,7 +71,6 @@ The function documentation can be accessed via [pkg.go.dev](https://pkg.go.dev/g
2. To override the HTTP request and response timeouts for a devfile with a parent reference from a registry URL, specify the HTTPTimeout value in the parser arguments
40
75
```go
41
76
// specify the timeout in seconds
@@ -45,7 +80,6 @@ The function documentation can be accessed via [pkg.go.dev](https://pkg.go.dev/g
45
80
}
46
81
```
47
82
48
-
49
83
3. To get specific content from devfile
50
84
```go
51
85
// To get all the components from the devfile
@@ -77,7 +111,7 @@ The function documentation can be accessed via [pkg.go.dev](https://pkg.go.dev/g
77
111
},
78
112
})
79
113
```
80
-
114
+
81
115
4. To get the Kubernetes objects from the devfile, visit [generators.go source file](pkg/devfile/generator/generators.go)
82
116
```go
83
117
// To get a slice of Kubernetes containers of type corev1.Container from the devfile component containers
@@ -94,7 +128,7 @@ The function documentation can be accessed via [pkg.go.dev](https://pkg.go.dev/g
@@ -154,10 +187,11 @@ The function documentation can be accessed via [pkg.go.dev](https://pkg.go.dev/g
154
187
Ctx: ctx,
155
188
Data: devfileData,
156
189
}
157
-
190
+
158
191
// write to the devfile on disk
159
192
err = devfile.WriteYamlDevfile()
160
193
```
194
+
161
195
7. To parse the outerloop Kubernetes/OpenShift component's uri or inline content, call the read and parse functions
162
196
```go
163
197
// Read the YAML content
@@ -166,6 +200,7 @@ The function documentation can be accessed via [pkg.go.dev](https://pkg.go.dev/g
166
200
// Get the Kubernetes resources
167
201
resources, err:=ParseKubernetesYaml(values)
168
202
```
203
+
169
204
8. By default, the parser will set all unset boolean properties to their spec defined default values. Clients can override this behaviour by specifiying the parser argument `SetBooleanDefaults` to false
170
205
```go
171
206
setDefaults:=false
@@ -174,6 +209,15 @@ The function documentation can be accessed via [pkg.go.dev](https://pkg.go.dev/g
174
209
}
175
210
```
176
211
212
+
9. When parsing a devfile that contains a parent reference, if the parent uri is a supported git provider repo url with the correct personal access token, all resources from the parent git repo excluding the parent devfile.yaml will be downloaded to the location of the devfile being parsed. **Note: The URL must point to a devfile.yaml**
213
+
```yaml
214
+
schemaVersion: 2.2.0
215
+
...
216
+
parent:
217
+
uri: <uri-to-parent-devfile>/devfile.yaml
218
+
...
219
+
```
220
+
177
221
## Projects using devfile/library
178
222
179
223
The following projects are consuming this library as a Golang dependency
returnDevfileObj{}, fmt.Errorf("failed to resolve parent uri, devfile context is missing absolute url and path to devfile. %s", resolveImportReference(importReference))
0 commit comments