-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
versions: add entry for CoCo operator
Added 'git.coco-operator' entry to the project's versions.yaml with information about the repository URL and reference (commit SHA1, tag...etc) as a way to have a single source truth and avoiding the need to update the references in many places at release time (then roll-back after the release). Now `make deploy` will read the operator's URL and reference from versions.yaml. Likewise, the e2e test's provision. Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
- Loading branch information
Showing
7 changed files
with
62 additions
and
18 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// (C) Copyright Confidential Containers Contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package utils | ||
|
||
import ( | ||
"os" | ||
|
||
"gopkg.in/yaml.v2" | ||
) | ||
|
||
// Relative to test/e2e | ||
const VersionsFile = "../../versions.yaml" | ||
|
||
// Versions represents the project's versions.yaml | ||
type Versions struct { | ||
Git map[string]struct { | ||
Url string `yaml:"url"` | ||
Ref string `yaml:"reference"` | ||
} | ||
} | ||
|
||
// GetVersions unmarshals the project's versions.yaml | ||
func GetVersions() (*Versions, error) { | ||
var versions Versions | ||
|
||
yamlFile, err := os.ReadFile(VersionsFile) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if err := yaml.Unmarshal(yamlFile, &versions); err != nil { | ||
return nil, err | ||
} | ||
|
||
return &versions, nil | ||
} |
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