Skip to content

Commit

Permalink
velero plugins
Browse files Browse the repository at this point in the history
Signed-off-by: Batuhan Apaydin <[email protected]>
  • Loading branch information
developer-guy committed Mar 25, 2024
1 parent 0d96d78 commit 3986bc4
Show file tree
Hide file tree
Showing 13 changed files with 290 additions and 0 deletions.
28 changes: 28 additions & 0 deletions images/velero-plugin-for-aws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--monopod:start-->
# velero-plugin-for-aws
| | |
| - | - |
| **OCI Reference** | `cgr.dev/chainguard/velero-plugin-for-aws` |


* [View Image in Chainguard Academy](https://edu.chainguard.dev/chainguard/chainguard-images/reference/velero-plugin-for-aws/overview/)
* [View Image Catalog](https://console.enforce.dev/images/catalog) for a full list of available tags.
* [Contact Chainguard](https://www.chainguard.dev/chainguard-images) for enterprise support, SLAs, and access to older tags.*

---
<!--monopod:end-->

<!--overview:start-->

<!--overview:end-->

<!--getting:start-->
## Download this Image
The image is available on `cgr.dev`:

```
docker pull cgr.dev/chainguard/velero-plugin-for-aws:latest
```
<!--getting:end-->

<!--body:start--><!--body:end-->
30 changes: 30 additions & 0 deletions images/velero-plugin-for-aws/config/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
terraform {
required_providers {
apko = { source = "chainguard-dev/apko" }
}
}

variable "extra_packages" {
description = "The additional packages to install"
default = []
}

data "apko_config" "this" {
config_contents = file("${path.module}/template.apko.yaml")
extra_packages = var.extra_packages
}

module "accts" { source = "../../../tflib/accts" }

output "config" {
value = jsonencode({
contents = {
packages = var.extra_packages
}
accounts = module.accts.block
entrypoint = {
command = "/bin/cp-plugin /plugins/velero-plugin-for-aws /target/velero-plugin-for-aws"
}
})
}

51 changes: 51 additions & 0 deletions images/velero-plugin-for-aws/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
}
}

locals {
components = toset(["velero-plugin-for-aws"])
}

variable "target_repository" {
description = "The docker repo into which the image and attestations should be published."
}

module "config" {
for_each = local.components
source = "./config"
extra_packages = [each.key, "${each.key}-compat"]
}

module "velero-plugin-for-csi" {
for_each = local.components
source = "../../tflib/publisher"
name = basename(path.module)
target_repository = var.target_repository
config = module.config[each.key].config

build-dev = true
main_package = each.key
}

module "test" {
for_each = local.components
source = "./tests"
digest = module.velero-plugin-for-csi[each.key].image_ref
}

resource "oci_tag" "latest" {
for_each = local.components
depends_on = [module.test]
digest_ref = module.velero-plugin-for-csi[each.key].image_ref
tag = "latest"
}

resource "oci_tag" "latest-dev" {
for_each = local.components
depends_on = [module.test]
digest_ref = module.velero-plugin-for-csi[each.key].dev_ref
tag = "latest-dev"
}

10 changes: 10 additions & 0 deletions images/velero-plugin-for-aws/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: velero-plugin-for-aws
image: cgr.dev/chainguard/velero-plugin-for-aws
logo: https://storage.googleapis.com/chainguard-academy/logos/velero-plugin-for-aws.svg
endoflife: ""
console_summary: ""
short_description: Plugins to support Velero on AWS
compatibility_notes: ""
readme_file: README.md
upstream_url: https://github.com/vmware-tanzu/velero-plugin-for-aws
keywords: []
6 changes: 6 additions & 0 deletions images/velero-plugin-for-aws/tests/EXAMPLE_TEST.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -o errexit -o nounset -o errtrace -o pipefail -x

# TODO: Implement this test.
echo "The test is not implemented yet."
15 changes: 15 additions & 0 deletions images/velero-plugin-for-aws/tests/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
}
}

variable "digest" {
description = "The image digest to run tests over."
}

data "oci_exec_test" "manifest" {
digest = var.digest
script = "./EXAMPLE_TEST.sh"
working_dir = path.module
}
28 changes: 28 additions & 0 deletions images/velero-plugin-for-csi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--monopod:start-->
# velero-plugin-for-csi
| | |
| - | - |
| **OCI Reference** | `cgr.dev/chainguard/velero-plugin-for-csi` |


