forked from aws/eks-anywhere
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upgrader image to the version bundle (aws#7082)
* Add upgrader image to the version bundle Signed-off-by: Rahul Ganesh <[email protected]> * Fix lint formatting and bundle variable name Signed-off-by: Rahul Ganesh <[email protected]> * Fix presubmits, omit version field and update generated deepcopy files Signed-off-by: Rahul Ganesh <[email protected]> * Add upgrader project to assets config and update manifests Signed-off-by: Rahul Ganesh <[email protected]> --------- Signed-off-by: Rahul Ganesh <[email protected]> Co-authored-by: Rahul Ganesh <[email protected]>
- Loading branch information
1 parent
f8cb14e
commit 4922ca1
Showing
12 changed files
with
4,295 additions
and
154 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package bundles | ||
|
||
import ( | ||
"fmt" | ||
|
||
anywherev1alpha1 "github.com/aws/eks-anywhere/release/api/v1alpha1" | ||
releasetypes "github.com/aws/eks-anywhere/release/cli/pkg/types" | ||
) | ||
|
||
func GetUpgraderBundle(r *releasetypes.ReleaseConfig, eksDReleaseChannel string, imageDigests map[string]string) (anywherev1alpha1.UpgraderBundle, error) { | ||
artifacts := r.BundleArtifactsTable[fmt.Sprintf("upgrader-%s", eksDReleaseChannel)] | ||
bundleImageArtifacts := map[string]anywherev1alpha1.Image{} | ||
|
||
for _, artifact := range artifacts { | ||
if artifact.Image != nil { | ||
imageArtifact := artifact.Image | ||
bundleImageArtifact := anywherev1alpha1.Image{ | ||
Name: imageArtifact.AssetName, | ||
Description: fmt.Sprintf("Container image for %s image", imageArtifact.AssetName), | ||
OS: imageArtifact.OS, | ||
Arch: imageArtifact.Arch, | ||
URI: imageArtifact.ReleaseImageURI, | ||
ImageDigest: imageDigests[imageArtifact.ReleaseImageURI], | ||
} | ||
bundleImageArtifacts[imageArtifact.AssetName] = bundleImageArtifact | ||
} | ||
} | ||
|
||
bundle := anywherev1alpha1.UpgraderBundle{ | ||
Upgrader: bundleImageArtifacts["upgrader"], | ||
} | ||
|
||
return bundle, 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
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
Oops, something went wrong.