-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update kustomize scaffolding to work with kustomize 2.0
- Loading branch information
1 parent
4228ca5
commit ae6ee76
Showing
8 changed files
with
148 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
Copyright 2019 The Kubernetes Authors. | ||
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 project | ||
|
||
import ( | ||
"path/filepath" | ||
|
||
"sigs.k8s.io/kubebuilder/pkg/scaffold/input" | ||
) | ||
|
||
var _ input.File = &KustomizeManager{} | ||
|
||
// KustomizeManager scaffolds the Kustomization file in manager folder. | ||
type KustomizeManager struct { | ||
input.Input | ||
} | ||
|
||
// GetInput implements input.File | ||
func (c *KustomizeManager) GetInput() (input.Input, error) { | ||
if c.Path == "" { | ||
c.Path = filepath.Join("config", "manager", "kustomization.yaml") | ||
} | ||
c.TemplateBody = kustomizeManagerTemplate | ||
c.Input.IfExistsAction = input.Error | ||
return c.Input, nil | ||
} | ||
|
||
var kustomizeManagerTemplate = `resources: | ||
- manager.yaml | ||
` |
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,51 @@ | ||
/* | ||
Copyright 2019 The Kubernetes Authors. | ||
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 project | ||
|
||
import ( | ||
"path/filepath" | ||
|
||
"sigs.k8s.io/kubebuilder/pkg/scaffold/input" | ||
) | ||
|
||
var _ input.File = &KustomizeRBAC{} | ||
|
||
// KustomizeRBAC scaffolds the Kustomization file in rbac folder. | ||
type KustomizeRBAC struct { | ||
input.Input | ||
} | ||
|
||
// GetInput implements input.File | ||
func (c *KustomizeRBAC) GetInput() (input.Input, error) { | ||
if c.Path == "" { | ||
c.Path = filepath.Join("config", "rbac", "kustomization.yaml") | ||
} | ||
c.TemplateBody = kustomizeRBACTemplate | ||
c.Input.IfExistsAction = input.Error | ||
return c.Input, nil | ||
} | ||
|
||
var kustomizeRBACTemplate = `resources: | ||
- rbac_role.yaml | ||
- rbac_role_binding.yaml | ||
# Comment the following 3 lines if you want to disable | ||
# the auth proxy (https://github.com/brancz/kube-rbac-proxy) | ||
# which protects your /metrics endpoint. | ||
- auth_proxy_service.yaml | ||
- auth_proxy_role.yaml | ||
- auth_proxy_role_binding.yaml | ||
` |
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,2 @@ | ||
resources: | ||
- manager.yaml |
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,9 @@ | ||
resources: | ||
- rbac_role.yaml | ||
- rbac_role_binding.yaml | ||
# Comment the following 3 lines if you want to disable | ||
# the auth proxy (https://github.com/brancz/kube-rbac-proxy) | ||
# which protects your /metrics endpoint. | ||
- auth_proxy_service.yaml | ||
- auth_proxy_role.yaml | ||
- auth_proxy_role_binding.yaml |