* [View Image in Chainguard Academy](https://edu.chainguard.dev/chainguard/chainguard-images/reference/velero-plugin-for-csi/overview/)
* [View Image Catalog](https://console.enforce.dev/images/catalog) for a full list of available tags.
* [Contact Chainguard](https://www.chainguard.dev/chainguard-images) for enterprise support, SLAs, and access to older tags.*

---
<!--monopod:end-->

<!--overview:start-->

<!--overview:end-->

<!--getting:start-->
## Download this Image
The image is available on `cgr.dev`:

```
docker pull cgr.dev/chainguard/velero-plugin-for-csi:latest
```
<!--getting:end-->

<!--body:start--><!--body:end-->
30 changes: 30 additions & 0 deletions images/velero-plugin-for-csi/config/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
terraform {
required_providers {
apko = { source = "chainguard-dev/apko" }
}
}

variable "extra_packages" {
description = "The additional packages to install"
default = []
}

data "apko_config" "this" {
config_contents = file("${path.module}/template.apko.yaml")
extra_packages = var.extra_packages
}

module "accts" { source = "../../../tflib/accts" }

output "config" {
value = jsonencode({
contents = {
packages = var.extra_packages
}
accounts = module.accts.block
entrypoint = {
command = "/bin/cp-plugin /plugins/velero-plugin-for-csi /target/velero-plugin-for-csi"
}
})
}

51 changes: 51 additions & 0 deletions images/velero-plugin-for-csi/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
}
}

locals {
components = toset(["velero-plugin-for-csi"])
}

variable "target_repository" {
description = "The docker repo into which the image and attestations should be published."
}

module "config" {
for_each = local.components
source = "./config"
extra_packages = [each.key, "${each.key}-compat"]
}

module "velero-plugin-for-csi" {
for_each = local.components
source = "../../tflib/publisher"
name = basename(path.module)
target_repository = var.target_repository
config = module.config[each.key].config

build-dev = true
main_package = each.key
}

module "test" {
for_each = local.components
source = "./tests"
digest = module.velero-plugin-for-csi[each.key].image_ref
}

resource "oci_tag" "latest" {
for_each = local.components
depends_on = [module.test]
digest_ref = module.velero-plugin-for-csi[each.key].image_ref
tag = "latest"
}

resource "oci_tag" "latest-dev" {
for_each = local.components
depends_on = [module.test]
digest_ref = module.velero-plugin-for-csi[each.key].dev_ref
tag = "latest-dev"
}

10 changes: 10 additions & 0 deletions images/velero-plugin-for-csi/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: velero-plugin-for-csi
image: cgr.dev/chainguard/velero-plugin-for-csi
logo: https://storage.googleapis.com/chainguard-academy/logos/velero-plugin-for-csi.svg
endoflife: ""
console_summary: ""
short_description: Velero plugins for integrating with CSI snapshot API
compatibility_notes: ""
readme_file: README.md
upstream_url: https://github.com/vmware-tanzu/velero-plugin-for-csi
keywords: []
6 changes: 6 additions & 0 deletions images/velero-plugin-for-csi/tests/EXAMPLE_TEST.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -o errexit -o nounset -o errtrace -o pipefail -x

# TODO: Implement this test.
echo "The test is not implemented yet."
15 changes: 15 additions & 0 deletions images/velero-plugin-for-csi/tests/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
}
}

variable "digest" {
description = "The image digest to run tests over."
}

data "oci_exec_test" "manifest" {
digest = var.digest
script = "./EXAMPLE_TEST.sh"
working_dir = path.module
}
10 changes: 10 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,16 @@ module "velero" {
target_repository = "${var.target_repository}/velero"
}

module "velero-plugin-for-aws" {
source = "./images/velero-plugin-for-aws"
target_repository = "${var.target_repository}/velero-plugin-for-aws"
}

module "velero-plugin-for-csi" {
source = "./images/velero-plugin-for-csi"
target_repository = "${var.target_repository}/velero-plugin-for-csi"
}

module "vertical-pod-autoscaler" {
source = "./images/vertical-pod-autoscaler"
target_repository = "${var.target_repository}/vertical-pod-autoscaler"
Expand Down

0 comments on commit 3986bc4

Please sign in to comment.