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

chore: automated PR to main 2024-09-01 #1767

Merged
merged 7 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
strategy:
fail-fast: false
matrix:
KUBERNETES_VERSION: ["1.28.7", "1.29.2"]
KUBERNETES_VERSION: ["1.28.12", "1.29.2"]
GATEKEEPER_VERSION: ["3.14.0", "3.15.0", "3.16.0"]
uses: ./.github/workflows/e2e-k8s.yml
with:
Expand All @@ -53,7 +53,7 @@ jobs:
strategy:
fail-fast: false
matrix:
KUBERNETES_VERSION: ["1.27.9", "1.29.2"]
KUBERNETES_VERSION: ["1.28.12", "1.29.2"]
GATEKEEPER_VERSION: ["3.14.0", "3.15.0", "3.16.0"]
uses: ./.github/workflows/e2e-aks.yml
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ jobs:
with:
go-version: "1.22"
- name: Initialize CodeQL
uses: github/codeql-action/init@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # tag=v3.26.5
uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # tag=v3.26.6
with:
languages: go
- name: Run tidy
run: go mod tidy
- name: Build CLI
run: make build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # tag=v3.26.5
uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # tag=v3.26.6
2 changes: 1 addition & 1 deletion .github/workflows/e2e-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
make e2e-aks KUBERNETES_VERSION=${{ inputs.k8s_version }} GATEKEEPER_VERSION=${{ inputs.gatekeeper_version }} TENANT_ID=${{ secrets.AZURE_TENANT_ID }} AZURE_SP_OBJECT_ID=${{ secrets.AZURE_SP_OBJECT_ID }}

