devfile 0.0.16.pre.alpha1-arm64-darwin → 0.0.17.pre.alpha1-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/devfile +0 -0
  3. data/ext/devfile.go +4 -1
  4. data/lib/devfile.rb +12 -36
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56a3c3826a2e29c86391abee17d8f5f94b378038ebcb27518985aeb01dbc2329
4
- data.tar.gz: e5e2a94cbe3bbf0465c84db27136db92612cb81013271ba861e9b5475937bb10
3
+ metadata.gz: 2823e3adf2e28c74b1263a6372f842366b94548b1f5ea25072e205020108a78b
4
+ data.tar.gz: 99dd94fb0db140be9bf4099563dc92899141812e03aa15cab4ae1b48918768d9
5
5
  SHA512:
6
- metadata.gz: 45ec260b80c3d17bece4930478cb492e0158bbdd6550d092ef5c7bf08aa23d61be2c322de3945887488def7b41212fe38c5ac63e5715b3053db8fce1f70aabc3
7
- data.tar.gz: 632a7f1d8205b83180d24d7cac8fb97c30af0ce57c81e07a29d1acb16874e636ac87bfcacb3ad58955a95150254373782198d11ece9eb258fb5bc543ff602ba7
6
+ metadata.gz: 5bcf56ec7a8482a7c104f02c39fa2e61f6fcf73c78c6fa1e4be7b8f4e8aee2f8692566d391b42d5eeab4198e3f67bbff01b8fb19e4118a8946a5dad28c137d7c
7
+ data.tar.gz: f4e4699014b64283fcdf7246f0114b971686187d92196cb09944166cc965af834c27f19674b266e7c5dec03fdefd11ae16964fd5b4d4d6699f0daf084a9bbb64
data/bin/devfile CHANGED
Binary file
data/ext/devfile.go CHANGED
@@ -7,6 +7,7 @@ import (
7
7
  "strconv"
8
8
  "text/template"
9
9
 
10
+ "github.com/devfile/library/v2/pkg/devfile"
10
11
  "github.com/devfile/library/v2/pkg/devfile/generator"
11
12
  "github.com/devfile/library/v2/pkg/devfile/parser"
12
13
  "github.com/devfile/library/v2/pkg/devfile/parser/data/v2/common"
@@ -304,7 +305,9 @@ func parseDevfile(content string) (Devfile, error) {
304
305
  parserArgs := parser.ParserArgs{
305
306
  Data: []byte(content),
306
307
  }
307
- devfileObj, err := parser.ParseDevfile(parserArgs)
308
+ // TODO: figure out how to handle warnings
309
+ // https://gitlab.com/gitlab-org/remote-development/devfile-gem/-/issues/6
310
+ devfileObj, _, err := devfile.ParseDevfileAndValidate(parserArgs)
308
311
  return Devfile{
309
312
  devfileObj: devfileObj,
310
313
  }, err
data/lib/devfile.rb CHANGED
@@ -10,57 +10,33 @@ module Devfile
10
10
 
11
11
  class << self
12
12
  def get_deployment(devfile, name, namespace, labels, annotations, replicas)
13
- stdout, stderr, status = Open3.capture3(
14
- "#{FILE_PATH} deployment '#{devfile}' #{name} #{namespace} '#{labels}' '#{annotations}' #{replicas}"
15
- )
16
-
17
- raise stderr unless status.success?
18
-
19
- stdout
13
+ call('deployment', devfile, name, namespace, labels, annotations, replicas)
20
14
  end
21
15
 
22
16
  def get_service(devfile, name, namespace, labels, annotations)
23
- stdout, stderr, status = Open3.capture3(
24
- "#{FILE_PATH} service '#{devfile}' #{name} #{namespace} '#{labels}' '#{annotations}'"
25
- )
26
-
27
- raise stderr unless status.success?
28
-
29
- stdout
17
+ call('service', devfile, name, namespace, labels, annotations)
30
18
  end
31
19
 
32
20
  def get_ingress(devfile, name, namespace, labels, annotations, domain_template, ingress_class)
33
- stdout, stderr, status = Open3.capture3(
34
- "#{FILE_PATH} ingress '#{devfile}' #{name} #{namespace} '#{labels}' '#{annotations}' #{domain_template} #{ingress_class}"
35
- )
36
-
37
- raise stderr unless status.success?
38
-
39
- stdout
21
+ call('ingress', devfile, name, namespace, labels, annotations, domain_template, ingress_class)
40
22
  end
41
23
 
42
24
  def get_pvc(devfile, name, namespace, labels, annotations)
43
- stdout, stderr, status = Open3.capture3(
44
- "#{FILE_PATH} deployment '#{devfile}' #{name} #{namespace} '#{labels}' '#{annotations}'"
45
- )
46
-
47
- raise stderr unless status.success?
48
-
49
- stdout
25
+ call('deployment', devfile, name, namespace, labels, annotations)
50
26
  end
51
27
 
52
28
  def get_all(devfile, name, namespace, labels, annotations, replicas, domain_template, ingress_class)
53
- stdout, stderr, status = Open3.capture3(
54
- "#{FILE_PATH} all '#{devfile}' #{name} #{namespace} '#{labels}' '#{annotations}' #{replicas} #{domain_template} #{ingress_class}"
55
- )
56
-
57
- raise stderr unless status.success?
58
-
59
- stdout
29
+ call('all', devfile, name, namespace, labels, annotations, replicas, domain_template, ingress_class)
60
30
  end
61
31
 
62
32
  def flatten(devfile)
63
- stdout, stderr, status = Open3.capture3("#{FILE_PATH} flatten '#{devfile}'")
33
+ call('flatten', devfile)
34
+ end
35
+
36
+ private
37
+
38
+ def call(*cmd)
39
+ stdout, stderr, status = Open3.capture3({}, FILE_PATH, *cmd.map(&:to_s))
64
40
 
65
41
  raise stderr unless status.success?
66
42
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devfile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16.pre.alpha1
4
+ version: 0.0.17.pre.alpha1
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - GitLab
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-05 00:00:00.000000000 Z
11
+ date: 2023-05-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Library used to generate kubernetes manifests from a Devfile.
14
14
  email: