Skip to content

Commit a826847

Browse files
committed
Rename deploy-type arg to deployer to align with other arg names
1 parent 20551ca commit a826847

File tree

20 files changed

+96
-96
lines changed

20 files changed

+96
-96
lines changed

cmd/deploy.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ EXAMPLES
131131
PreRunE: bindEnv("build", "build-timestamp", "builder", "builder-image",
132132
"base-image", "confirm", "domain", "env", "git-branch", "git-dir",
133133
"git-url", "image", "namespace", "path", "platform", "push", "pvc-size",
134-
"service-account", "deploy-type", "registry", "registry-insecure", "remote",
134+
"service-account", "deployer", "registry", "registry-insecure", "remote",
135135
"username", "password", "token", "verbose", "remote-storage-class"),
136136
RunE: func(cmd *cobra.Command, args []string) error {
137137
return runDeploy(cmd, newClient)
@@ -192,7 +192,7 @@ EXAMPLES
192192
"When triggering a remote deployment, set a custom volume size to allocate for the build operation ($FUNC_PVC_SIZE)")
193193
cmd.Flags().String("service-account", f.Deploy.ServiceAccountName,
194194
"Service account to be used in the deployed function ($FUNC_SERVICE_ACCOUNT)")
195-
cmd.Flags().String("deploy-type", f.Deploy.DeployType,
195+
cmd.Flags().String("deployer", f.Deploy.Deployer,
196196
fmt.Sprintf("Type of deployment to use: '%s' for Knative Service (default) or '%s' for Kubernetes Deployment ($FUNC_DEPLOY_TYPE)", knative.KnativeDeployerName, k8s.KubernetesDeployerName))
197197
// Static Flags:
198198
// Options which have static defaults only (not globally configurable nor
@@ -567,8 +567,8 @@ type deployConfig struct {
567567
//Service account to be used in deployed function
568568
ServiceAccountName string
569569

570-
// DeployType specifies the type of deployment: "knative" or "deployment"
571-
DeployType string
570+
// Deployer specifies the type of deployment: "knative" or "raw"
571+
Deployer string
572572

573573
// Remote indicates the deployment (and possibly build) process are to
574574
// be triggered in a remote environment rather than run locally.
@@ -603,7 +603,7 @@ func newDeployConfig(cmd *cobra.Command) deployConfig {
603603
PVCSize: viper.GetString("pvc-size"),
604604
Timestamp: viper.GetBool("build-timestamp"),
605605
ServiceAccountName: viper.GetString("service-account"),
606-
DeployType: viper.GetString("deploy-type"),
606+
Deployer: viper.GetString("deployer"),
607607
}
608608
// NOTE: .Env should be viper.GetStringSlice, but this returns unparsed
609609
// results and appears to be an open issue since 2017:
@@ -638,7 +638,7 @@ func (c deployConfig) Configure(f fn.Function) (fn.Function, error) {
638638
f.Build.Git.Revision = c.GitBranch // TODO: should match; perhaps "refSpec"
639639
f.Build.RemoteStorageClass = c.RemoteStorageClass
640640
f.Deploy.ServiceAccountName = c.ServiceAccountName
641-
f.Deploy.DeployType = c.DeployType
641+
f.Deploy.Deployer = c.Deployer
642642
f.Local.Remote = c.Remote
643643

644644
// PVCSize
@@ -805,18 +805,18 @@ func (c deployConfig) clientOptions() ([]fn.Option, error) {
805805
}
806806

807807
// Add the appropriate deployer based on deploy type
808-
deployType := c.DeployType
809-
if deployType == "" {
810-
deployType = knative.KnativeDeployerName // default to knative for backwards compatibility
808+
deployer := c.Deployer
809+
if deployer == "" {
810+
deployer = knative.KnativeDeployerName // default to knative for backwards compatibility
811811
}
812812

813-
switch deployType {
813+
switch deployer {
814814
case knative.KnativeDeployerName:
815815
o = append(o, fn.WithDeployer(newKnativeDeployer(c.Verbose)))
816816
case k8s.KubernetesDeployerName:
817817
o = append(o, fn.WithDeployer(newK8sDeployer(c.Verbose)))
818818
default:
819-
return o, fmt.Errorf("unsupported deploy type: %s (supported: %s, %s)", deployType, knative.KnativeDeployerName, k8s.KubernetesDeployerName)
819+
return o, fmt.Errorf("unsupported deploy type: %s (supported: %s, %s)", deployer, knative.KnativeDeployerName, k8s.KubernetesDeployerName)
820820
}
821821

822822
return o, nil

cmd/describe.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ func (i info) Human(w io.Writer) error {
153153
fmt.Fprintf(w, " %v\n", route)
154154
}
155155

156-
fmt.Fprintln(w, "Deploy-Type:")
157-
fmt.Fprintf(w, " %v\n", i.DeployType)
156+
fmt.Fprintln(w, "Deployer:")
157+
fmt.Fprintf(w, " %v\n", i.Deployer)
158158

159159
if len(i.Subscriptions) > 0 {
160160
fmt.Fprintln(w, "Subscriptions (Source, Type, Broker):")
@@ -181,7 +181,7 @@ func (i info) Plain(w io.Writer) error {
181181
fmt.Fprintf(w, "Route %v\n", route)
182182
}
183183

184-
fmt.Fprintf(w, "Deploy-Type %v\n", i.DeployType)
184+
fmt.Fprintf(w, "Deployer %v\n", i.Deployer)
185185

186186
if len(i.Subscriptions) > 0 {
187187
for _, s := range i.Subscriptions {

cmd/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ func (items listItems) Plain(w io.Writer) error {
187187
tabWriter := tabwriter.NewWriter(w, 0, 8, 2, ' ', 0)
188188
defer tabWriter.Flush()
189189

190-
fmt.Fprintf(tabWriter, "%s\t%s\t%s\t%s\t%s\t%s\n", "NAME", "NAMESPACE", "RUNTIME", "DEPLOY-TYPE", "URL", "READY")
190+
fmt.Fprintf(tabWriter, "%s\t%s\t%s\t%s\t%s\t%s\n", "NAME", "NAMESPACE", "RUNTIME", "DEPLOYER", "URL", "READY")
191191
for _, item := range items {
192-
fmt.Fprintf(tabWriter, "%s\t%s\t%s\t%s\t%s\t%s\n", item.Name, item.Namespace, item.Runtime, item.DeployType, item.URL, item.Ready)
192+
fmt.Fprintf(tabWriter, "%s\t%s\t%s\t%s\t%s\t%s\n", item.Name, item.Namespace, item.Runtime, item.Deployer, item.URL, item.Ready)
193193
}
194194
return nil
195195
}

docs/reference/func_deploy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func deploy
119119
-b, --builder string Builder to use when creating the function's container. Currently supported builders are "host", "pack" and "s2i". (default "pack")
120120
--builder-image string Specify a custom builder image for use by the builder other than its default. ($FUNC_BUILDER_IMAGE)
121121
-c, --confirm Prompt to confirm options interactively ($FUNC_CONFIRM)
122-
--deploy-type string Type of deployment to use: 'knative' for Knative Service (default) or 'raw' for Kubernetes Deployment ($FUNC_DEPLOY_TYPE)
122+
--deployer string Type of deployment to use: 'knative' for Knative Service (default) or 'raw' for Kubernetes Deployment ($FUNC_DEPLOY_TYPE)
123123
--domain string Domain to use for the function's route. Cluster must be configured with domain matching for the given domain (ignored if unrecognized) ($FUNC_DOMAIN)
124124
-e, --env stringArray Environment variable to set in the form NAME=VALUE. You may provide this flag multiple times for setting multiple environment variables. To unset, specify the environment variable name followed by a "-" (e.g., NAME-).
125125
-t, --git-branch string Git revision (branch) to be used when deploying via the Git repository ($FUNC_GIT_BRANCH)

hack/component-versions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"Contour": {
3-
"version": "v1.19.6",
3+
"version": "v1.20.0",
44
"owner": "knative-extensions",
55
"repo": "net-contour"
66
},
77
"Eventing": {
8-
"version": "v1.19.7",
8+
"version": "v1.20.0",
99
"owner": "knative",
1010
"repo": "eventing"
1111
},
@@ -16,7 +16,7 @@
1616
"version": "v0.35.2"
1717
},
1818
"Serving": {
19-
"version": "v1.19.7",
19+
"version": "v1.20.0",
2020
"owner": "knative",
2121
"repo": "serving"
2222
},

hack/component-versions.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ set_versions() {
1111
kind_node_version=v1.32.0@sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027
1212

1313
# find source-of-truth in component-versions.json to add/modify components
14-
knative_serving_version="v1.19.7"
15-
knative_eventing_version="v1.19.7"
16-
contour_version="v1.19.6"
14+
knative_serving_version="v1.20.0"
15+
knative_eventing_version="v1.20.0"
16+
contour_version="v1.20.0"
1717
tekton_version="v1.1.0"
1818
pac_version="v0.35.2"
1919
}

pkg/deployer/common.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
)
66

77
const (
8-
DeployTypeAnnotation = "function.knative.dev/deploy-type"
8+
DeployerNameAnnotation = "function.knative.dev/deployer"
99

1010
// Dapr constants
1111
DaprEnabled = "true"
@@ -43,7 +43,7 @@ func GenerateCommonLabels(f fn.Function, decorator DeployDecorator) (map[string]
4343
}
4444

4545
// GenerateCommonAnnotations creates annotations common to both Knative and K8s deployments
46-
func GenerateCommonAnnotations(f fn.Function, decorator DeployDecorator, daprInstalled bool, deployType string) map[string]string {
46+
func GenerateCommonAnnotations(f fn.Function, decorator DeployDecorator, daprInstalled bool, deployerName string) map[string]string {
4747
aa := make(map[string]string)
4848

4949
// Add Dapr annotations if Dapr is installed
@@ -53,8 +53,8 @@ func GenerateCommonAnnotations(f fn.Function, decorator DeployDecorator, daprIns
5353
}
5454
}
5555

56-
if len(deployType) > 0 {
57-
aa[DeployTypeAnnotation] = deployType
56+
if len(deployerName) > 0 {
57+
aa[DeployerNameAnnotation] = deployerName
5858
}
5959

6060
// Add user-defined annotations

0 commit comments

Comments
 (0)