Skip to content

Commit

Permalink
Update cert manager bundle in the EKS-A bundle with new image (#8812)
Browse files Browse the repository at this point in the history
  • Loading branch information
sp1999 authored Sep 26, 2024
1 parent 3330319 commit 47c2381
Show file tree
Hide file tree
Showing 15 changed files with 236 additions and 97 deletions.
35 changes: 32 additions & 3 deletions config/crd/bases/anywhere.eks.amazonaws.com_bundles.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: bundles.anywhere.eks.amazonaws.com
spec:
Expand Down Expand Up @@ -400,6 +399,7 @@ spec:
type: string
type: object
ctl:
description: This field has been deprecated
properties:
arch:
description: Architectures of the asset
Expand Down Expand Up @@ -434,6 +434,35 @@ spec:
description: URI points to the manifest yaml file
type: string
type: object
startupapicheck:
properties:
arch:
description: Architectures of the asset
items:
type: string
type: array
description:
type: string
imageDigest:
description: The SHA256 digest of the image manifest
type: string
name:
description: The asset name
type: string
os:
description: Operating system of the asset
enum:
- linux
- darwin
- windows
type: string
osName:
description: Name of the OS like ubuntu, bottlerocket
type: string
uri:
description: The image repository, name, and tag
type: string
type: object
version:
type: string
webhook:
Expand Down Expand Up @@ -469,8 +498,8 @@ spec:
- acmesolver
- cainjector
- controller
- ctl
- manifest
- startupapicheck
- webhook
type: object
cilium:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: eksareleases.anywhere.eks.amazonaws.com
spec:
Expand Down
20 changes: 10 additions & 10 deletions config/manifest/eksa-components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: bundles.anywhere.eks.amazonaws.com
spec:
Expand Down Expand Up @@ -567,7 +567,13 @@ spec:
description: The image repository, name, and tag
type: string
type: object
ctl:
manifest:
properties:
uri:
description: URI points to the manifest yaml file
type: string
type: object
startupapicheck:
properties:
arch:
description: Architectures of the asset
Expand Down Expand Up @@ -596,12 +602,6 @@ spec:
description: The image repository, name, and tag
type: string
type: object
manifest:
properties:
uri:
description: URI points to the manifest yaml file
type: string
type: object
version:
type: string
webhook:
Expand Down Expand Up @@ -637,8 +637,8 @@ spec:
- acmesolver
- cainjector
- controller
- ctl
- manifest
- startupapicheck
- webhook
type: object
cilium:
Expand Down Expand Up @@ -4943,7 +4943,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: eksareleases.anywhere.eks.amazonaws.com
spec:
Expand Down
2 changes: 2 additions & 0 deletions internal/test/testdata/bundles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ spec:
uri: public.ecr.aws/l0g8r8j6/cert-manager/cert-manager-cainjector:v1.1.0-17655eca4c3db6708da08de4e04ea646d1cfd0c9
controller:
uri: public.ecr.aws/l0g8r8j6/cert-manager/cert-manager-controller:v1.1.0-17655eca4c3db6708da08de4e04ea646d1cfd0c9
startupapicheck:
uri: public.ecr.aws/l0g8r8j6/cert-manager/cert-manager-startupapicheck:v1.1.0-17655eca4c3db6708da08de4e04ea646d1cfd0c9
webhook:
uri: public.ecr.aws/l0g8r8j6/cert-manager/cert-manager-webhook:v1.1.0-17655eca4c3db6708da08de4e04ea646d1cfd0c9
cilium:
Expand Down
4 changes: 1 addition & 3 deletions release/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ WEEKLY_RELEASES_URL_PREFIX=https://dev-release-assets.eks-anywhere.model-rocket.

# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -84,7 +82,7 @@ clean: ## Cleanup resources created by make targets
##@ Development

manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) crd:crdVersions=v1 rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
## Copy only the bundles crd to root config kustomization folder
cp -f config/crd/bases/anywhere.eks.amazonaws.com_bundles.yaml ../config/crd/bases/
cp -f config/crd/bases/anywhere.eks.amazonaws.com_eksareleases.yaml ../config/crd/bases/
Expand Down
2 changes: 1 addition & 1 deletion release/api/v1alpha1/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (vb *VersionsBundle) SharedImages() []Image {
vb.CertManager.Acmesolver,
vb.CertManager.Cainjector,
vb.CertManager.Controller,
vb.CertManager.Ctl,
vb.CertManager.Startupapicheck,
vb.CertManager.Webhook,
vb.Cilium.Cilium,
vb.Cilium.Operator,
Expand Down
77 changes: 77 additions & 0 deletions release/api/v1alpha1/artifacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,80 @@ func TestVersionsBundleSnowImages(t *testing.T) {
})
}
}

