Skip to content

Commit

Permalink
Merge pull request openshift#53 from deads2k/sscs-04-operator-2
Browse files Browse the repository at this point in the history
 fix up operator types for clarity
  • Loading branch information
deads2k authored May 23, 2018
2 parents 5214a21 + cc20304 commit 813808a
Show file tree
Hide file tree
Showing 11 changed files with 1,236 additions and 244 deletions.
651 changes: 577 additions & 74 deletions operator/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions operator/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions operator/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ var (
func addKnownTypes(scheme *runtime.Scheme) error {
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)

scheme.AddKnownTypes(SchemeGroupVersion,
&GenericOperatorConfig{},
)

return nil
}
32 changes: 32 additions & 0 deletions operator/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

configv1 "github.com/openshift/api/config/v1"
)

type ManagementState string
Expand Down Expand Up @@ -109,3 +111,33 @@ type OperatorStatus struct {
// targetVersionAvailability is availability information for the target version if we are migrating
TargetAvailability *VersionAvailablity `json:"targetVersionAvailability,omitempty" protobuf:"bytes,6,opt,name=targetVersionAvailability"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// GenericOperatorConfig provides information to configure an operator
type GenericOperatorConfig struct {
metav1.TypeMeta `json:",inline"`

// ServingInfo is the HTTP serving information for the controller's endpoints
ServingInfo configv1.HTTPServingInfo `json:"servingInfo,omitempty" protobuf:"bytes,1,opt,name=servingInfo"`

// leaderElection provides information to elect a leader. Only override this if you have a specific need
LeaderElection configv1.LeaderElection `json:"leaderElection,omitempty" protobuf:"bytes,2,opt,name=leaderElection"`

// authentication allows configuration of authentication for the endpoints
Authentication DelegatedAuthentication `json:"authentication,omitempty" protobuf:"bytes,3,opt,name=authentication"`
// authorization allows configuration of authentication for the endpoints
Authorization DelegatedAuthorization `json:"authorization,omitempty" protobuf:"bytes,4,opt,name=authorization"`
}

// DelegatedAuthentication allows authentication to be disabled.
type DelegatedAuthentication struct {
// disabled indicates that authentication should be disabled. By default it will use delegated authentication.
Disabled bool `json:"disabled,omitempty" protobuf:"varint,1,opt,name=disabled"`
}

// DelegatedAuthorization allows authorization to be disabled.
type DelegatedAuthorization struct {
// disabled indicates that authorization should be disabled. By default it will use delegated authorization.
Disabled bool `json:"disabled,omitempty" protobuf:"varint,1,opt,name=disabled"`
}
30 changes: 30 additions & 0 deletions operator/v1alpha1/types_swagger_doc_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ package v1alpha1
// Those methods can be generated by using hack/update-generated-swagger-docs.sh

// AUTO-GENERATED FUNCTIONS START HERE
var map_DelegatedAuthentication = map[string]string{
"": "DelegatedAuthentication allows authentication to be disabled.",
"disabled": "disabled indicates that authentication should be disabled. By default it will use delegated authentication.",
}

func (DelegatedAuthentication) SwaggerDoc() map[string]string {
return map_DelegatedAuthentication
}

var map_DelegatedAuthorization = map[string]string{
"": "DelegatedAuthorization allows authorization to be disabled.",
"disabled": "disabled indicates that authorization should be disabled. By default it will use delegated authorization.",
}

func (DelegatedAuthorization) SwaggerDoc() map[string]string {
return map_DelegatedAuthorization
}

var map_GenerationHistory = map[string]string{
"": "GenerationHistory keeps track of the generation for a given resource so that decisions about forced updated can be made.",
"group": "group is the group of the thing you're tracking",
Expand All @@ -24,6 +42,18 @@ func (GenerationHistory) SwaggerDoc() map[string]string {
return map_GenerationHistory
}

var map_GenericOperatorConfig = map[string]string{
"": "GenericOperatorConfig provides information to configure an operator",
"servingInfo": "ServingInfo is the HTTP serving information for the controller's endpoints",
"leaderElection": "leaderElection provides information to elect a leader. Only override this if you have a specific need",
"authentication": "authentication allows configuration of authentication for the endpoints",
"authorization": "authorization allows configuration of authentication for the endpoints",
}

func (GenericOperatorConfig) SwaggerDoc() map[string]string {
return map_GenericOperatorConfig
}

var map_LoggingConfig = map[string]string{
"": "LoggingConfig holds information about configuring logging",
"level": "level is passed to glog.",
Expand Down
65 changes: 65 additions & 0 deletions operator/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 813808a

Please sign in to comment.