Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move ZarfPackageConfig to it's own api-versioned package #2801

Merged
merged 41 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2d57404
switching json description to go comments
AustinAbro321 Jul 29, 2024
e466577
switching json description to go comments
AustinAbro321 Jul 29, 2024
a54b4d6
switching json description to go comments
AustinAbro321 Jul 29, 2024
d746067
switching json description to go comments
AustinAbro321 Jul 29, 2024
7e16860
make gen types work again
AustinAbro321 Jul 29, 2024
8dfe1a5
wording
AustinAbro321 Jul 29, 2024
be388f8
add json tags back
AustinAbro321 Jul 29, 2024
59bc21f
add back json tags
AustinAbro321 Jul 29, 2024
cde411a
inline
AustinAbro321 Jul 29, 2024
8f2d3ec
Merge branch 'main' into utilize-invopop-features
AustinAbro321 Jul 30, 2024
fd680fc
back to omitempty
AustinAbro321 Jul 30, 2024
cbc25f2
add back test
AustinAbro321 Jul 30, 2024
da9ea48
removing json options
AustinAbro321 Jul 30, 2024
e8a11ac
add back json data
AustinAbro321 Jul 30, 2024
de0bd7c
bb required
AustinAbro321 Jul 30, 2024
96d703d
de-dup
AustinAbro321 Jul 30, 2024
380d2e7
add period to json descriptions
AustinAbro321 Jul 30, 2024
5e91b84
use more invopop features
AustinAbro321 Jul 30, 2024
4623784
merge
AustinAbro321 Jul 31, 2024
457a23e
move v1alpha1 to it's own package
AustinAbro321 Jul 31, 2024
4094292
Merge remote-tracking branch 'origin/use-more-invopop-features' into …
AustinAbro321 Jul 31, 2024
8efabbb
Merge branch 'main' into add-api-version
AustinAbro321 Jul 31, 2024
cd3f497
adding go mod to api package
AustinAbro321 Jul 31, 2024
d16a7d7
move bigbang over
AustinAbro321 Jul 31, 2024
2716d41
avoid introducing dependencies
AustinAbro321 Jul 31, 2024
648bbf0
header title
AustinAbro321 Jul 31, 2024
df9c182
package
AustinAbro321 Jul 31, 2024
d1a934d
Merge branch 'main' into add-api-version
AustinAbro321 Jul 31, 2024
2bddac1
update go mod
AustinAbro321 Aug 1, 2024
822f386
Merge branch 'main' into add-api-version
AustinAbro321 Aug 1, 2024
ff08442
merge
AustinAbro321 Aug 2, 2024
105ecdc
update package
AustinAbro321 Aug 2, 2024
00163e6
zarf package config
AustinAbro321 Aug 2, 2024
380538a
remove json schema extend
AustinAbro321 Aug 2, 2024
37d6c65
fix gen schema
AustinAbro321 Aug 2, 2024
46443ec
re add constants
AustinAbro321 Aug 2, 2024
fad3edb
variables
AustinAbro321 Aug 2, 2024
cb0fb33
variables
AustinAbro321 Aug 2, 2024
b716d1c
Merge branch 'main' into add-api-version
AustinAbro321 Aug 5, 2024
5c341dd
Merge branch 'main' into add-api-version
AustinAbro321 Aug 5, 2024
f78b8f7
add tests to ensure the schema properly checks apiVersion
AustinAbro321 Aug 6, 2024
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
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module github.com/zarf-dev/zarf

go 1.22.4

replace github.com/zarf-dev/zarf/src/api => ./src/api

// TODO (@AABRO): Pending merge into github.com/gojsonschema/gojsonschema (https://github.com/gojsonschema/gojsonschema/pull/5)
replace github.com/xeipuuv/gojsonschema => github.com/defenseunicorns/gojsonschema v0.0.0-20231116163348-e00f069122d6