- name: Upload artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: ${{ always() }}
with:
name: e2e-logs-aks-${{ inputs.k8s_version }}-${{ inputs.gatekeeper_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
kubectl logs -n gatekeeper-system -l app=ratify --tail=-1 > logs-ratify-preinstall-${{ matrix.KUBERNETES_VERSION }}-${{ matrix.GATEKEEPER_VERSION }}-rego-policy.json
kubectl logs -n gatekeeper-system -l app.kubernetes.io/name=ratify --tail=-1 > logs-ratify-${{ matrix.KUBERNETES_VERSION }}-${{ matrix.GATEKEEPER_VERSION }}-rego-policy.json
- name: Upload artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: ${{ always() }}
with:
name: e2e-logs-${{ inputs.k8s_version }}-${{ inputs.gatekeeper_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/high-availability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
kubectl logs -n gatekeeper-system -l app=ratify --tail=-1 > logs-ratify-preinstall-${{ matrix.DAPR_VERSION }}.json
kubectl logs -n gatekeeper-system -l app.kubernetes.io/name=ratify --tail=-1 > logs-ratify-${{ matrix.DAPR_VERSION }}.json
- name: Upload artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: ${{ always() }}
with:
name: e2e-logs-${{ matrix.DAPR_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quick-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
kubectl logs -n gatekeeper-system -l app=ratify --tail=-1 > logs-ratify-preinstall-${{ matrix.KUBERNETES_VERSION }}-config-policy.json
kubectl logs -n gatekeeper-system -l app.kubernetes.io/name=ratify --tail=-1 > logs-ratify-${{ matrix.KUBERNETES_VERSION }}-config-policy.json
- name: Upload artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: ${{ always() }}
with:
name: e2e-logs-${{ matrix.KUBERNETES_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
$RUNNER_TEMP/sbom-tool generate -b . -bc . -pn ratify -pv $GITHUB_REF_NAME -ps Microsoft -nsb https://microsoft.com -V Verbose

- name: Upload a Build Artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # tag=v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # tag=v4.4.0
with:
name: SBOM SPDX files
path: _manifest/spdx_2.2/**
4 changes: 2 additions & 2 deletions .github/workflows/run-full-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
KUBERNETES_VERSION: ["1.28.7", "1.29.2"]
KUBERNETES_VERSION: ["1.28.12", "1.29.2"]
GATEKEEPER_VERSION: ["3.14.0", "3.15.0", "3.16.0"]
uses: ./.github/workflows/e2e-k8s.yml
with:
Expand All @@ -41,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
KUBERNETES_VERSION: ["1.27.9", "1.29.2"]
KUBERNETES_VERSION: ["1.28.12", "1.29.2"]
GATEKEEPER_VERSION: ["3.14.0", "3.15.0", "3.16.0"]
uses: ./.github/workflows/e2e-aks.yml
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jobs:
publish_results: true

- name: "Upload artifact"
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # tag=v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # tag=v4.4.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # tag=v3.26.5
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # tag=v3.26.6
with:
sarif_file: results.sarif
6 changes: 6 additions & 0 deletions charts/ratify/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- if not (or .Values.notation.enabled .Values.cosign.enabled .Values.sbom.enabled .Values.vulnerabilityreport.enabled) }}
***********************************************************
WARNING: All verifiers are disabled.
It's recommended that at least one is enabled for proper functionality.
***********************************************************
{{- end }}
2 changes: 2 additions & 0 deletions charts/ratify/templates/verifier.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $fullname := include "ratify.fullname" . -}}
{{- if .Values.notation.enabled }}
apiVersion: config.ratify.deislabs.io/v1beta1
kind: Verifier
metadata:
Expand Down Expand Up @@ -37,6 +38,7 @@ spec:
- ca:certs
trustedIdentities:
- "*"
{{- end }}
---
{{- if .Values.cosign.enabled }}
apiVersion: config.ratify.deislabs.io/v1beta1
Expand Down
3 changes: 3 additions & 0 deletions charts/ratify/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ tolerations: []
notationCerts: []
cosignKeys: []

notation:
enabled: true

cosign:
enabled: true
scopes: ["*"] # corresponds to a single trust policy
Expand Down
7 changes: 7 additions & 0 deletions errors/pluginerrors.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,11 @@ var (
Message: "Key vault operation failed",
Description: "Key vault operation failed. Please validate correct key vault configuration is provided or check the error details for further investigation.",
})

// ErrorCodeKeyManagementProviderFailure is returned when a key management provider operation fails.
ErrorCodeKeyManagementProviderFailure = Register("errcode", ErrorDescriptor{
Value: "KEY_MANAGEMENT_PROVIDER_FAILURE",
Message: "Key management provider failure",
Description: "Generic failure in key management provider. Please validate correct key management provider configuration is provided or check the error details for further investigation.",
})
)
12 changes: 12 additions & 0 deletions errors/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,18 @@ func (e Error) GetRemediation() string {
return err.remediation
}

// GetConciseError returns a formatted error message consisting of the error code and reason.
// If the generated error message exceeds the specified maxLength, it truncates the message and appends an ellipsis ("...").
// The function ensures that the returned error message is concise and within the length limit.
func (e Error) GetConciseError(maxLength int) string {
err, _ := e.getRootError()
errMsg := fmt.Sprintf("%s: %s", err.ErrorCode().Descriptor().Value, e.GetErrorReason())
if len(errMsg) > maxLength {
return fmt.Sprintf("%s...", errMsg[:maxLength-3])
}
return errMsg
}

func (e Error) getRootError() (err Error, details []string) {
err = e
for !err.isRootError {
Expand Down
12 changes: 12 additions & 0 deletions errors/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ func TestWithDescription(t *testing.T) {
}
}

func TestGetConciseError(t *testing.T) {
err := testEC.WithDetail("long message, long message, long message")
if err.GetConciseError(30) != "TEST_ERROR_CODE_1: long mes..." {
t.Fatalf("expected: TEST_ERROR_CODE_1: long mes..., got: %s", err.GetConciseError(30))
}

err = testEC.WithDetail("short message")
if err.GetConciseError(100) != "TEST_ERROR_CODE_1: short message" {
t.Fatalf("expected: TEST_ERROR_CODE_1: short message, got: %s", err.GetConciseError(100))
}
}

func TestIs(t *testing.T) {
err := testEC.WithDetail(testDetail1)
result := err.Is(err)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2
github.com/aws/aws-sdk-go-v2 v1.30.4
github.com/aws/aws-sdk-go-v2/config v1.27.30
github.com/aws/aws-sdk-go-v2/credentials v1.17.29
github.com/aws/aws-sdk-go-v2/config v1.27.31
github.com/aws/aws-sdk-go-v2/credentials v1.17.30
github.com/aws/aws-sdk-go-v2/service/ecr v1.28.6
github.com/cespare/xxhash/v2 v2.3.0
github.com/dapr/go-sdk v1.8.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ github.com/aws/aws-sdk-go v1.51.6 h1:Ld36dn9r7P9IjU8WZSaswQ8Y/XUCRpewim5980DwYiU
github.com/aws/aws-sdk-go v1.51.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go-v2 v1.30.4 h1:frhcagrVNrzmT95RJImMHgabt99vkXGslubDaDagTk8=
github.com/aws/aws-sdk-go-v2 v1.30.4/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0=
github.com/aws/aws-sdk-go-v2/config v1.27.30 h1:AQF3/+rOgeJBQP3iI4vojlPib5X6eeOYoa/af7OxAYg=
github.com/aws/aws-sdk-go-v2/config v1.27.30/go.mod h1:yxqvuubha9Vw8stEgNiStO+yZpP68Wm9hLmcm+R/Qk4=
github.com/aws/aws-sdk-go-v2/credentials v1.17.29 h1:CwGsupsXIlAFYuDVHv1nnK0wnxO0wZ/g1L8DSK/xiIw=
github.com/aws/aws-sdk-go-v2/credentials v1.17.29/go.mod h1:BPJ/yXV92ZVq6G8uYvbU0gSl8q94UB63nMT5ctNO38g=
github.com/aws/aws-sdk-go-v2/config v1.27.31 h1:kxBoRsjhT3pq0cKthgj6RU6bXTm/2SgdoUMyrVw0rAI=
github.com/aws/aws-sdk-go-v2/config v1.27.31/go.mod h1:z04nZdSWFPaDwK3DdJOG2r+scLQzMYuJeW0CujEm9FM=
github.com/aws/aws-sdk-go-v2/credentials v1.17.30 h1:aau/oYFtibVovr2rDt8FHlU17BTicFEMAi29V1U+L5Q=
github.com/aws/aws-sdk-go-v2/credentials v1.17.30/go.mod h1:BPJ/yXV92ZVq6G8uYvbU0gSl8q94UB63nMT5ctNO38g=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 h1:yjwoSyDZF8Jth+mUk5lSPJCkMC0lMy6FaCD51jm6ayE=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12/go.mod h1:fuR57fAgMk7ot3WcNQfb6rSEn+SUffl7ri+aa8uKysI=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 h1:TNyt/+X43KJ9IJJMjKfa3bNTiZbUP7DeCxfbTROESwY=
Expand Down
2 changes: 1 addition & 1 deletion internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ package constants
const RatifyPolicy = "ratify-policy"
const EmptyNamespace = ""
const NamespaceSeperator = "/"
const MaxBriefErrLength = 30
const MaxBriefErrLength = 100
32 changes: 15 additions & 17 deletions pkg/controllers/clusterresource/policy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"

configv1beta1 "github.com/ratify-project/ratify/api/v1beta1"
re "github.com/ratify-project/ratify/errors"
"github.com/ratify-project/ratify/internal/constants"
"github.com/ratify-project/ratify/pkg/controllers"
"github.com/ratify-project/ratify/pkg/controllers/utils"
Expand Down Expand Up @@ -63,19 +64,20 @@ func (r *PolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
}

if resource != constants.RatifyPolicy {
errStr := fmt.Sprintf("metadata.name must be ratify-policy, got %s", resource)
policyLogger.Error(errStr)
writePolicyStatus(ctx, r, &policy, policyLogger, false, errStr)
err := re.ErrorCodeConfigInvalid.WithDetail(fmt.Sprintf("metadata.name must be ratify-policy, got %s", resource))
policyLogger.Error(err)
writePolicyStatus(ctx, r, &policy, policyLogger, false, &err)
return ctrl.Result{}, nil
}

if err := policyAddOrReplace(policy.Spec); err != nil {
policyLogger.Error("unable to create policy from policy crd: ", err)
writePolicyStatus(ctx, r, &policy, policyLogger, false, err.Error())
return ctrl.Result{}, err
policyErr := re.ErrorCodePluginInitFailure.WithError(err).WithDetail("Unable to create policy from policy CR")
policyLogger.Error(policyErr)
writePolicyStatus(ctx, r, &policy, policyLogger, false, &policyErr)
return ctrl.Result{}, policyErr
}

writePolicyStatus(ctx, r, &policy, policyLogger, true, "")
writePolicyStatus(ctx, r, &policy, policyLogger, true, nil)
return ctrl.Result{}, nil
}

Expand All @@ -89,18 +91,18 @@ func (r *PolicyReconciler) SetupWithManager(mgr ctrl.Manager) error {
func policyAddOrReplace(spec configv1beta1.PolicySpec) error {
policyEnforcer, err := utils.SpecToPolicyEnforcer(spec.Parameters.Raw, spec.Type)
if err != nil {
return fmt.Errorf("failed to create policy enforcer: %w", err)
return err
}

controllers.NamespacedPolicies.AddPolicy(constants.EmptyNamespace, constants.RatifyPolicy, policyEnforcer)
return nil
}

func writePolicyStatus(ctx context.Context, r client.StatusClient, policy *configv1beta1.Policy, logger *logrus.Entry, isSuccess bool, errString string) {
func writePolicyStatus(ctx context.Context, r client.StatusClient, policy *configv1beta1.Policy, logger *logrus.Entry, isSuccess bool, err *re.Error) {
if isSuccess {
updatePolicySuccessStatus(policy)
} else {
updatePolicyErrorStatus(policy, errString)
updatePolicyErrorStatus(policy, err)
}
if statusErr := r.Status().Update(ctx, policy); statusErr != nil {
logger.Error(statusErr, ", unable to update policy error status")
Expand All @@ -113,12 +115,8 @@ func updatePolicySuccessStatus(policy *configv1beta1.Policy) {
policy.Status.BriefError = ""
}

func updatePolicyErrorStatus(policy *configv1beta1.Policy, errString string) {
briefErr := errString
if len(errString) > constants.MaxBriefErrLength {
briefErr = fmt.Sprintf("%s...", errString[:constants.MaxBriefErrLength])
}
func updatePolicyErrorStatus(policy *configv1beta1.Policy, err *re.Error) {
policy.Status.IsSuccess = false
policy.Status.Error = errString
policy.Status.BriefError = briefErr
policy.Status.Error = err.Error()
policy.Status.BriefError = err.GetConciseError(constants.MaxBriefErrLength)
}
4 changes: 3 additions & 1 deletion pkg/controllers/clusterresource/policy_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"testing"

configv1beta1 "github.com/ratify-project/ratify/api/v1beta1"
re "github.com/ratify-project/ratify/errors"
"github.com/ratify-project/ratify/internal/constants"
"github.com/ratify-project/ratify/pkg/controllers"
"github.com/ratify-project/ratify/pkg/customresources/policies"
Expand Down Expand Up @@ -110,7 +111,8 @@ func TestWritePolicyStatus(t *testing.T) {

for _, tc := range testCases {
t.Run(tc.name, func(_ *testing.T) {
writePolicyStatus(context.Background(), tc.reconciler, tc.policy, logger, tc.isSuccess, tc.errString)
err := re.ErrorCodeUnknown.WithDetail(tc.errString)
writePolicyStatus(context.Background(), tc.reconciler, tc.policy, logger, tc.isSuccess, &err)
})
}
}
Expand Down
21 changes: 10 additions & 11 deletions pkg/controllers/clusterresource/store_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

import (
"context"
"fmt"

apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

configv1beta1 "github.com/ratify-project/ratify/api/v1beta1"
re "github.com/ratify-project/ratify/errors"
"github.com/ratify-project/ratify/internal/constants"
"github.com/ratify-project/ratify/pkg/controllers"
"github.com/ratify-project/ratify/pkg/controllers/utils"
Expand Down Expand Up @@ -65,12 +65,13 @@
}

if err := storeAddOrReplace(store.Spec, resource); err != nil {
storeLogger.Error(err, "unable to create store from store crd")
writeStoreStatus(ctx, r, &store, storeLogger, false, err.Error())
return ctrl.Result{}, err
storeErr := re.ErrorCodeReferrerStoreFailure.WithError(err).WithDetail("Unable to create store from store CR")
storeLogger.Error(err)
writeStoreStatus(ctx, r, &store, storeLogger, false, &storeErr)
return ctrl.Result{}, storeErr
}

writeStoreStatus(ctx, r, &store, storeLogger, true, "")
writeStoreStatus(ctx, r, &store, storeLogger, true, nil)

// returning empty result and no error to indicate we’ve successfully reconciled this object
return ctrl.Result{}, nil
Expand All @@ -87,23 +88,21 @@
func storeAddOrReplace(spec configv1beta1.StoreSpec, fullname string) error {
storeConfig, err := utils.CreateStoreConfig(spec.Parameters.Raw, spec.Name, spec.Source)
if err != nil {
return fmt.Errorf("unable to convert store spec to store config, err: %w", err)
return err

Check warning on line 91 in pkg/controllers/clusterresource/store_controller.go

View check run for this annotation

Codecov / codecov/patch

pkg/controllers/clusterresource/store_controller.go#L91

Added line #L91 was not covered by tests
}

return utils.UpsertStoreMap(spec.Version, spec.Address, fullname, constants.EmptyNamespace, storeConfig)
}

func writeStoreStatus(ctx context.Context, r client.StatusClient, store *configv1beta1.Store, logger *logrus.Entry, isSuccess bool, errorString string) {
func writeStoreStatus(ctx context.Context, r client.StatusClient, store *configv1beta1.Store, logger *logrus.Entry, isSuccess bool, err *re.Error) {
if isSuccess {
store.Status.IsSuccess = true
store.Status.Error = ""
store.Status.BriefError = ""
} else {
store.Status.IsSuccess = false
store.Status.Error = errorString
if len(errorString) > constants.MaxBriefErrLength {
store.Status.BriefError = fmt.Sprintf("%s...", errorString[:constants.MaxBriefErrLength])
}
store.Status.Error = err.Error()
store.Status.BriefError = err.GetConciseError(constants.MaxBriefErrLength)
}

if statusErr := r.Status().Update(ctx, store); statusErr != nil {
Expand Down
Loading
Loading