diff --git a/deploy/apko.yaml.tmpl b/deploy/apko.yaml.tmpl index fbfff7e..e20880a 100644 --- a/deploy/apko.yaml.tmpl +++ b/deploy/apko.yaml.tmpl @@ -6,7 +6,7 @@ contents: - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub - ./melange.rsa.pub packages: - - replicated-head # This is expected to be built locally by `melange`. + - replicated # This is expected to be built locally by `melange`. - bash - busybox - curl diff --git a/deploy/melange.yaml.tmpl b/deploy/melange.yaml.tmpl index 7fdbd94..f582393 100644 --- a/deploy/melange.yaml.tmpl +++ b/deploy/melange.yaml.tmpl @@ -1,5 +1,5 @@ package: - name: replicated-head + name: replicated version: ${GIT_TAG} epoch: 0 description: replicated package diff --git a/pkg/meta/latest_custom_metrics.go b/pkg/meta/latest_custom_metrics.go index 55bf8fb..f82bec0 100644 --- a/pkg/meta/latest_custom_metrics.go +++ b/pkg/meta/latest_custom_metrics.go @@ -16,7 +16,7 @@ func SyncCustomAppMetrics(ctx context.Context, clientset kubernetes.Interface, n existing := map[string]interface{}{} err := get(ctx, clientset, namespace, customMetricsSecretKey, &existing) - if err != nil && errors.Cause(err) != ErrReplicatedMetadataSecretNotFound { + if err != nil && errors.Cause(err) != ErrReplicatedMetadataNotFound { return nil, errors.Wrapf(err, "failed to get custom metrics data") } diff --git a/pkg/meta/meta.go b/pkg/meta/meta.go index 2446580..33ab3b6 100644 --- a/pkg/meta/meta.go +++ b/pkg/meta/meta.go @@ -6,6 +6,7 @@ import ( "sync" "github.com/pkg/errors" + "github.com/replicatedhq/replicated-sdk/pkg/logger" "github.com/replicatedhq/replicated-sdk/pkg/util" corev1 "k8s.io/api/core/v1" kuberneteserrors "k8s.io/apimachinery/pkg/api/errors" @@ -90,8 +91,7 @@ func save(ctx context.Context, clientset kubernetes.Interface, namespace string, } var ( - ErrReplicatedMetadataSecretEmpty = errors.New("replicated metadata secret is empty") - ErrReplicatedMetadataSecretNotFound = errors.New("replicated metadata secret not found") + ErrReplicatedMetadataNotFound = errors.New("replicated metadata not found") ) func get(ctx context.Context, clientset kubernetes.Interface, namespace string, key replicatedMetadataSecretKey, v interface{}) error { @@ -101,20 +101,21 @@ func get(ctx context.Context, clientset kubernetes.Interface, namespace string, } if kuberneteserrors.IsNotFound(err) { - return ErrReplicatedMetadataSecretNotFound + return ErrReplicatedMetadataNotFound } if len(secret.Data) == 0 { - return ErrReplicatedMetadataSecretEmpty + return ErrReplicatedMetadataNotFound } dataBytes, ok := secret.Data[string(key)] if !ok || len(dataBytes) == 0 { - return errors.Wrapf(ErrReplicatedMetadataSecretEmpty, "key (%s) not found in secret", key) + return errors.Wrapf(ErrReplicatedMetadataNotFound, "key (%s) not found in secret", key) } if err := json.Unmarshal(dataBytes, v); err != nil { - return errors.Wrapf(err, "failed to unmarshal secret data for key %s", key) + logger.Infof("failed to unmarshal secret data for key %s: %v", key, err) + return ErrReplicatedMetadataNotFound } return nil