-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from stefanprodan/containers-inventory
Inventorying of container images referenced by a modules
- Loading branch information
Showing
15 changed files
with
299 additions
and
24 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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
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
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
44 changes: 44 additions & 0 deletions
44
cmd/timoni/testdata/module/cue.mod/pkg/timoni.sh/core/v1alpha1/image.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,44 @@ | ||
// Copyright 2023 Stefan Prodan | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package v1alpha1 | ||
|
||
import "strings" | ||
|
||
// Image defines the schema for OCI image reference used in Kubernetes PodSpec container image. | ||
#Image: { | ||
|
||
// Repository is the address of a container registry repository. | ||
// An image repository is made up of slash-separated name components, optionally | ||
// prefixed by a registry hostname and port in the format [HOST[:PORT_NUMBER]/]PATH. | ||
repository!: string | ||
|
||
// Tag identifies an image in the repository. | ||
// A tag name may contain lowercase and uppercase characters, digits, underscores, periods and dashes. | ||
// A tag name may not start with a period or a dash and may contain a maximum of 128 characters. | ||
tag!: string & strings.MaxRunes(128) | ||
|
||
// Digest uniquely and immutably identifies an image in the repository. | ||
// Spec: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests. | ||
digest!: string | ||
|
||
// Reference is the image address computed from repository, tag and digest | ||
// in the format [REPOSITORY]:[TAG]@[DIGEST]. | ||
reference: string | ||
|
||
if digest != "" && tag != "" { | ||
reference: "\(repository):\(tag)@\(digest)" | ||
} | ||
|
||
if digest != "" && tag == "" { | ||
reference: "\(repository)@\(digest)" | ||
} | ||
|
||
if digest == "" && tag != "" { | ||
reference: "\(repository):\(tag)" | ||
} | ||
|
||
if digest == "" && tag == "" { | ||
reference: "\(repository):latest" | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
cmd/timoni/testdata/module/cue.mod/pkg/timoni.sh/core/v1alpha1/metadata.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,36 @@ | ||
// Copyright 2023 Stefan Prodan | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package v1alpha1 | ||
|
||
import "strings" | ||
|
||
// Metadata defines the schema for Kubernetes object metadata. | ||
#Metadata: { | ||
// Version should be in the strict semver format. Is required when creating resources. | ||
#Version!: string & strings.MaxRunes(63) | ||
|
||
// Name must be unique within a namespace. Is required when creating resources. | ||
// Name is primarily intended for creation idempotence and configuration definition. | ||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names | ||
name!: string & =~"^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" & strings.MaxRunes(63) | ||
|
||
// Namespace defines the space within which each name must be unique. | ||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces | ||
namespace!: string & =~"^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" & strings.MaxRunes(63) | ||
|
||
// Annotations is an unstructured key value map stored with a resource that may be | ||
// set to store and retrieve arbitrary metadata. | ||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations | ||
annotations?: {[string & =~"^(([A-Za-z0-9][-A-Za-z0-9_./]*)?[A-Za-z0-9])?$" & strings.MaxRunes(63)]: string} | ||
|
||
// Map of string keys and values that can be used to organize and categorize (scope and select) objects. | ||
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels | ||
labels: {[string & =~"^(([A-Za-z0-9][-A-Za-z0-9_./]*)?[A-Za-z0-9])?$" & strings.MaxRunes(63)]: string & =~"^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" & strings.MaxRunes(63)} | ||
|
||
// Standard Kubernetes labels: app name and version. | ||
labels: { | ||
"app.kubernetes.io/name": name | ||
"app.kubernetes.io/version": #Version | ||
} | ||
} |
Oops, something went wrong.