Skip to content

Commit

Permalink
Merge pull request #70 from awels/revert-boolean-b
Browse files Browse the repository at this point in the history
Revert boolean change
  • Loading branch information
awels committed Apr 22, 2020
2 parents 7d61e99 + 913405e commit c8e6838
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
48 changes: 29 additions & 19 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,36 +220,40 @@ roleRef:
scope: Cluster
validation:
openAPIV3Schema:
description: Represents a HostPathProvisioner deployment
description: HostPathProvisioner is the Schema for the hostpathprovisioners
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: HostPathProvisionerSpec defines the desired state of HostPathProvisioner
properties:
imagePullPolicy:
type: string
imageTag:
type: string
enum:
- Always
- IfNotPresent
- Never
imageRegistry:
description: PullPolicy describes a policy for if/when to pull a container
image
type: string
pathConfig:
description: describes the location and layout of PV storage on nodes
description: PathConfig describes the location and layout of PV storage
on nodes
properties:
path:
description: The provisioner will store PVs at this location on each node
description: Path The path the directories for the PVs are created
under
type: string
useNamingPrefix:
description: Indicates whether the name of the requesting PVC is included in the directory name when dynamically provisioning a PV
type: boolean
description: UseNamingPrefix Use the name of the PVC requesting
the PV as part of the directory created
type: string
type: object
required:
- pathConfig
Expand All @@ -258,9 +262,11 @@ roleRef:
description: HostPathProvisionerStatus defines the observed state of HostPathProvisioner
properties:
conditions:
description: Conditions contains the current conditions observed by the operator
description: Conditions contains the current conditions observed by
the operator
items:
description: Condition represents the state of the operator's reconciliation functionality.
description: Condition represents the state of the operator's reconciliation
functionality.
properties:
lastHeartbeatTime:
format: date-time
Expand All @@ -275,21 +281,25 @@ roleRef:
status:
type: string
type:
description: ConditionType is the state of the operator's reconciliation functionality.
description: ConditionType is the state of the operator's reconciliation
functionality.
type: string
required:
- status
- type
type: object
type: array
observedVersion:
description: The observed version of the HostPathProvisioner deployment
description: ObservedVersion The observed version of the HostPathProvisioner
deployment
type: string
operatorVersion:
description: The version of the HostPathProvisioner Operator
description: OperatorVersion The version of the HostPathProvisioner
Operator
type: string
targetVersion:
description: The targeted version of the HostPathProvisioner deployment
description: TargetVersion The targeted version of the HostPathProvisioner
deployment
type: string
type: object
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type PathConfig struct {
// Path The path the directories for the PVs are created under
Path string `json:"path,omitempty" valid:"required"`
// UseNamingPrefix Use the name of the PVC requesting the PV as part of the directory created
UseNamingPrefix bool `json:"useNamingPrefix,omitempty"`
UseNamingPrefix string `json:"useNamingPrefix,omitempty"`
}

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func schema_pkg_apis_hostpathprovisioner_v1alpha1_PathConfig(ref common.Referenc
"useNamingPrefix": {
SchemaProps: spec.SchemaProps{
Description: "UseNamingPrefix Use the name of the PVC requesting the PV as part of the directory created",
Type: []string{"boolean"},
Type: []string{"string"},
Format: "",
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/hostpathprovisioner/contoller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var _ = Describe("Controller reconcile loop", func() {
ImagePullPolicy: corev1.PullAlways,
PathConfig: v1alpha1.PathConfig{
Path: "/tmp/test",
UseNamingPrefix: false,
UseNamingPrefix: "false",
},
},
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/hostpathprovisioner/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"os"
"reflect"
"strconv"

"github.com/go-logr/logr"
appsv1 "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -138,7 +137,7 @@ func createDaemonSetObject(cr *hostpathprovisionerv1alpha1.HostPathProvisioner,
Env: []corev1.EnvVar{
{
Name: "USE_NAMING_PREFIX",
Value: strconv.FormatBool(cr.Spec.PathConfig.UseNamingPrefix),
Value: cr.Spec.PathConfig.UseNamingPrefix,
},
{
Name: "NODE_NAME",
Expand Down

0 comments on commit c8e6838

Please sign in to comment.