Various small changes

* newline fixes
* source-controller v0.0.2 -> v0.0.3
* pkg v0.0.2 -> v0.0.3
* const for HelmRelease kind
* wording change in README
* lockfile error message fix
This commit is contained in:
Hidde Beydals 2020-07-09 18:04:45 +02:00
parent 6eb9822327
commit 6bded34a1b
8 changed files with 15 additions and 13 deletions

View File

@ -23,5 +23,5 @@ Features:
* fetches artifacts produced by [source-controller](https://github.com/fluxcd/source-controller)
from `Source` objects
* watches `Source` objects for revision changes
* performs Helm actions as configured in the object
* performs Helm actions as configured in the `HelmRelease`
* runs `HelmReleases` in a specific order, taking into account the depends-on relationship

View File

@ -26,6 +26,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const HelmReleaseKind = "HelmRelease"
// HelmReleaseSpec defines the desired state of HelmRelease.
type HelmReleaseSpec struct {
// SourceRef of the HelmChart source.

View File

@ -49,4 +49,4 @@ spec:
mountPath: /tmp
volumes:
- name: temp
emptyDir: {}
emptyDir: {}

View File

@ -5,4 +5,4 @@ resources:
images:
- name: fluxcd/helm-controller
newName: fluxcd/helm-controller
newTag: v0.0.1-alpha.1
newTag: v0.0.1-alpha.1

View File

@ -29,7 +29,6 @@ import (
"strings"
"time"
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
"github.com/go-logr/logr"
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/chart"
@ -46,6 +45,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/controller"
"github.com/fluxcd/pkg/lockedfile"
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
v2 "github.com/fluxcd/helm-controller/api/v2alpha1"
)
@ -166,7 +166,7 @@ func (r *HelmReleaseReconciler) release(log logr.Logger, hr v2.HelmRelease, sour
// Acquire lock
unlock, err := lock(fmt.Sprintf("%s-%s", hr.GetName(), hr.GetNamespace()))
if err != nil {
err = fmt.Errorf("tmp dir error: %w", err)
err = fmt.Errorf("lockfile error: %w", err)
return v2.HelmReleaseNotReady(hr, hr.Status.LastAttemptedRevision, hr.Status.LastReleaseRevision, sourcev1.StorageOperationFailedReason, err.Error()), err
}
defer unlock()

4
go.mod
View File

@ -3,8 +3,8 @@ module github.com/fluxcd/helm-controller
go 1.13
require (
github.com/fluxcd/pkg v0.0.2
github.com/fluxcd/source-controller v0.0.2
github.com/fluxcd/pkg v0.0.3
github.com/fluxcd/source-controller v0.0.3
github.com/go-logr/logr v0.1.0
github.com/onsi/ginkgo v1.11.0
github.com/onsi/gomega v1.8.1

8
go.sum
View File

@ -164,10 +164,10 @@ github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZM
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fluxcd/pkg v0.0.2 h1:e2ekyxBNZg0phh3adSxCsaGcozGyy/FQwhD2LtA+Y0Q=
github.com/fluxcd/pkg v0.0.2/go.mod h1:rtlppQU+9DNikyDZptLdOeTf+wBvQQiQQ/J113FPoeU=
github.com/fluxcd/source-controller v0.0.2 h1:nLGQul2v7zktIV3R/f7GYSLrwYuokPf4ThzSgLfiVlE=
github.com/fluxcd/source-controller v0.0.2/go.mod h1:imUfOckTJBn3L0Xcc5RsZeuM+OkQdSkVr6O1qF1BLzA=
github.com/fluxcd/pkg v0.0.3 h1:yhjtpGtD9LxFo8JtwTuUxJyFcX2wSSb0TPptIEpGSmA=
github.com/fluxcd/pkg v0.0.3/go.mod h1:rtlppQU+9DNikyDZptLdOeTf+wBvQQiQQ/J113FPoeU=
github.com/fluxcd/source-controller v0.0.3 h1:CRk89b7+VPNcouqBdY6UHylMSn8dQEYSciqeci/T25A=
github.com/fluxcd/source-controller v0.0.3/go.mod h1:JQYoE8RuiUaQotUo5N/6l6YOp16EuSzZ8fV0r0ulv2Q=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=

View File

@ -89,13 +89,13 @@ func main() {
if err = (&controllers.HelmReleaseReconciler{
Client: mgr.GetClient(),
Config: mgr.GetConfig(),
Log: ctrl.Log.WithName("controllers").WithName("HelmRelease"),
Log: ctrl.Log.WithName("controllers").WithName(helmv2alpha1.HelmReleaseKind),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr, controllers.HelmReleaseReconcilerOptions{
MaxConcurrentReconciles: concurrent,
DependencyRequeueInterval: requeueDependency,
}); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "HelmRelease")
setupLog.Error(err, "unable to create controller", "controller", helmv2alpha1.HelmReleaseKind)
os.Exit(1)
}
// +kubebuilder:scaffold:builder