-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into schristoff_injector
- Loading branch information
Showing
17 changed files
with
232 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Support Guidelines | ||
|
||
We strive to create clear guidelines on communication to the Zarf team to provide a good community experience. | ||
|
||
## Questions | ||
For guidance on using Zarf, [the documentation](https://docs.zarf.dev/) should cover most use cases. | ||
For all questions documentation may not cover, we suggest utilizing [Github Discussions](https://github.com/defenseunicorns/zarf/discussions). | ||
|
||
## Standard Process | ||
All code issues should be a [Github Issue](https://github.com/defenseunicorns/zarf/issues/new/choose) that follows the issue template. | ||
|
||
Following the templates provides the Zarf community a foundation of understanding to be able to assist quickly. | ||
After an issue is made, this issue can be brought into other chanels such as the [Kubernetes Slack #Zarf](https://zarf.dev/slack) channel or the [bi-weekly Zarf Community Meeting](https://docs.zarf.dev/contribute/contributor-guide/). | ||
|
||
Github Issue | ||
/ \ | ||
Zarf Slack Channel Zarf Community Call | ||
|
||
|
||
|
||
## Sensitive Information Process | ||
For issues from those who are unable to post on Github, you may send an email using the following issue template filled out to [zarf-dev-private@googlegroups.com](zarf-dev-private@googlegroups.com) | ||
|
||
The response time to emails may be delayed as they are not able to receive community help, so we encourage participation into Github Issues as much as possible. | ||
|
||
``` | ||
### Environment | ||
Device and OS: | ||
App version: | ||
Kubernetes distro being used: | ||
Other: | ||
### Steps to reproduce | ||
1. | ||
### Expected result | ||
### Actual Result | ||
### Visual Proof (screenshots, videos, text, etc) | ||
### Severity/Priority | ||
### Additional Context | ||
Add any other context or screenshots about the technical debt here. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors | ||
|
||
package filters | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/defenseunicorns/zarf/src/internal/packager/git" | ||
"github.com/defenseunicorns/zarf/src/pkg/transform" | ||
"github.com/defenseunicorns/zarf/src/types" | ||
"github.com/go-git/go-git/v5/plumbing" | ||
) | ||
|
||
// ByDifferentialData filters any images and repos already present in the reference package components. | ||
func ByDifferentialData(diffData *types.DifferentialData) ComponentFilterStrategy { | ||
return &differentialDataFilter{ | ||
diffData: diffData, | ||
} | ||
} | ||
|
||
type differentialDataFilter struct { | ||
diffData *types.DifferentialData | ||
} | ||
|
||
func (f *differentialDataFilter) Apply(pkg types.ZarfPackage) ([]types.ZarfComponent, error) { | ||
diffComponents := []types.ZarfComponent{} | ||
for _, component := range pkg.Components { | ||
filteredImages := []string{} | ||
for _, img := range component.Images { | ||
imgRef, err := transform.ParseImageRef(img) | ||
if err != nil { | ||
return nil, fmt.Errorf("unable to parse image ref %s: %w", img, err) | ||
} | ||
imgTag := imgRef.TagOrDigest | ||
includeImage := imgTag == ":latest" || imgTag == ":stable" || imgTag == ":nightly" | ||
if includeImage || !f.diffData.DifferentialImages[img] { | ||
filteredImages = append(filteredImages, img) | ||
} | ||
} | ||
component.Images = filteredImages | ||
|
||
filteredRepos := []string{} | ||
for _, repoURL := range component.Repos { | ||
_, refPlain, err := transform.GitURLSplitRef(repoURL) | ||
if err != nil { | ||
return nil, err | ||
} | ||
var ref plumbing.ReferenceName | ||
if refPlain != "" { | ||
ref = git.ParseRef(refPlain) | ||
} | ||
includeRepo := ref == "" || (!ref.IsTag() && !plumbing.IsHash(refPlain)) | ||
if includeRepo || !f.diffData.DifferentialRepos[repoURL] { | ||
filteredRepos = append(filteredRepos, repoURL) | ||
} | ||
} | ||
component.Repos = filteredRepos | ||
|
||
diffComponents = append(diffComponents, component) | ||
} | ||
return diffComponents, nil | ||
} |
Oops, something went wrong.