Skip to content

Commit

Permalink
Cleanup generator provider output (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
LewisKSaint authored Oct 2, 2023
1 parent ad8611f commit 9ac3d5f
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cli-build-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ jobs:
- name: Test generated terraform on broker
run: |
# Create
sed -i '/# username = "admin"/c\username = "admin"' messageVpn.tf
sed -i '/# password = "admin"/c\password = "admin"' messageVpn.tf
terraform plan
terraform apply -auto-approve
sleep 1
Expand Down
15 changes: 15 additions & 0 deletions cmd/broker/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
// terraform-provider-solacebroker
//
// Copyright 2023 Solace Corporation. All rights reserved.
//
// 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 broker

import (
Expand Down
15 changes: 15 additions & 0 deletions cmd/command/configgenerator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
// terraform-provider-solacebroker
//
// Copyright 2023 Solace Corporation. All rights reserved.
//
// 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 terraform

import (
Expand Down
15 changes: 15 additions & 0 deletions cmd/command/configwriter.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
// terraform-provider-solacebroker
//
// Copyright 2023 Solace Corporation. All rights reserved.
//
// 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 terraform

import (
Expand Down
4 changes: 2 additions & 2 deletions cmd/command/templates/terraform.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ terraform {
}

provider solacebroker {
username = "admin" # This is a placeholder.
password = "admin" # This is a placeholder.
# username = "admin" # This is a placeholder.
# password = "admin" # This is a placeholder.
url = "{{.BrokerURL}}"
}

Expand Down
15 changes: 15 additions & 0 deletions cmd/command/util.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
// terraform-provider-solacebroker
//
// Copyright 2023 Solace Corporation. All rights reserved.
//
// 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 terraform

import (
Expand Down
20 changes: 16 additions & 4 deletions cmd/versioncmd.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
/*
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
*/
// terraform-provider-solacebroker
//
// Copyright 2023 Solace Corporation. All rights reserved.
//
// 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 cmd

import (
Expand All @@ -15,7 +27,7 @@ import (
var versionCmd = &cobra.Command{
Use: "version",
Short: "Provides version information about the current binary",
Long: "",
Long: "",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(fmt.Sprintf("Provider version: %s, based on Semp version %s", broker.ProviderVersion, generated.SempVersion))
},
Expand Down

0 comments on commit 9ac3d5f

Please sign in to comment.