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

Repo restructure project - Merge helm-locker into local #74

Merged
merged 48 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e31a535
rename example chart to be more specific
mallardduck Sep 9, 2024
8b98ad9
Add helm-locker docs
mallardduck Sep 9, 2024
b9a50bf
Reorg more files for project merge
mallardduck Sep 9, 2024
bc925c2
Add helm-locker charts
mallardduck Sep 9, 2024
9be3772
Adjust CRD reference yaml generation
mallardduck Sep 9, 2024
10028d7
Adjust default entry point to use explicit name
mallardduck Sep 9, 2024
42eff8b
Rename docker file to be specific
mallardduck Sep 9, 2024
78cec10
Rename docker file to better name
mallardduck Sep 9, 2024
4403c88
Adjust scripts to allow targeting other entrypoints
mallardduck Sep 9, 2024
7b9cc34
simplify docker bin target
mallardduck Sep 9, 2024
6b4cdc3
move CRDs for repo merge
mallardduck Sep 9, 2024
bd7c5b9
bring helm-locker code into local repo
mallardduck Sep 9, 2024
5396999
Adjust build target logic on build scripts
mallardduck Sep 10, 2024
d11e570
Move helm-project-operator to new cmd
mallardduck Sep 10, 2024
03f32b4
Add helm-locker local CLI
mallardduck Sep 10, 2024
43bad66
Reorg GHA ci files
mallardduck Sep 10, 2024
e8e9f46
Add helm-locker GHA into local repo
mallardduck Sep 10, 2024
f310e1c
Add go generate step to linter
mallardduck Sep 10, 2024
e89bd93
Add make build chart to lint job
mallardduck Sep 10, 2024
a8cc125
switch from ioutil to io
mallardduck Sep 10, 2024
b99ed1f
Fix linting issues
mallardduck Sep 10, 2024
f660e6d
Adjust ignore/keep for git
mallardduck Sep 10, 2024
dace9d8
Adjust GHA job names for package delineation
mallardduck Sep 10, 2024
5b7dcf0
update go deps files
mallardduck Sep 10, 2024
0c929cc
correct helm-ci target
mallardduck Sep 10, 2024
9086dbd
correct build scripts
mallardduck Sep 10, 2024
e56e833
correct syntax error in GHA workflow
mallardduck Sep 10, 2024
b4531f0
rename step name to be more accurate
mallardduck Sep 10, 2024
39dfd50
Adjust how tests are done to only test target command
mallardduck Sep 10, 2024
3a885f3
update target and script path
mallardduck Sep 10, 2024
b9b2527
Add missing cluster script
mallardduck Sep 10, 2024
a03241f
Bring over tests folder from helm-locker
mallardduck Sep 10, 2024
d7a4d99
Adjust more paths for repo re-org
mallardduck Sep 10, 2024
ad90f02
tweak publish workflows to work on specific tags for now...
mallardduck Sep 11, 2024
582ff22
Adjust style for easier workflow reading
mallardduck Sep 11, 2024
d0616ac
Correct e2e job name
mallardduck Sep 11, 2024
56cf70d
correct last reference to old name
mallardduck Sep 11, 2024
92721ba
fix scirpt job name
mallardduck Sep 11, 2024
3abe679
correct path for delete script
mallardduck Sep 11, 2024
1140ae4
remove duplicate crds file
mallardduck Sep 11, 2024
464f1fd
Merge 2 publish workflows into 1
mallardduck Sep 23, 2024
6d3ae41
Correct job name
mallardduck Sep 23, 2024
a24395e
Update readme docs
mallardduck Sep 23, 2024
43c4e68
Only trigger hl-e2e on push to paths related to helm-locker
mallardduck Sep 23, 2024
6cc146b
Test better image tags
mallardduck Sep 23, 2024
e69ff8e
Adjust rancher version annotations
mallardduck Sep 23, 2024
8f2a52b
update chart maintainer
mallardduck Sep 23, 2024
ec90559
Adjust both charts to use GHCR for images
mallardduck Sep 23, 2024
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
85 changes: 85 additions & 0 deletions crds/crds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: helmreleases.helm.cattle.io
spec:
group: helm.cattle.io
names:
kind: HelmRelease
plural: helmreleases
singular: helmrelease
preserveUnknownFields: false
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.release.name
name: Release Name
type: string
- jsonPath: .spec.release.namespace
name: Release Namespace
type: string
- jsonPath: .status.version
name: Version
type: string
- jsonPath: .status.state
name: State
type: string
name: v1alpha1
schema:
openAPIV3Schema:
properties:
spec:
properties:
release:
properties:
name:
nullable: true
type: string
namespace:
nullable: true
type: string
type: object
type: object
status:
properties:
conditions:
items:
properties:
lastTransitionTime:
nullable: true
type: string
lastUpdateTime:
nullable: true
type: string
message:
nullable: true
type: string
reason:
nullable: true
type: string
status:
nullable: true
type: string
type:
nullable: true
type: string
type: object
nullable: true
type: array
description:
nullable: true
type: string
notes:
nullable: true
type: string
state:
nullable: true
type: string
version:
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}
85 changes: 85 additions & 0 deletions crds/helm-locker/crds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: helmreleases.helm.cattle.io
spec:
group: helm.cattle.io
names:
kind: HelmRelease
plural: helmreleases
singular: helmrelease
preserveUnknownFields: false
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.release.name
name: Release Name
type: string
- jsonPath: .spec.release.namespace
name: Release Namespace
type: string
- jsonPath: .status.version
name: Version
type: string
- jsonPath: .status.state
name: State
type: string
name: v1alpha1
schema:
openAPIV3Schema:
properties:
spec:
properties:
release:
properties:
name:
nullable: true
type: string
namespace:
nullable: true
type: string
type: object
type: object
status:
properties:
conditions:
items:
properties:
lastTransitionTime:
nullable: true
type: string
lastUpdateTime:
nullable: true
type: string
message:
nullable: true
type: string
reason:
nullable: true
type: string
status:
nullable: true
type: string
type:
nullable: true
type: string
type: object
nullable: true
type: array
description:
nullable: true
type: string
notes:
nullable: true
type: string
state:
nullable: true
type: string
version:
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}
4 changes: 4 additions & 0 deletions generate.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//go:generate go run pkg/helm-locker/codegen/cleanup/main.go
//go:generate go run pkg/helm-locker/codegen/main.go
//go:generate go run ./pkg/helm-locker/codegen crds ./crds/helm-locker/crds.yaml

//go:generate go run pkg/codegen/cleanup/main.go
//go:generate go run pkg/codegen/main.go
//go:generate go run ./pkg/codegen crds ./crds/helm-project-operator ./crds/helm-project-operator
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ replace (

require (
github.com/k3s-io/helm-controller v0.13.1
github.com/rancher/helm-locker v0.0.0-20220511204622-3b216418e2f4
github.com/rancher/lasso v0.0.0-20220303220127-8cf5555ec03c
github.com/rancher/wrangler v0.8.11-0.20220217210408-3ecd23dfea3b
github.com/rancher/wrangler-cli v0.0.0-20211112052728-f172e9bf59af
Expand Down
8 changes: 4 additions & 4 deletions pkg/controllers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import (
"github.com/k3s-io/helm-controller/pkg/controllers/chart"
k3shelm "github.com/k3s-io/helm-controller/pkg/generated/controllers/helm.cattle.io"
k3shelmcontroller "github.com/k3s-io/helm-controller/pkg/generated/controllers/helm.cattle.io/v1"
"github.com/rancher/helm-locker/pkg/controllers/release"
helmlocker "github.com/rancher/helm-locker/pkg/generated/controllers/helm.cattle.io"
helmlockercontroller "github.com/rancher/helm-locker/pkg/generated/controllers/helm.cattle.io/v1alpha1"
"github.com/rancher/helm-locker/pkg/objectset"
"github.com/rancher/helm-project-operator/pkg/controllers/common"
"github.com/rancher/helm-project-operator/pkg/controllers/hardened"
"github.com/rancher/helm-project-operator/pkg/controllers/namespace"
"github.com/rancher/helm-project-operator/pkg/controllers/project"
helmproject "github.com/rancher/helm-project-operator/pkg/generated/controllers/helm.cattle.io"
helmprojectcontroller "github.com/rancher/helm-project-operator/pkg/generated/controllers/helm.cattle.io/v1alpha1"
"github.com/rancher/helm-project-operator/pkg/helm-locker/controllers/release"
helmlocker "github.com/rancher/helm-project-operator/pkg/helm-locker/generated/controllers/helm.cattle.io"
helmlockercontroller "github.com/rancher/helm-project-operator/pkg/helm-locker/generated/controllers/helm.cattle.io/v1alpha1"
"github.com/rancher/helm-project-operator/pkg/helm-locker/objectset"
"github.com/rancher/lasso/pkg/cache"
"github.com/rancher/lasso/pkg/client"
"github.com/rancher/lasso/pkg/controller"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/project/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (

"github.com/k3s-io/helm-controller/pkg/controllers/chart"
k3shelmcontroller "github.com/k3s-io/helm-controller/pkg/generated/controllers/helm.cattle.io/v1"
helmlockercontroller "github.com/rancher/helm-locker/pkg/generated/controllers/helm.cattle.io/v1alpha1"
v1alpha1 "github.com/rancher/helm-project-operator/pkg/apis/helm.cattle.io/v1alpha1"
"github.com/rancher/helm-project-operator/pkg/controllers/common"
"github.com/rancher/helm-project-operator/pkg/controllers/namespace"
helmprojectcontroller "github.com/rancher/helm-project-operator/pkg/generated/controllers/helm.cattle.io/v1alpha1"
helmlockercontroller "github.com/rancher/helm-project-operator/pkg/helm-locker/generated/controllers/helm.cattle.io/v1alpha1"
"github.com/rancher/helm-project-operator/pkg/remove"
"github.com/rancher/wrangler/pkg/apply"
corecontroller "github.com/rancher/wrangler/pkg/generated/controllers/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/project/resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"

helmcontrollerv1 "github.com/k3s-io/helm-controller/pkg/apis/helm.cattle.io/v1"
helmlockerv1alpha1 "github.com/rancher/helm-locker/pkg/apis/helm.cattle.io/v1alpha1"
"github.com/rancher/helm-project-operator/pkg/controllers/common"
helmlockerv1alpha1 "github.com/rancher/helm-project-operator/pkg/helm-locker/apis/helm.cattle.io/v1alpha1"
"github.com/rancher/wrangler/pkg/apply"
"github.com/rancher/wrangler/pkg/relatedresource"
"github.com/sirupsen/logrus"
Expand Down
4 changes: 2 additions & 2 deletions pkg/controllers/project/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package project
import (
helmcontrollerv1 "github.com/k3s-io/helm-controller/pkg/apis/helm.cattle.io/v1"
"github.com/k3s-io/helm-controller/pkg/controllers/chart"
helmlockerv1alpha1 "github.com/rancher/helm-locker/pkg/apis/helm.cattle.io/v1alpha1"
"github.com/rancher/helm-locker/pkg/controllers/release"
v1alpha1 "github.com/rancher/helm-project-operator/pkg/apis/helm.cattle.io/v1alpha1"
"github.com/rancher/helm-project-operator/pkg/controllers/common"
helmlockerv1alpha1 "github.com/rancher/helm-project-operator/pkg/helm-locker/apis/helm.cattle.io/v1alpha1"
"github.com/rancher/helm-project-operator/pkg/helm-locker/controllers/release"
v1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/crd/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"sync"

helmcontrollercrd "github.com/k3s-io/helm-controller/pkg/crd"
helmlockercrd "github.com/rancher/helm-locker/pkg/crd"
v1alpha1 "github.com/rancher/helm-project-operator/pkg/apis/helm.cattle.io/v1alpha1"
helmlockercrd "github.com/rancher/helm-project-operator/pkg/helm-locker/crd"
"github.com/rancher/wrangler/pkg/crd"
"github.com/rancher/wrangler/pkg/yaml"
"github.com/sirupsen/logrus"
Expand Down
21 changes: 21 additions & 0 deletions pkg/helm-locker/apis/helm.cattle.io/v1alpha1/doc.go

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soon we'll want to either distribute the files under pkg/helm-locker, or bring the code out into two top level helm-locker and helm-project-operator but in the interest of getting some forward motion, I'm OK with this as-is

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure I understand the context - is this to address the concern about these as go pkgs? I.e. ensuring we properly migrate from: https://pkg.go.dev/github.com/rancher/helm-locker over to an equivalent?

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions pkg/helm-locker/apis/helm.cattle.io/v1alpha1/release.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package v1alpha1

import (
"github.com/rancher/wrangler/pkg/genericcondition"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
// Helm Release Statuses

// SecretNotFoundState is the state when a Helm release secret has not been found for this HelmRelease
SecretNotFoundState = "SecretNotFound"

// UnknownState is the state when the Helm release secret reports that it does not know the state of the underlying Helm release
UnknownState = "Unknown"

// DeployedState is the state where the underlying Helm release has been successfully deployed, indicating Helm Locker should lock the release
DeployedState = "Deployed"

// UninstalledState is the state when the underlying Helm release is uninstalled but the Helm release secret has not been deleted
UninstalledState = "Uninstalled"

// ErrorState is a state where Helm Locker has encountered an unexpected bug on trying to parse the underlying Helm release
ErrorState = "Error"

// FailedState is the state when the underlying Helm release has failed its last Helm operation
FailedState = "Failed"

// TransitioningState is the transitionary state when a Helm operation is being performed on the release (install, upgrade, uninstall)
TransitioningState = "Transitioning"
)

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type HelmRelease struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec HelmReleaseSpec `json:"spec"`
Status HelmReleaseStatus `json:"status"`
}

type HelmReleaseSpec struct {
Release ReleaseKey `json:"release,omitempty"`
}

type ReleaseKey struct {
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
}

type HelmReleaseStatus struct {
State string `json:"state,omitempty"`
Version int `json:"version,omitempty"`
Description string `json:"description,omitempty"`
Notes string `json:"notes,omitempty"`

Conditions []genericcondition.GenericCondition `json:"conditions,omitempty"`
}
Loading