forked from openshift/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add commands for rendering and for writing featuregates
- Loading branch information
Showing
25 changed files
with
863 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ _output/ | |
tests/bin/ | ||
|
||
models-schema | ||
/render | ||
/write-available-featuresets |
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,22 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/openshift/api/payload-command/render" | ||
) | ||
|
||
// this command injects the initial FeatureGate.status and places some CRDs to be created by the installer during bootstrapping | ||
// remember that these manifests are not maintained in a running cluster. | ||
func main() { | ||
o := &render.RenderOpts{} | ||
o.AddFlags(flag.CommandLine) | ||
flag.Parse() | ||
|
||
if err := o.Run(); err != nil { | ||
fmt.Fprintf(os.Stderr, "error: %v\n", err) | ||
os.Exit(2) | ||
} | ||
} |
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,22 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/openshift/api/payload-command/render" | ||
) | ||
|
||
// this command writes manifests for each available featureset so that the cluster-config-operator can read them | ||
// in order to maintain the list. | ||
func main() { | ||
o := &render.WriteFeatureSets{} | ||
o.AddFlags(flag.CommandLine) | ||
flag.Parse() | ||
|
||
if err := o.Run(); err != nil { | ||
fmt.Fprintf(os.Stderr, "error: %v\n", err) | ||
os.Exit(2) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
payload-command/empty-resources/0000_05_config-operator_02_apiserver.cr.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,12 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: APIServer | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
# this flag is not set for a cluster coming from 4.5 via upgrade. Hence, 4.5 clusters will keep supporting non-sha256 tokens. | ||
oauth-apiserver.openshift.io/secure-token-storage: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_authentication.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Authentication | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_build.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Build | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_console.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Console | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_dns.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: DNS | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_featuregate.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: FeatureGate | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_image.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Image | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_infrastructure.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Infrastructure | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_ingress.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_network.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Network | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_oauth.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: OAuth | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_project.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Project | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_proxy.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Proxy | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_05_config-operator_02_scheduler.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Scheduler | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
10 changes: 10 additions & 0 deletions
10
payload-command/empty-resources/0000_10_config-operator_02_node.cr.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,10 @@ | ||
apiVersion: config.openshift.io/v1 | ||
kind: Node | ||
metadata: | ||
name: cluster | ||
annotations: | ||
include.release.openshift.io/ibm-cloud-managed: "true" | ||
include.release.openshift.io/self-managed-high-availability: "true" | ||
include.release.openshift.io/single-node-developer: "true" | ||
release.openshift.io/create-only: "true" | ||
spec: {} |
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,30 @@ | ||
package render | ||
|
||
import ( | ||
configv1 "github.com/openshift/api/config/v1" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/runtime/serializer" | ||
utilruntime "k8s.io/apimachinery/pkg/util/runtime" | ||
) | ||
|
||
var ( | ||
configScheme = runtime.NewScheme() | ||
configCodecs = serializer.NewCodecFactory(configScheme) | ||
) | ||
|
||
func init() { | ||
utilruntime.Must(configv1.AddToScheme(configScheme)) | ||
} | ||
|
||
func readFeatureGateV1OrDie(objBytes []byte) *configv1.FeatureGate { | ||
requiredObj, err := runtime.Decode(configCodecs.UniversalDecoder(configv1.SchemeGroupVersion), objBytes) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
return requiredObj.(*configv1.FeatureGate) | ||
} | ||
|
||
func writeFeatureGateV1OrDie(obj *configv1.FeatureGate) string { | ||
return runtime.EncodeOrDie(configCodecs.LegacyCodec(configv1.SchemeGroupVersion), obj) | ||
} |
Oops, something went wrong.