-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stefan Prodan <[email protected]>
- Loading branch information
1 parent
e793d75
commit ae8af40
Showing
9 changed files
with
122 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
blueprints/minimal/cue.mod/pkg/timoni.sh/core/v1alpha1/instance.cue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2023 Stefan Prodan | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package v1alpha1 | ||
|
||
import "strings" | ||
|
||
// InstanceName defines the schema for the name of a Timoni instance. | ||
// The instance name is used as a Kubernetes label value and must be 63 characters or less. | ||
#InstanceName: string & =~"^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" & strings.MinRunes(1) & strings.MaxRunes(63) | ||
|
||
// InstanceNamespace defines the schema for the namespace of a Timoni instance. | ||
// The instance namespace is used as a Kubernetes label value and must be 63 characters or less. | ||
#InstanceNamespace: string & =~"^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" & strings.MinRunes(1) & strings.MaxRunes(63) | ||
|
||
// InstanceOwnerReference defines the schema for Kubernetes labels used to denote ownership. | ||
#InstanceOwnerReference: { | ||
#Name: "instance.timoni.sh/name" | ||
#Namespace: "instance.timoni.sh/namespace" | ||
} | ||
|
||
// InstanceModule defines the schema for the Module of a Timoni instance. | ||
#InstanceModule: { | ||
url: string & =~"^((oci|file)://.*)$" | ||
version: *"latest" | string | ||
digest?: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 0 additions & 80 deletions
80
blueprints/minimal/cue.mod/pkg/timoni.sh/core/v1alpha1/secrets.cue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
blueprints/minimal/cue.mod/pkg/timoni.sh/core/v1alpha1/semver.cue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2023 Stefan Prodan | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
"strconv" | ||
"strings" | ||
) | ||
|
||
// SemVer validates the input version string and extracts the major and minor version numbers. | ||
// When Minimum is set, the major and minor parts must be greater or equal to the minimum | ||
// or a validation error is returned. | ||
#SemVer: { | ||
// Input version string in strict semver format. | ||
#Version!: string & =~"^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$" | ||
|
||
// Minimum is the minimum allowed MAJOR.MINOR version. | ||
#Minimum: *"0.0.0" | string & =~"^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$" | ||
|
||
let minMajor = strconv.Atoi(strings.Split(#Minimum, ".")[0]) | ||
let minMinor = strconv.Atoi(strings.Split(#Minimum, ".")[1]) | ||
|
||
major: int & >=minMajor | ||
major: strconv.Atoi(strings.Split(#Version, ".")[0]) | ||
|
||
minor: int & >=minMinor | ||
minor: strconv.Atoi(strings.Split(#Version, ".")[1]) | ||
} |
23 changes: 0 additions & 23 deletions
23
blueprints/minimal/cue.mod/pkg/timoni.sh/core/v1alpha1/version.cue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters