Skip to content

add version property in import reference #785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions crds/workspace.devfile.io_devworkspaces.v1beta1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5871,6 +5871,15 @@ spec:
file. It can be a full URL or a relative URI with
the current devfile as the base URI.
type: string
version:
description: Specific stack/sample version to pull the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also document the behaviour of the special latest value?

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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
volume:
description: Allows specifying the definition of a volume
Expand Down Expand Up @@ -7636,6 +7645,16 @@ spec:
file. It can be a full URL or a relative URI with
the current devfile as the base URI.
type: string
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
volume:
description: Allows specifying the definition of a volume
Expand Down Expand Up @@ -7847,6 +7866,15 @@ spec:
devfile. Overriding is done according to K8S strategic merge
patch standard rules.
type: object
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
projects:
description: Projects worked on in the devworkspace, containing
Expand Down
28 changes: 28 additions & 0 deletions crds/workspace.devfile.io_devworkspaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5876,6 +5876,15 @@ spec:
file. It can be a full URL or a relative URI with
the current devfile as the base URI.
type: string
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
volume:
description: Allows specifying the definition of a volume
Expand Down Expand Up @@ -7641,6 +7650,16 @@ spec:
file. It can be a full URL or a relative URI with
the current devfile as the base URI.
type: string
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
volume:
description: Allows specifying the definition of a volume
Expand Down Expand Up @@ -7852,6 +7871,15 @@ spec:
devfile. Overriding is done according to K8S strategic merge
patch standard rules.
type: object
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
projects:
description: Projects worked on in the devworkspace, containing
Expand Down
27 changes: 27 additions & 0 deletions crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5579,6 +5579,15 @@ spec:
It can be a full URL or a relative URI with the current
devfile as the base URI.
type: string
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
volume:
description: Allows specifying the definition of a volume shared
Expand Down Expand Up @@ -7280,6 +7289,15 @@ spec:
file. It can be a full URL or a relative URI with
the current devfile as the base URI.
type: string
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
volume:
description: Allows specifying the definition of a volume
Expand Down Expand Up @@ -7486,6 +7504,15 @@ spec:
Overriding is done according to K8S strategic merge patch standard
rules.
type: object
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
projects:
description: Projects worked on in the devworkspace, containing names
Expand Down
27 changes: 27 additions & 0 deletions crds/workspace.devfile.io_devworkspacetemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5584,6 +5584,15 @@ spec:
It can be a full URL or a relative URI with the current
devfile as the base URI.
type: string
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
volume:
description: Allows specifying the definition of a volume shared
Expand Down Expand Up @@ -7285,6 +7294,15 @@ spec:
file. It can be a full URL or a relative URI with
the current devfile as the base URI.
type: string
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
volume:
description: Allows specifying the definition of a volume
Expand Down Expand Up @@ -7491,6 +7509,15 @@ spec:
Overriding is done according to K8S strategic merge patch standard
rules.
type: object
version:
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.
pattern: ^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
type: string
type: object
projects:
description: Projects worked on in the devworkspace, containing names
Expand Down
8 changes: 8 additions & 0 deletions pkg/apis/workspaces/v1alpha2/import_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,12 @@ type ImportReference struct {
// it is recommended to always specify the `registryUrl` when `id` is used.
// +optional
RegistryUrl string `json:"registryUrl,omitempty"`

// 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.
// +optional
// +kubebuilder:validation:Pattern=^(latest)|(([1-9])\.([0-9]+)\.([0-9]+)(\-[0-9a-z-]+(\.[0-9a-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)$
Version string `json:"version,omitempty"`
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions schemas/latest/dev-workspace-template-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,11 @@
"uri": {
"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.",
"type": "string"
},
"version": {
"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.",
"type": "string",
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -3207,6 +3212,11 @@
"uri": {
"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.",
"type": "string"
},
"version": {
"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.",
"type": "string",
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -3428,6 +3438,11 @@
"additionalProperties": {
"type": "string"
}
},
"version": {
"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.",
"type": "string",
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
}
},
"additionalProperties": false
Expand Down
15 changes: 15 additions & 0 deletions schemas/latest/dev-workspace-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,11 @@
"uri": {
"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.",
"type": "string"
},
"version": {
"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.",
"type": "string",
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -3373,6 +3378,11 @@
"uri": {
"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.",
"type": "string"
},
"version": {
"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.",
"type": "string",
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -3594,6 +3604,11 @@
"additionalProperties": {
"type": "string"
}
},
"version": {
"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.",
"type": "string",
"pattern": "^(latest)|(([1-9])\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?)$"
}
},
"additionalProperties": false
Expand Down
Loading