Skip to content

Commit 48ebbf1

Browse files
authored
add version property in import reference (#785)
* add version property Signed-off-by: Stephanie <yangcao@redhat.com> * update description include usage Signed-off-by: Stephanie <yangcao@redhat.com>
1 parent d40180b commit 48ebbf1

16 files changed

+247
-0
lines changed

crds/workspace.devfile.io_devworkspaces.v1beta1.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5871,6 +5871,15 @@ spec:
58715871
file. It can be a full URL or a relative URI with
58725872
the current devfile as the base URI.
58735873
type: string
5874+
version:
5875+
description: Specific stack/sample version to pull the
5876+
parent devfile from, when using id in the parent reference.
5877+
To specify `version`, `id` must be defined and used
5878+
as the import reference source. `version` can be either
5879+
a specific stack version, or `latest`. If no `version`
5880+
specified, default version will be used.
5881+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
5882+
type: string
58745883
type: object
58755884
volume:
58765885
description: Allows specifying the definition of a volume
@@ -7636,6 +7645,16 @@ spec:
76367645
file. It can be a full URL or a relative URI with
76377646
the current devfile as the base URI.
76387647
type: string
7648+
version:
7649+
description: Specific stack/sample version to pull
7650+
the parent devfile from, when using id in the
7651+
parent reference. To specify `version`, `id` must
7652+
be defined and used as the import reference source.
7653+
`version` can be either a specific stack version,
7654+
or `latest`. If no `version` specified, default
7655+
version will be used.
7656+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
7657+
type: string
76397658
type: object
76407659
volume:
76417660
description: Allows specifying the definition of a volume
@@ -7847,6 +7866,15 @@ spec:
78477866
devfile. Overriding is done according to K8S strategic merge
78487867
patch standard rules.
78497868
type: object
7869+
version:
7870+
description: Specific stack/sample version to pull the parent
7871+
devfile from, when using id in the parent reference. To
7872+
specify `version`, `id` must be defined and used as the
7873+
import reference source. `version` can be either a specific
7874+
stack version, or `latest`. If no `version` specified, default
7875+
version will be used.
7876+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
7877+
type: string
78507878
type: object
78517879
projects:
78527880
description: Projects worked on in the devworkspace, containing

crds/workspace.devfile.io_devworkspaces.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5876,6 +5876,15 @@ spec:
58765876
file. It can be a full URL or a relative URI with
58775877
the current devfile as the base URI.
58785878
type: string
5879+
version:
5880+
description: Specific stack/sample version to pull the
5881+
parent devfile from, when using id in the parent reference.
5882+
To specify `version`, `id` must be defined and used
5883+
as the import reference source. `version` can be either
5884+
a specific stack version, or `latest`. If no `version`
5885+
specified, default version will be used.
5886+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
5887+
type: string
58795888
type: object
58805889
volume:
58815890
description: Allows specifying the definition of a volume
@@ -7641,6 +7650,16 @@ spec:
76417650
file. It can be a full URL or a relative URI with
76427651
the current devfile as the base URI.
76437652
type: string
7653+
version:
7654+
description: Specific stack/sample version to pull
7655+
the parent devfile from, when using id in the
7656+
parent reference. To specify `version`, `id` must
7657+
be defined and used as the import reference source.
7658+
`version` can be either a specific stack version,
7659+
or `latest`. If no `version` specified, default
7660+
version will be used.
7661+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
7662+
type: string
76447663
type: object
76457664
volume:
76467665
description: Allows specifying the definition of a volume
@@ -7852,6 +7871,15 @@ spec:
78527871
devfile. Overriding is done according to K8S strategic merge
78537872
patch standard rules.
78547873
type: object
7874+
version:
7875+
description: Specific stack/sample version to pull the parent
7876+
devfile from, when using id in the parent reference. To
7877+
specify `version`, `id` must be defined and used as the
7878+
import reference source. `version` can be either a specific
7879+
stack version, or `latest`. If no `version` specified, default
7880+
version will be used.
7881+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
7882+
type: string
78557883
type: object
78567884
projects:
78577885
description: Projects worked on in the devworkspace, containing

crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5579,6 +5579,15 @@ spec:
55795579
It can be a full URL or a relative URI with the current
55805580
devfile as the base URI.
55815581
type: string
5582+
version:
5583+
description: Specific stack/sample version to pull the parent
5584+
devfile from, when using id in the parent reference. To
5585+
specify `version`, `id` must be defined and used as the
5586+
import reference source. `version` can be either a specific
5587+
stack version, or `latest`. If no `version` specified,
5588+
default version will be used.
5589+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
5590+
type: string
55825591
type: object
55835592
volume:
55845593
description: Allows specifying the definition of a volume shared
@@ -7280,6 +7289,15 @@ spec:
72807289
file. It can be a full URL or a relative URI with
72817290
the current devfile as the base URI.
72827291
type: string
7292+
version:
7293+
description: Specific stack/sample version to pull the
7294+
parent devfile from, when using id in the parent reference.
7295+
To specify `version`, `id` must be defined and used
7296+
as the import reference source. `version` can be either
7297+
a specific stack version, or `latest`. If no `version`
7298+
specified, default version will be used.
7299+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
7300+
type: string
72837301
type: object
72847302
volume:
72857303
description: Allows specifying the definition of a volume
@@ -7486,6 +7504,15 @@ spec:
74867504
Overriding is done according to K8S strategic merge patch standard
74877505
rules.
74887506
type: object
7507+
version:
7508+
description: Specific stack/sample version to pull the parent
7509+
devfile from, when using id in the parent reference. To specify
7510+
`version`, `id` must be defined and used as the import reference
7511+
source. `version` can be either a specific stack version, or
7512+
`latest`. If no `version` specified, default version will be
7513+
used.
7514+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
7515+
type: string
74897516
type: object
74907517
projects:
74917518
description: Projects worked on in the devworkspace, containing names

crds/workspace.devfile.io_devworkspacetemplates.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5584,6 +5584,15 @@ spec:
55845584
It can be a full URL or a relative URI with the current
55855585
devfile as the base URI.
55865586
type: string
5587+
version:
5588+
description: Specific stack/sample version to pull the parent
5589+
devfile from, when using id in the parent reference. To
5590+
specify `version`, `id` must be defined and used as the
5591+
import reference source. `version` can be either a specific
5592+
stack version, or `latest`. If no `version` specified,
5593+
default version will be used.
5594+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
5595+
type: string
55875596
type: object
55885597
volume:
55895598
description: Allows specifying the definition of a volume shared
@@ -7285,6 +7294,15 @@ spec:
72857294
file. It can be a full URL or a relative URI with
72867295
the current devfile as the base URI.
72877296
type: string
7297+
version:
7298+
description: Specific stack/sample version to pull the
7299+
parent devfile from, when using id in the parent reference.
7300+
To specify `version`, `id` must be defined and used
7301+
as the import reference source. `version` can be either
7302+
a specific stack version, or `latest`. If no `version`
7303+
specified, default version will be used.
7304+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
7305+
type: string
72887306
type: object
72897307
volume:
72907308
description: Allows specifying the definition of a volume
@@ -7491,6 +7509,15 @@ spec:
74917509
Overriding is done according to K8S strategic merge patch standard
74927510
rules.
74937511
type: object
7512+
version:
7513+
description: Specific stack/sample version to pull the parent
7514+
devfile from, when using id in the parent reference. To specify
7515+
`version`, `id` must be defined and used as the import reference
7516+
source. `version` can be either a specific stack version, or
7517+
`latest`. If no `version` specified, default version will be
7518+
used.
7519+
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
7520+
type: string
74947521
type: object
74957522
projects:
74967523
description: Projects worked on in the devworkspace, containing names

pkg/apis/workspaces/v1alpha2/import_reference.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,12 @@ type ImportReference struct {
5050
// it is recommended to always specify the `registryUrl` when `id` is used.
5151
// +optional
5252
RegistryUrl string `json:"registryUrl,omitempty"`
53+
54+
// Specific stack/sample version to pull the parent devfile from, when using id in the parent reference.
55+
// To specify `version`, `id` must be defined and used as the import reference source.
56+
// `version` can be either a specific stack version, or `latest`.
57+
// If no `version` specified, default version will be used.
58+
// +optional
59+
// +kubebuilder:validation:Pattern=^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
60+
Version string `json:"version,omitempty"`
5361
}

pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schemas/latest/dev-workspace-template-spec.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,6 +1624,11 @@
16241624
"uri": {
16251625
"description": "URI Reference of a parent devfile YAML file. It can be a full URL or a relative URI with the current devfile as the base URI.",
16261626
"type": "string"
1627+
},
1628+
"version": {
1629+
"description": "Specific stack/sample version to pull the parent devfile from, when using id in the parent reference. To specify `version`, `id` must be defined and used as the import reference source. `version` can be either a specific stack version, or `latest`. If no `version` specified, default version will be used.",
1630+
"type": "string",
1631+
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
16271632
}
16281633
},
16291634
"additionalProperties": false
@@ -3207,6 +3212,11 @@
32073212
"uri": {
32083213
"description": "URI Reference of a parent devfile YAML file. It can be a full URL or a relative URI with the current devfile as the base URI.",
32093214
"type": "string"
3215+
},
3216+
"version": {
3217+
"description": "Specific stack/sample version to pull the parent devfile from, when using id in the parent reference. To specify `version`, `id` must be defined and used as the import reference source. `version` can be either a specific stack version, or `latest`. If no `version` specified, default version will be used.",
3218+
"type": "string",
3219+
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
32103220
}
32113221
},
32123222
"additionalProperties": false
@@ -3428,6 +3438,11 @@
34283438
"additionalProperties": {
34293439
"type": "string"
34303440
}
3441+
},
3442+
"version": {
3443+
"description": "Specific stack/sample version to pull the parent devfile from, when using id in the parent reference. To specify `version`, `id` must be defined and used as the import reference source. `version` can be either a specific stack version, or `latest`. If no `version` specified, default version will be used.",
3444+
"type": "string",
3445+
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
34313446
}
34323447
},
34333448
"additionalProperties": false

