Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Aug 7, 2024
2 parents 35a1dfc + 95e9e45 commit 3a9f928
Show file tree
Hide file tree
Showing 20 changed files with 332 additions and 208 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:

# Upload the contents of the build directory for later stages to use
- name: Upload build artifacts
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: build-artifacts
path: build/
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.brew-tap-token.outputs.token }}

- name: Save CVE report
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: cve-report
path: build/zarf-known-cves.csv
4 changes: 2 additions & 2 deletions .github/workflows/scan-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/init@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql.yaml
Expand All @@ -62,6 +62,6 @@ jobs:
run: make build-cli-linux-amd

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/analyze@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/upload-sarif@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/test-bigbang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

# Upload the contents of the build directory for later stages to use
- name: Upload build artifacts
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: build-artifacts
path: build/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

# Upload the contents of the build directory for later stages to use
- name: Upload build artifacts
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: build-artifacts
path: build/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

# Upload the contents of the build directory for later stages to use
- name: Upload build artifacts
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: build-artifacts
path: build/
Expand Down
4 changes: 3 additions & 1 deletion src/api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ 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/defenseunicorns/pkg/helpers/v2 v2.0.1 // 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
)
4 changes: 4 additions & 0 deletions src/api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+
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=
19 changes: 10 additions & 9 deletions src/api/v1alpha1/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ import (
"github.com/zarf-dev/zarf/src/pkg/variables"
)

// Zarf looks for these strings in zarf.yaml to make dynamic changes
const (
ZarfPackageTemplatePrefix = "###ZARF_PKG_TMPL_"
ZarfPackageVariablePrefix = "###ZARF_PKG_VAR_"
ZarfPackageArch = "###ZARF_PKG_ARCH###"
ZarfComponentName = "###ZARF_COMPONENT_NAME###"
)

// ZarfPackageKind is an enum of the different kinds of Zarf packages.
type ZarfPackageKind string

Expand All @@ -25,14 +17,23 @@ 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"
)

// Zarf looks for these strings in zarf.yaml to make dynamic changes
const (
ZarfPackageTemplatePrefix = "###ZARF_PKG_TMPL_"
ZarfPackageVariablePrefix = "###ZARF_PKG_VAR_"
ZarfPackageArch = "###ZARF_PKG_ARCH###"
ZarfComponentName = "###ZARF_COMPONENT_NAME###"
)

const apiVersion = "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"`
ApiVersion string `json:"apiVersion,omitempty," jsonschema:"enum=zarf.dev/v1alpha1"`
// The kind of Zarf package.
Kind ZarfPackageKind `json:"kind"`
// Package metadata.
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var connectCmd = &cobra.Command{
spinner.Updatef(lang.CmdConnectEstablishedWeb, tunnel.FullURL())

if err := exec.LaunchURL(tunnel.FullURL()); err != nil {
message.Debug(err)
return err
}
}

Expand Down
16 changes: 12 additions & 4 deletions src/cmd/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ var agentCmd = &cobra.Command{
Short: lang.CmdInternalAgentShort,
Long: lang.CmdInternalAgentLong,
RunE: func(cmd *cobra.Command, _ []string) error {
return agent.StartWebhook(cmd.Context())
cluster, err := cluster.NewCluster()
if err != nil {
return err
}
return agent.StartWebhook(cmd.Context(), cluster)
},
}

Expand All @@ -52,7 +56,11 @@ var httpProxyCmd = &cobra.Command{
Short: lang.CmdInternalProxyShort,
Long: lang.CmdInternalProxyLong,
RunE: func(cmd *cobra.Command, _ []string) error {
return agent.StartHTTPProxy(cmd.Context())
cluster, err := cluster.NewCluster()
if err != nil {
return err
}
return agent.StartHTTPProxy(cmd.Context(), cluster)
},
}

Expand Down Expand Up @@ -161,8 +169,8 @@ 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")
if err := reflector.AddGoComments("github.com/zarf-dev/zarf", "./src/api/v1alpha1"); err != nil {
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)
}
varPackagePath := filepath.Join("src", "pkg", "variables")
Expand Down
1 change: 0 additions & 1 deletion src/config/lang/english.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ const (
AgentErrMarshallJSONPatch = "unable to marshall the json patch"
AgentErrMarshalResponse = "unable to marshal the response"
AgentErrNilReq = "malformed admission review: request is nil"
AgentErrUnableTransform = "unable to transform the provided request; see zarf http proxy logs for more details"
)

// Package create
Expand Down
Loading

0 comments on commit 3a9f928

Please sign in to comment.