func TestVersionsBundleSharedImages(t *testing.T) {
expectedSharedImages := make([]v1alpha1.Image, 27)
expectedSharedImages = append(
expectedSharedImages[:5],
append(
[]v1alpha1.Image{
{
Name: "acmesolver",
URI: "uri1",
},
{
Name: "cainjector",
URI: "uri2",
},
{
Name: "controller",
URI: "uri3",
},
{
Name: "startupapicheck",
URI: "uri4",
},
{
Name: "webhook",
URI: "uri5",
},
},
expectedSharedImages[5:]...,
)...,
)
tests := []struct {
name string
versionsBundle *v1alpha1.VersionsBundle
want []v1alpha1.Image
}{
{
name: "no images",
versionsBundle: &v1alpha1.VersionsBundle{},
want: make([]v1alpha1.Image, 32),
},
{
name: "cert-manager images",
versionsBundle: &v1alpha1.VersionsBundle{
CertManager: v1alpha1.CertManagerBundle{
Acmesolver: v1alpha1.Image{
Name: "acmesolver",
URI: "uri1",
},
Cainjector: v1alpha1.Image{
Name: "cainjector",
URI: "uri2",
},
Controller: v1alpha1.Image{
Name: "controller",
URI: "uri3",
},
Startupapicheck: v1alpha1.Image{
Name: "startupapicheck",
URI: "uri4",
},
Webhook: v1alpha1.Image{
Name: "webhook",
URI: "uri5",
},
},
},
want: expectedSharedImages,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
g.Expect(tt.versionsBundle.SharedImages()).To(Equal(tt.want))
})
}
}
16 changes: 9 additions & 7 deletions release/api/v1alpha1/bundle_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,15 @@ type BottlerocketHostContainersBundle struct {
}

type CertManagerBundle struct {
Version string `json:"version,omitempty"`
Acmesolver Image `json:"acmesolver"`
Cainjector Image `json:"cainjector"`
Controller Image `json:"controller"`
Ctl Image `json:"ctl"`
Webhook Image `json:"webhook"`
Manifest Manifest `json:"manifest"`
Version string `json:"version,omitempty"`
Acmesolver Image `json:"acmesolver"`
Cainjector Image `json:"cainjector"`
Controller Image `json:"controller"`
// This field has been deprecated
Ctl *Image `json:"ctl,omitempty"`
Startupapicheck Image `json:"startupapicheck"`
Webhook Image `json:"webhook"`
Manifest Manifest `json:"manifest"`
}

type CoreClusterAPI struct {
Expand Down
7 changes: 6 additions & 1 deletion release/api/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion release/cli/pkg/assets/config/bundle_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var bundleReleaseAssetsConfigMap = []assettypes.AssetConfig{
RepoName: "cert-manager-controller",
},
{
RepoName: "cert-manager-ctl",
RepoName: "cert-manager-startupapicheck",
},
{
RepoName: "cert-manager-webhook",
Expand Down
14 changes: 7 additions & 7 deletions release/cli/pkg/bundles/certmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ func GetCertManagerBundle(r *releasetypes.ReleaseConfig, imageDigests releasetyp
}

bundle := anywherev1alpha1.CertManagerBundle{
Version: version,
Acmesolver: bundleImageArtifacts["cert-manager-acmesolver"],
Cainjector: bundleImageArtifacts["cert-manager-cainjector"],
Controller: bundleImageArtifacts["cert-manager-controller"],
Ctl: bundleImageArtifacts["cert-manager-ctl"],
Webhook: bundleImageArtifacts["cert-manager-webhook"],
Manifest: bundleManifestArtifacts["cert-manager.yaml"],
Version: version,
Acmesolver: bundleImageArtifacts["cert-manager-acmesolver"],
Cainjector: bundleImageArtifacts["cert-manager-cainjector"],
Controller: bundleImageArtifacts["cert-manager-controller"],
Startupapicheck: bundleImageArtifacts["cert-manager-startupapicheck"],
Webhook: bundleImageArtifacts["cert-manager-webhook"],
Manifest: bundleManifestArtifacts["cert-manager.yaml"],
}

return bundle, nil
Expand Down
Loading

0 comments on commit 47c2381

Please sign in to comment.