schemas/latest/dev-workspace-template.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,6 +1790,11 @@
17901790
"uri": {
17911791
"description": "URI Reference of a parent devfile YAML file. It can be a full URL or a relative URI with the current devfile as the base URI.",
17921792
"type": "string"
1793+
},
1794+
"version": {
1795+
"description": "Specific stack/sample version to pull the parent devfile from, when using id in the parent reference. To specify `version`, `id` must be defined and used as the import reference source. `version` can be either a specific stack version, or `latest`. If no `version` specified, default version will be used.",
1796+
"type": "string",
1797+
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
17931798
}
17941799
},
17951800
"additionalProperties": false
@@ -3373,6 +3378,11 @@
33733378
"uri": {
33743379
"description": "URI Reference of a parent devfile YAML file. It can be a full URL or a relative URI with the current devfile as the base URI.",
33753380
"type": "string"
3381+
},
3382+
"version": {
3383+
"description": "Specific stack/sample version to pull the parent devfile from, when using id in the parent reference. To specify `version`, `id` must be defined and used as the import reference source. `version` can be either a specific stack version, or `latest`. If no `version` specified, default version will be used.",
3384+
"type": "string",
3385+
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
33763386
}
33773387
},
33783388
"additionalProperties": false
@@ -3594,6 +3604,11 @@
35943604
"additionalProperties": {
35953605
"type": "string"
35963606
}
3607+
},
3608+
"version": {
3609+
"description": "Specific stack/sample version to pull the parent devfile from, when using id in the parent reference. To specify `version`, `id` must be defined and used as the import reference source. `version` can be either a specific stack version, or `latest`. If no `version` specified, default version will be used.",
3610+
"type": "string",
3611+
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
35973612
}
35983613
},
35993614
"additionalProperties": false

0 commit comments

Comments
 (0)