Skip to content

Commit

Permalink
Merge pull request #11 from moia-oss/minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes and proper use of license
  • Loading branch information
oppermax authored Jan 4, 2023
2 parents 187c951 + f6b93f7 commit b125916
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 12 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ your existing [GOPATH](http://golang.org/doc/code.html#GOPATH). The instructions
home directory outside the standard GOPATH (i.e `$HOME/development/terraform-providers/`).

```sh
$ git clone [email protected]:moia-oss/terraform-provider-opensearch.git
$ cd terraform-provider-opensearch
$ git clone [email protected]:moia-oss/terraform-provider-opensearch-dashboards.git
$ cd terraform-provider-opensearch-dashboards
...
```

Enter the provider directory and run `make install`. This will install the needed tools for the provider.
`make install` will install the needed tools for the provider.

```sh
$ make install
Expand All @@ -44,7 +44,7 @@ directory. The provider will be compiled for different supported architectures a
```sh
$ make release
...
$ ./bin/terraform-provider-opensearch_<version>_<os>_<arch>
$ ./bin/terraform-provider-opensearch-dashboards_<version>_<os>_<arch>
...
```

Expand All @@ -67,8 +67,7 @@ To instead use a custom-built provider in your Terraform environment (e.g. the p

We really appreciate your help!

To contribute, please read the contribution
guidelines: [Contributing to Terraform - OpenSearch Provider](.github/CONTRIBUTING.md)
To contribute, simply make a PR and a maintainer will review it shortly.

Issues on GitHub are intended to be related to the bugs or feature requests with provider codebase.
See [Plugin SDK Community](https://www.terraform.io/community)
Expand Down
10 changes: 5 additions & 5 deletions examples/saved_objects.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "opensearch_saved_object" "test-query" {
"title" : "Test Query",
"description" : "",
"query" : {
"query" : "\"Processstate\" AND \"systemtest\"",
"query" : "\"firstSearchTerm\" AND \"SecondSearchTerm\"",
"language" : "kuery"
},
"filters" : [
Expand All @@ -15,18 +15,18 @@ resource "opensearch_saved_object" "test-query" {
"negate" : false,
"disabled" : false,
"type" : "phrase",
"key" : "kubernetes.labels.app",
"key" : "foo.key",
"params" : {
"query" : "execution-coordinator"
"query" : "value-to-search-for"
}
},
"query" : {
"match_phrase" : {
"kubernetes.labels.app" : "execution-coordinator"
"foo.key" : "value-to-search-for"
}
},
"$state" : {
"store" : "appState"
"store" : "fooState"
}
}
]
Expand Down
18 changes: 17 additions & 1 deletion opensearch/provider.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
package opensearch

/*
Copyright 2022 MOIA GmbH
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.
*/

import (
"context"
"net/http"
Expand Down Expand Up @@ -73,7 +89,7 @@ func providerConfigure(_ context.Context, d *schema.ResourceData) (any, diag.Dia
if err != nil {
diags = append(diags, diag.Diagnostic{
Severity: diag.Error,
Summary: "Failed to get AWS credentials via the default chain",
Summary: "Could not create sigv4 HTTP request signer",
Detail: err.Error(),
})
return nil, diags
Expand Down
16 changes: 16 additions & 0 deletions opensearch/resource_saved_objects.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
package opensearch

/*
Copyright 2022 MOIA GmbH
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.
*/

import (
"context"
"encoding/json"
Expand Down
16 changes: 16 additions & 0 deletions pkg/saved_objects/saved_objects.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
package saved_objects

/*
Copyright 2022 MOIA GmbH
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.
*/

import (
"bytes"
"context"
Expand Down
16 changes: 16 additions & 0 deletions pkg/saved_objects/saved_objects_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
package saved_objects

/*
Copyright 2022 MOIA GmbH
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.
*/

import (
"context"
"encoding/json"
Expand Down
16 changes: 16 additions & 0 deletions pkg/saved_objects/types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
package saved_objects

/*
Copyright 2022 MOIA GmbH
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.
*/

type SavedObjectOSD struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
Expand Down
16 changes: 16 additions & 0 deletions pkg/sigv4/sigv4_signer.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
package sigv4

/*
Copyright 2022 MOIA GmbH
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.
*/

import (
"bytes"
"fmt"
Expand Down

0 comments on commit b125916

Please sign in to comment.