Skip to content

pkg/ansible: Adding paramconv and kubeconfig to ansible operator.#471

Merged
shawn-hurley merged 1 commit into
operator-framework:masterfrom
shawn-hurley:feature/add-AO-proxy-param
Sep 17, 2018
Merged

pkg/ansible: Adding paramconv and kubeconfig to ansible operator.#471
shawn-hurley merged 1 commit into
operator-framework:masterfrom
shawn-hurley:feature/add-AO-proxy-param

Conversation

@shawn-hurley
Copy link
Copy Markdown
Member

No description provided.

@shawn-hurley shawn-hurley force-pushed the feature/add-AO-proxy-param branch from 9f01c6f to 6e73bbd Compare September 11, 2018 18:32
// 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.
// Based on https://github.com/iancoleman/strcase
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably don't need the last line. We already have this license in the SDK
https://github.com/operator-framework/operator-sdk/blob/master/commands/operator-sdk/main.go#L1-L13

@hasbro17
Copy link
Copy Markdown
Contributor

LGTM after nit.
Took me a while to understand how the OwnerRef is being injected via the authorization header. That's actually really neat :)

@shawn-hurley shawn-hurley force-pushed the feature/add-AO-proxy-param branch from 6e73bbd to ca3d1a3 Compare September 13, 2018 20:28
Comment thread pkg/ansible/paramconv/paramconv.go Outdated
"strings"
)

var numberSequence = regexp.MustCompile(`([a-zA-Z])(\d+)([a-zA-Z]?)`)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our codebase uses var block consistently. maybe we should do it here too?
e. g

var (
 numberSequence = ...
 numberReplacement= ...
 wordMapping = ...
)

@shawn-hurley shawn-hurley force-pushed the feature/add-AO-proxy-param branch from ca3d1a3 to de44e56 Compare September 17, 2018 15:44
Comment thread pkg/ansible/proxy/proxy.go Outdated
if req.Method == http.MethodPost {
logrus.Info("injecting owner reference")
dump, _ := httputil.DumpRequest(req, false)
fmt.Println(string(dump))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why printing the dump file here?

Comment thread pkg/ansible/proxy/proxy.go Outdated
owner := metav1.OwnerReference{}
json.Unmarshal(authString, &owner)

logrus.Printf("%#+v", owner)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a debugging statement or actual log? If using actual log, we probably should use logrus.Infof().

Comment thread pkg/ansible/proxy/proxy.go Outdated
http.Error(w, m, http.StatusInternalServerError)
return
}
logrus.Printf(string(newBody))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. is this a debugging statement or normal logging. If normal logging, we should use logrus.Infof().

@shawn-hurley shawn-hurley force-pushed the feature/add-AO-proxy-param branch from de44e56 to 0205fb6 Compare September 17, 2018 18:22
@fanminshi
Copy link
Copy Markdown
Contributor

lgtm

@shawn-hurley shawn-hurley merged commit 85500b6 into operator-framework:master Sep 17, 2018
hasbro17 pushed a commit to hasbro17/operator-sdk that referenced this pull request Oct 3, 2018
hasbro17 added a commit that referenced this pull request Oct 4, 2018
#566)

* pkg/ansible: Adding paramconv and kubeconfig to ansible operator. (#471)

* Adding runner package. (#472)

* pkg/ansible: Adding ansible operator controller and events package (#473)

* make ansible task log outputs more readable (#545)
shawn-hurley pushed a commit to shawn-hurley/operator-sdk that referenced this pull request Oct 12, 2018
operator-framework#566)

* pkg/ansible: Adding paramconv and kubeconfig to ansible operator. (operator-framework#471)

* Adding runner package. (operator-framework#472)

* pkg/ansible: Adding ansible operator controller and events package (operator-framework#473)

* make ansible task log outputs more readable (operator-framework#545)
shawn-hurley pushed a commit that referenced this pull request Oct 16, 2018
#566)

* pkg/ansible: Adding paramconv and kubeconfig to ansible operator. (#471)

* Adding runner package. (#472)

* pkg/ansible: Adding ansible operator controller and events package (#473)

* make ansible task log outputs more readable (#545)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants