Skip to content

Commit

Permalink
chore: repairing issues with helm
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
  • Loading branch information
AlexsJones committed Apr 24, 2023
1 parent c02efec commit 1ad2b42
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ release-manifests: manifests kustomize
mkdir -p chart/k8sgpt-operator/templates/
$(KUSTOMIZE) build config/default > chart/k8sgpt-operator/templates/rendered.yaml

helm-package: generate release-manifests helm
helm-package: generate manifests release-manifests helm
$(HELM) package --version $(CHART_VERSION) chart/k8sgpt-operator
mkdir -p charts && mv k8sgpt-operator-*.tgz charts
$(HELM) repo index --url https://charts.k8sgpt.ai/charts charts
Expand Down
Binary file removed charts/k8sgpt-operator-v0.0.1.tgz
Binary file not shown.
Binary file modified charts/k8sgpt-operator-v0.0.2.tgz
Binary file not shown.
12 changes: 12 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- core.k8sgpt.ai
resources:
Expand Down
20 changes: 6 additions & 14 deletions controllers/k8sgpt_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,12 @@ type K8sGPTReconciler struct {
K8sGPTClient *k8sgptclient.Client
}

//+kubebuilder:rbac:groups=core.k8sgpt.ai,resources=k8sgpts,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=core.k8sgpt.ai,resources=k8sgpts/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=core.k8sgpt.ai,resources=k8sgpts/finalizers,verbs=update
//+kubebuilder:rbac:groups=core.k8sgpt.ai,resources=results,verbs=get;list;watch;create;update;patch;delete

// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
// TODO(user): Modify the Reconcile function to compare the state specified by
// the K8sGPT object against the actual cluster state, and then
// perform operations to make the cluster state reflect the state specified by
// the user.
//
// For more details, check Reconcile and its Result here:
// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
// +kubebuilder:rbac:groups=core.k8sgpt.ai,resources=k8sgpts,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=core.k8sgpt.ai,resources=k8sgpts/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=core.k8sgpt.ai,resources=k8sgpts/finalizers,verbs=update
// +kubebuilder:rbac:groups=core.k8sgpt.ai,resources=results,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups="*",resources="*",verbs=get;list;watch;create;update;patch;delete

func (r *K8sGPTReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)

Expand Down
16 changes: 3 additions & 13 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,12 @@ entries:
k8sgpt-operator:
- apiVersion: v2
appVersion: 0.2.4
created: "2023-04-24T16:59:16.394523+02:00"
created: "2023-04-24T19:52:01.766171+02:00"
description: A Helm chart for Kubernetes
digest: 88b31be7ae4f21fcaac035d3b5863d6e31bf27f37bac3928ff6d3a725a0a4c5e
digest: 08edae95594e17a464d79f39d0d011d93f38e6583f343228b819b62ac234d7b5
name: k8sgpt-operator
type: application
urls:
- https://charts.k8sgpt.ai/charts/k8sgpt-operator-v0.0.2.tgz
version: v0.0.2
- apiVersion: v2
appVersion: 1.16.0
created: "2023-04-24T16:59:16.394404+02:00"
description: A Helm chart for Kubernetes
digest: d155c7db368f5a0ec2c9b841a78ba6ae7c3a4361860d9b68658c86d564f4d258
name: k8sgpt-operator
type: application
urls:
- https://charts.k8sgpt.ai/charts/k8sgpt-operator-v0.0.1.tgz
version: v0.0.1
generated: "2023-04-24T16:59:16.394012+02:00"
generated: "2023-04-24T19:52:01.765797+02:00"
7 changes: 4 additions & 3 deletions pkg/resources/k8sgpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func GetClusterRole(config v1alpha1.K8sGPT) (*r1.ClusterRole, error) {
{
APIGroups: []string{"*"},
Resources: []string{"*"},
Verbs: []string{"*"},
Verbs: []string{"list", "get", "watch"},
},
},
}
Expand Down Expand Up @@ -170,8 +170,9 @@ func GetDeployment(config v1alpha1.K8sGPT) (*appsv1.Deployment, error) {
ServiceAccountName: "k8sgpt",
Containers: []v1.Container{
{
Name: "k8sgpt",
Image: "ghcr.io/k8sgpt-ai/k8sgpt-operator:" + config.Spec.Version,
Name: "k8sgpt",
ImagePullPolicy: v1.PullAlways,
Image: "ghcr.io/k8sgpt-ai/k8sgpt:" + config.Spec.Version,
Args: []string{
"serve",
},
Expand Down

0 comments on commit 1ad2b42

Please sign in to comment.