Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
54d2861
implement API conversions
AustinAbro321 Jul 1, 2026
ec99a3d
convert
AustinAbro321 Jul 1, 2026
56f36cc
zarf dev convert
AustinAbro321 Jul 1, 2026
95f7339
upgrade-schema
AustinAbro321 Jul 1, 2026
97ecf63
upgrade
AustinAbro321 Jul 1, 2026
8f51cc2
fix convert order
AustinAbro321 Jul 1, 2026
37350d9
convert
AustinAbro321 Jul 1, 2026
cb75ace
rename
AustinAbro321 Jul 1, 2026
e94969a
work regardless of path
AustinAbro321 Jul 1, 2026
2d19eca
Merge branch 'main' into introduce-api-conversions
AustinAbro321 Jul 8, 2026
319738f
Merge branch 'main' into introduce-api-conversions
AustinAbro321 Jul 8, 2026
8af9b29
account for new fields
AustinAbro321 Jul 8, 2026
60c71f2
set required to optional
AustinAbro321 Jul 14, 2026
9ab1b04
set required from api version
AustinAbro321 Jul 14, 2026
ec2387c
add roundtrip test
AustinAbro321 Jul 14, 2026
f12cb20
exclude paths
AustinAbro321 Jul 14, 2026
971860e
fix template fields
AustinAbro321 Jul 14, 2026
ec59b0f
full round trip
AustinAbro321 Jul 14, 2026
0a766c0
simplify required conversion
AustinAbro321 Jul 14, 2026
9569a63
roundtrip
AustinAbro321 Jul 14, 2026
389be65
templated values files
AustinAbro321 Jul 14, 2026
ee1ba71
fix git logic
AustinAbro321 Jul 14, 2026
f434c7a
keep existing annotations
AustinAbro321 Jul 14, 2026
d86804e
set original api version correctly
AustinAbro321 Jul 14, 2026
1b32c5a
git conversions
AustinAbro321 Jul 20, 2026
fbc0656
betterr tests
AustinAbro321 Jul 20, 2026
76fa36a
parse ref
AustinAbro321 Jul 20, 2026
8f37c18
fix refs
AustinAbro321 Jul 20, 2026
afbdd4a
docs and schema
AustinAbro321 Jul 20, 2026
a0a37ab
change to new strategy
AustinAbro321 Jul 20, 2026
76a67b3
convert test
AustinAbro321 Jul 20, 2026
ebe112f
add tests
AustinAbro321 Jul 20, 2026
ff9fd09
Merge branch 'introduce-api-conversions-new-strategy' into introduce-…
AustinAbro321 Jul 23, 2026
946d520
Merge branch 'main' into introduce-api-conversions
AustinAbro321 Jul 24, 2026
68b3d39
make docs and schema
AustinAbro321 Jul 24, 2026
ed6efd9
oneof required
AustinAbro321 Jul 27, 2026
115dbef
Merge branch 'main' into introduce-api-conversions
AustinAbro321 Jul 27, 2026
99def50
docs and schema
AustinAbro321 Jul 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/api/convert/convert.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors

// Package convert provides functions for converting between Zarf package API versions.
package convert

import (
"github.com/zarf-dev/zarf/src/api/v1alpha1"
"github.com/zarf-dev/zarf/src/api/v1beta1"
internalv1alpha1 "github.com/zarf-dev/zarf/src/internal/api/v1alpha1"
internalv1beta1 "github.com/zarf-dev/zarf/src/internal/api/v1beta1"
)

// PackageV1alpha1ToV1beta1 converts a v1alpha1 ZarfPackage to a v1beta1 Package.
func PackageV1alpha1ToV1beta1(pkg v1alpha1.ZarfPackage) v1beta1.Package {
generic := internalv1alpha1.ConvertToGeneric(pkg)
return internalv1beta1.ConvertFromGeneric(generic)
}

// PackageV1beta1ToV1alpha1 converts a v1beta1 Package to a v1alpha1 ZarfPackage.
func PackageV1beta1ToV1alpha1(pkg v1beta1.Package) v1alpha1.ZarfPackage {
generic := internalv1beta1.ConvertToGeneric(pkg)
return internalv1alpha1.ConvertFromGeneric(generic)
}
Loading