Skip to content

Commit

Permalink
klippy: a controller that auto-instantiates packages
Browse files Browse the repository at this point in the history
This controller will automatically create draft package instances
where the bindings are satisfied.  If the bindings are sufficiently
constraining, this can act as a guided workflow to help users do the
next right thing.
  • Loading branch information
justinsb committed Oct 21, 2022
1 parent 2781133 commit 9287d91
Show file tree
Hide file tree
Showing 9 changed files with 629 additions and 22 deletions.
61 changes: 61 additions & 0 deletions porch/controllers/klippy/config/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: porch-controllers-klippy
rules:
- apiGroups:
- porch.kpt.dev
resources:
- packagerevisionresources
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- porch.kpt.dev
resources:
- packagerevisionresources/status
verbs:
- get
- patch
- update
- apiGroups:
- porch.kpt.dev
resources:
- packagerevisions
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- porch.kpt.dev
resources:
- packagerevisions/status
verbs:
- get
- patch
- update
26 changes: 26 additions & 0 deletions porch/controllers/klippy/config/rbac/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: porch-system:porch-controllers-klippy
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: porch-controllers-klippy
subjects:
- kind: ServiceAccount
name: porch-controllers
namespace: porch-system
17 changes: 17 additions & 0 deletions porch/controllers/klippy/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package klippy

//go:generate go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0 rbac:roleName=porch-controllers-klippy webhook paths="./..." output:rbac:artifacts:config=config/rbac

0 comments on commit 9287d91

Please sign in to comment.