Expand Down Expand Up @@ -49,6 +51,7 @@ require (
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.9.0
github.com/xeipuuv/gojsonschema v1.2.0
github.com/zarf-dev/zarf/src/api v0.0.0-00010101000000-000000000000
golang.org/x/crypto v0.25.0
golang.org/x/sync v0.7.0
golang.org/x/term v0.22.0
Expand Down
28 changes: 28 additions & 0 deletions src/api/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module github.com/zarf-dev/zarf/src/api

go 1.22.4

replace github.com/zarf-dev/zarf => ../..

require (
github.com/defenseunicorns/pkg/helpers/v2 v2.0.1
github.com/invopop/jsonschema v0.12.0
github.com/stretchr/testify v1.9.0
github.com/zarf-dev/zarf v0.37.0
k8s.io/apimachinery v0.30.3
)

require (
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/otiai10/copy v1.14.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect
oras.land/oras-go/v2 v2.5.0 // indirect
)
37 changes: 37 additions & 0 deletions src/api/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/defenseunicorns/pkg/helpers/v2 v2.0.1 h1:j08rz9vhyD9Bs+yKiyQMY2tSSejXRMxTqEObZ5M1Wbk=
github.com/defenseunicorns/pkg/helpers/v2 v2.0.1/go.mod h1:u1PAqOICZyiGIVA2v28g55bQH1GiAt0Bc4U9/rnWQvQ=
github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI=
github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU=
github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w=
github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks=
github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/apimachinery v0.30.3 h1:q1laaWCmrszyQuSQCfNB8cFgCuDAoPszKY4ucAjDwHc=
k8s.io/apimachinery v0.30.3/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI=
k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
oras.land/oras-go/v2 v2.5.0 h1:o8Me9kLY74Vp5uw07QXPiitjsw7qNXi8Twd+19Zf02c=
oras.land/oras-go/v2 v2.5.0/go.mod h1:z4eisnLP530vwIOUOJeBIj0aGI0L1C3d53atvCBqZHg=
6 changes: 3 additions & 3 deletions src/types/component.go → src/api/v1alpha1/component.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors

// Package types contains all the types used by Zarf.
package types
// Package v1alpha1 holds the definition of the v1alpha1 Zarf Package
package v1alpha1

import (
"github.com/invopop/jsonschema"
"github.com/zarf-dev/zarf/src/api/v1alpha1/extensions"
"github.com/zarf-dev/zarf/src/pkg/utils/exec"
"github.com/zarf-dev/zarf/src/pkg/variables"
"github.com/zarf-dev/zarf/src/types/extensions"
)

// ZarfComponent is the primary functional grouping of assets to deploy by Zarf.
Expand Down
11 changes: 8 additions & 3 deletions src/types/package.go → src/api/v1alpha1/package.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors

// Package types contains all the types used by Zarf.
package types
// Package v1alpha1 holds the definition of the v1alpha1 Zarf Package
package v1alpha1

import "github.com/zarf-dev/zarf/src/pkg/variables"
import (
"github.com/zarf-dev/zarf/src/pkg/variables"
)

// ZarfPackageKind is an enum of the different kinds of Zarf packages.
type ZarfPackageKind string
Expand All @@ -14,10 +16,13 @@ const (
ZarfInitConfig ZarfPackageKind = "ZarfInitConfig"
// ZarfPackageConfig is the default kind of Zarf package, primarily used during `zarf package`.
ZarfPackageConfig ZarfPackageKind = "ZarfPackageConfig"
ApiVersion string = "zarf.dev/v1alpha1"
)

// ZarfPackage the top-level structure of a Zarf config file.
type ZarfPackage struct {
// The API version of the Zarf package.
ApiVersion string `json:"apiVersion,omitempty," jsonschema:"enum=zarf.dev/v1alpha1"`
// The kind of Zarf package.
Kind ZarfPackageKind `json:"kind" jsonschema:"enum=ZarfInitConfig,enum=ZarfPackageConfig,default=ZarfPackageConfig"`
// Package metadata.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors

package types
// Package v1alpha1 holds the definition of the v1alpha1 Zarf Package
package v1alpha1

import (
"testing"
Expand Down
19 changes: 13 additions & 6 deletions src/types/validate.go → src/api/v1alpha1/validate.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors

// Package types contains all the types used by Zarf.
package types
// Package v1alpha1 holds the definition of the v1alpha1 Zarf Package
package v1alpha1

import (
"errors"
Expand All @@ -16,11 +16,12 @@ import (
"k8s.io/apimachinery/pkg/util/validation"
)

// Zarf looks for these strings in zarf.yaml to make dynamic changes
const (
// ZarfMaxChartNameLength limits helm chart name size to account for K8s/helm limits and zarf prefix
ZarfMaxChartNameLength = 40
errChartReleaseNameEmpty = "release name empty, unable to fallback to chart name"
errChartReleaseNameInvalid = "invalid release name %s: a DNS-1035 label must consist of lower case alphanumeric characters or -, start with an alphabetic character, and end with an alphanumeric character"
ZarfPackageTemplatePrefix = "###ZARF_PKG_TMPL_"
ZarfPackageVariablePrefix = "###ZARF_PKG_VAR_"
ZarfPackageArch = "###ZARF_PKG_ARCH###"
ZarfComponentName = "###ZARF_COMPONENT_NAME###"
)

var (
Expand All @@ -41,6 +42,12 @@ func SupportedOS() []string {
return supportedOS
}

const (
// ZarfMaxChartNameLength limits helm chart name size to account for K8s/helm limits and zarf prefix
ZarfMaxChartNameLength = 40
errChartReleaseNameEmpty = "release name empty, unable to fallback to chart name"
)

// Validate runs all validation checks on the package.
func (pkg ZarfPackage) Validate() error {
var err error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors

// Package types contains all the types used by Zarf.
package types
// Package v1alpha1 holds the definition of the v1alpha1 Zarf Package
package v1alpha1

import (
"fmt"
Expand Down
7 changes: 4 additions & 3 deletions src/cmd/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
"github.com/spf13/pflag"
"github.com/zarf-dev/zarf/src/api/v1alpha1"
"github.com/zarf-dev/zarf/src/cmd/common"
"github.com/zarf-dev/zarf/src/config/lang"
"github.com/zarf-dev/zarf/src/internal/agent"
Expand Down Expand Up @@ -160,7 +161,7 @@ tableOfContents: false
func addGoComments(reflector *jsonschema.Reflector) error {
addCommentErr := errors.New("this command must be called from the root of the Zarf repo")

typePackagePath := filepath.Join("src", "types")
typePackagePath := filepath.Join("src", "api", "v1alpha1")
if err := reflector.AddGoComments("github.com/zarf-dev/zarf", typePackagePath); err != nil {
return fmt.Errorf("%w: %w", addCommentErr, err)
}
Expand All @@ -181,7 +182,7 @@ var genConfigSchemaCmd = &cobra.Command{
return err
}

schema := reflector.Reflect(&types.ZarfPackage{})
schema := reflector.Reflect(&v1alpha1.ZarfPackage{})
output, err := json.MarshalIndent(schema, "", " ")
if err != nil {
return fmt.Errorf("unable to generate the Zarf config schema: %w", err)
Expand All @@ -193,7 +194,7 @@ var genConfigSchemaCmd = &cobra.Command{

type zarfTypes struct {
DeployedPackage types.DeployedPackage
ZarfPackage types.ZarfPackage
ZarfPackage v1alpha1.ZarfPackage
ZarfState types.ZarfState
}

Expand Down
32 changes: 16 additions & 16 deletions src/extensions/bigbang/bigbang.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import (
"github.com/defenseunicorns/pkg/helpers/v2"
fluxHelmCtrl "github.com/fluxcd/helm-controller/api/v2beta1"
fluxSrcCtrl "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/zarf-dev/zarf/src/api/v1alpha1"
"github.com/zarf-dev/zarf/src/api/v1alpha1/extensions"
"github.com/zarf-dev/zarf/src/internal/packager/helm"
"github.com/zarf-dev/zarf/src/pkg/layout"
"github.com/zarf-dev/zarf/src/pkg/message"
"github.com/zarf-dev/zarf/src/pkg/utils"
"github.com/zarf-dev/zarf/src/pkg/variables"
"github.com/zarf-dev/zarf/src/types"
"github.com/zarf-dev/zarf/src/types/extensions"
"helm.sh/helm/v3/pkg/chartutil"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -43,9 +43,9 @@ var tenMins = metav1.Duration{

// Run mutates a component that should deploy Big Bang to a set of manifests
// that contain the flux deployment of Big Bang
func Run(ctx context.Context, YOLO bool, tmpPaths *layout.ComponentPaths, c types.ZarfComponent) (types.ZarfComponent, error) {
func Run(ctx context.Context, YOLO bool, tmpPaths *layout.ComponentPaths, c v1alpha1.ZarfComponent) (v1alpha1.ZarfComponent, error) {
cfg := c.Extensions.BigBang
manifests := []types.ZarfManifest{}
manifests := []v1alpha1.ZarfManifest{}

validVersionResponse, err := isValidVersion(cfg.Version)

Expand Down Expand Up @@ -86,7 +86,7 @@ func Run(ctx context.Context, YOLO bool, tmpPaths *layout.ComponentPaths, c type

// Configure helm to pull down the Big Bang chart.
helmCfg := helm.New(
types.ZarfChart{
v1alpha1.ZarfChart{
Name: bb,
Namespace: bb,
URL: bbRepo,
Expand Down Expand Up @@ -149,11 +149,11 @@ func Run(ctx context.Context, YOLO bool, tmpPaths *layout.ComponentPaths, c type
// Add wait actions for each of the helm releases in generally the order they should be deployed.
for _, hrNamespacedName := range namespacedHelmReleaseNames {
hr := hrDependencies[hrNamespacedName]
action := types.ZarfComponentAction{
action := v1alpha1.ZarfComponentAction{
Description: fmt.Sprintf("Big Bang Helm Release `%s` to be ready", hrNamespacedName),
MaxTotalSeconds: &maxTotalSeconds,
Wait: &types.ZarfComponentActionWait{
Cluster: &types.ZarfComponentActionWaitCluster{
Wait: &v1alpha1.ZarfComponentActionWait{
Cluster: &v1alpha1.ZarfComponentActionWaitCluster{
Kind: "HelmRelease",
Name: hr.Metadata.Name,
Namespace: hr.Metadata.Namespace,
Expand All @@ -168,7 +168,7 @@ func Run(ctx context.Context, YOLO bool, tmpPaths *layout.ComponentPaths, c type
// https://repo1.dso.mil/big-bang/bigbang/-/blob/1.54.0/chart/templates/metrics-server/helmrelease.yaml
if hr.Metadata.Name == "metrics-server" {
action.Description = "K8s metric server to exist or be deployed by Big Bang"
action.Wait.Cluster = &types.ZarfComponentActionWaitCluster{
action.Wait.Cluster = &v1alpha1.ZarfComponentActionWaitCluster{
Kind: "APIService",
// https://github.com/kubernetes-sigs/metrics-server#compatibility-matrix
Name: "v1beta1.metrics.k8s.io",
Expand All @@ -195,21 +195,21 @@ func Run(ctx context.Context, YOLO bool, tmpPaths *layout.ComponentPaths, c type

// Add onFailure actions with additional troubleshooting information.
for _, cmd := range failureGeneral {
c.Actions.OnDeploy.OnFailure = append(c.Actions.OnDeploy.OnFailure, types.ZarfComponentAction{
c.Actions.OnDeploy.OnFailure = append(c.Actions.OnDeploy.OnFailure, v1alpha1.ZarfComponentAction{
Cmd: fmt.Sprintf("./zarf tools kubectl %s", cmd),
})
}

for _, cmd := range failureDebug {
c.Actions.OnDeploy.OnFailure = append(c.Actions.OnDeploy.OnFailure, types.ZarfComponentAction{
c.Actions.OnDeploy.OnFailure = append(c.Actions.OnDeploy.OnFailure, v1alpha1.ZarfComponentAction{
Mute: &t,
Description: "Storing debug information to the log for troubleshooting.",
Cmd: fmt.Sprintf("./zarf tools kubectl %s", cmd),
})
}

// Add a pre-remove action to suspend the Big Bang HelmReleases to prevent reconciliation during removal.
c.Actions.OnRemove.Before = append(c.Actions.OnRemove.Before, types.ZarfComponentAction{
c.Actions.OnRemove.Before = append(c.Actions.OnRemove.Before, v1alpha1.ZarfComponentAction{
Description: "Suspend Big Bang HelmReleases to prevent reconciliation during removal.",
Cmd: `./zarf tools kubectl patch helmrelease -n bigbang bigbang --type=merge -p '{"spec":{"suspend":true}}'`,
})
Expand Down Expand Up @@ -250,7 +250,7 @@ func Run(ctx context.Context, YOLO bool, tmpPaths *layout.ComponentPaths, c type
}

// Skeletonize mutates a component so that the valuesFiles can be contained inside a skeleton package
func Skeletonize(tmpPaths *layout.ComponentPaths, c types.ZarfComponent) (types.ZarfComponent, error) {
func Skeletonize(tmpPaths *layout.ComponentPaths, c v1alpha1.ZarfComponent) (v1alpha1.ZarfComponent, error) {
for valuesIdx, valuesFile := range c.Extensions.BigBang.ValuesFiles {
// Get the base file name for this file.
baseName := filepath.Base(valuesFile)
Expand Down Expand Up @@ -297,7 +297,7 @@ func Skeletonize(tmpPaths *layout.ComponentPaths, c types.ZarfComponent) (types.
// Compose mutates a component so that its local paths are relative to the provided path
//
// additionally, it will merge any overrides
func Compose(c *types.ZarfComponent, override types.ZarfComponent, relativeTo string) {
func Compose(c *v1alpha1.ZarfComponent, override v1alpha1.ZarfComponent, relativeTo string) {
// perform any overrides
if override.Extensions.BigBang != nil {
for valuesIdx, valuesFile := range override.Extensions.BigBang.ValuesFiles {
Expand Down Expand Up @@ -453,9 +453,9 @@ func findBBResources(t string) (gitRepos map[string]string, helmReleaseDeps map[
}

// addBigBangManifests creates the manifests component for deploying Big Bang.
func addBigBangManifests(YOLO bool, manifestDir string, cfg *extensions.BigBang) (types.ZarfManifest, error) {
func addBigBangManifests(YOLO bool, manifestDir string, cfg *extensions.BigBang) (v1alpha1.ZarfManifest, error) {
// Create a manifest component that we add to the zarf package for bigbang.
manifest := types.ZarfManifest{
manifest := v1alpha1.ZarfManifest{
Name: bb,
Namespace: bb,
}
Expand Down
8 changes: 4 additions & 4 deletions src/extensions/bigbang/flux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (

"github.com/defenseunicorns/pkg/helpers/v2"
fluxHelmCtrl "github.com/fluxcd/helm-controller/api/v2beta1"
"github.com/zarf-dev/zarf/src/api/v1alpha1"
"github.com/zarf-dev/zarf/src/api/v1alpha1/extensions"
"github.com/zarf-dev/zarf/src/internal/packager/kustomize"
"github.com/zarf-dev/zarf/src/pkg/utils"
"github.com/zarf-dev/zarf/src/types"
"github.com/zarf-dev/zarf/src/types/extensions"
"helm.sh/helm/v3/pkg/chartutil"
v1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -43,7 +43,7 @@ func (h HelmReleaseDependency) Dependencies() []string {
}

// getFlux Creates a component to deploy Flux.
func getFlux(baseDir string, cfg *extensions.BigBang) (manifest types.ZarfManifest, images []string, err error) {
func getFlux(baseDir string, cfg *extensions.BigBang) (manifest v1alpha1.ZarfManifest, images []string, err error) {
localPath := path.Join(baseDir, "bb-ext-flux.yaml")
kustomizePath := path.Join(baseDir, "kustomization.yaml")

Expand Down Expand Up @@ -72,7 +72,7 @@ func getFlux(baseDir string, cfg *extensions.BigBang) (manifest types.ZarfManife
}

// Add the flux.yaml file to the component manifests.
manifest = types.ZarfManifest{
manifest = v1alpha1.ZarfManifest{
Name: "flux-system",
Namespace: "flux-system",
Files: []string{localPath},
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/bigbang/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/Masterminds/semver/v3"
fluxHelmCtrl "github.com/fluxcd/helm-controller/api/v2beta1"
fluxSrcCtrl "github.com/fluxcd/source-controller/api/v1"
"github.com/zarf-dev/zarf/src/types/extensions"
"github.com/zarf-dev/zarf/src/api/v1alpha1/extensions"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
Loading