-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helm: use chunking release driver in systemNamespace
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
- Loading branch information
1 parent
ff0ce68
commit bebe28c
Showing
10 changed files
with
287 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,104 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: argocd | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: argocd-installer | ||
namespace: argocd | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: argocd-installer-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: argocd-installer-clusterrole | ||
subjects: | ||
- kind: ServiceAccount | ||
name: argocd-installer | ||
namespace: argocd | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: argocd-installer-clusterrole | ||
rules: | ||
- apiGroups: ["*"] | ||
resources: ["*"] | ||
verbs: ["*"] | ||
- apiGroups: [apiextensions.k8s.io] | ||
resources: [customresourcedefinitions] | ||
verbs: [get, list, watch, create, update, patch, delete] | ||
resourceNames: | ||
- appprojects.argoproj.io | ||
- argocds.argoproj.io | ||
- applications.argoproj.io | ||
- argocdexports.argoproj.io | ||
- applicationsets.argoproj.io | ||
- apiGroups: [rbac.authorization.k8s.io] | ||
resources: [clusterroles] | ||
verbs: [get, list, watch, create, update, patch, delete] | ||
resourceNames: | ||
- argocd-operator.v0-1dhiybrldl1gyksid1dk2dqjsc72psdybc7iyvse5gpx | ||
- argocd-operator-metrics-reader | ||
- argocd-operator.v0-22gmilmgp91wu25is5i2ec598hni8owq3l71bbkl7iz3 | ||
- apiGroups: [rbac.authorization.k8s.io] | ||
resources: [clusterrolebindings] | ||
verbs: [get, list, watch, create, update, patch, delete] | ||
resourceNames: | ||
- argocd-operator.v0-1dhiybrldl1gyksid1dk2dqjsc72psdybc7iyvse5gpx | ||
- argocd-operator.v0-22gmilmgp91wu25is5i2ec598hni8owq3l71bbkl7iz3 | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: argocd-installer-role | ||
namespace: argocd | ||
rules: | ||
- apiGroups: [""] | ||
resources: [serviceaccounts] | ||
verbs: [get, list, watch, create, update, patch, delete] | ||
resourceNames: [argocd-operator-controller-manager] | ||
- apiGroups: [""] | ||
resources: [configmaps] | ||
verbs: [get, list, watch, create, update, patch, delete] | ||
resourceNames: [argocd-operator-manager-config] | ||
- apiGroups: [""] | ||
resources: [services] | ||
verbs: [get, list, watch, create, update, patch, delete] | ||
resourceNames: [argocd-operator-controller-manager-metrics-service] | ||
- apiGroups: [apps] | ||
resources: [deployments] | ||
verbs: [get, list, watch, create, update, patch, delete] | ||
resourceNames: [argocd-operator-controller-manager] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: argocd-installer-binding | ||
namespace: argocd | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: argocd-installer-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: argocd-installer | ||
namespace: argocd | ||
--- | ||
apiVersion: olm.operatorframework.io/v1alpha1 | ||
kind: ClusterExtension | ||
metadata: | ||
name: clusterextension-sample | ||
name: argocd | ||
spec: | ||
installNamespace: default | ||
installNamespace: argocd | ||
packageName: argocd-operator | ||
version: 0.6.0 | ||
serviceAccount: | ||
name: default | ||
name: argocd-installer | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package action | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
|
||
"k8s.io/apimachinery/pkg/types" | ||
"k8s.io/client-go/rest" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
|
||
ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1" | ||
"github.com/operator-framework/operator-controller/internal/authentication" | ||
) | ||
|
||
func ServiceAccountRestConfigMapper(tokenGetter *authentication.TokenGetter) func(ctx context.Context, o client.Object, c *rest.Config) (*rest.Config, error) { | ||
return func(ctx context.Context, o client.Object, c *rest.Config) (*rest.Config, error) { | ||
cExt := o.(*ocv1alpha1.ClusterExtension) | ||
saKey := types.NamespacedName{ | ||
Name: cExt.Spec.ServiceAccount.Name, | ||
Namespace: cExt.Spec.InstallNamespace, | ||
} | ||
saConfig := rest.AnonymousClientConfig(c) | ||
saConfig.Wrap(func(rt http.RoundTripper) http.RoundTripper { | ||
return &authentication.TokenInjectingRoundTripper{ | ||
Tripper: rt, | ||
TokenGetter: tokenGetter, | ||
Key: saKey, | ||
} | ||
}) | ||
return saConfig, nil | ||
} | ||
} |
Oops, something went wrong.