Skip to content

Support for raw app args#71

Merged
PrasadG193 merged 2 commits intomainfrom
raw_app_args
May 21, 2021
Merged

Support for raw app args#71
PrasadG193 merged 2 commits intomainfrom
raw_app_args

Conversation

@sahil-lakhwani
Copy link
Copy Markdown
Contributor

This PR adds ability for the recipe authors to patch raw app yamls by passing args
The args should follow a format of :
<kind>.<name>.<fieldPath>: <value>
where fieldPath is the path of the field to be patched

The value has to be typed - for example, string should be quoted.

Example:

apiVersion: v1
kind: kbrew
app:
  args:
    Deployment.nginx.spec.replicas: 4
    Deployment.nginx.spec.strategy.type: "RollingUpdate"
  repository:
    name: nginx
    url: https://raw.githubusercontent.com/Kurento/Kubernetes/master/nginx-deployment-service.yaml
    type: raw
  name: nginx
  namespace: "-"
  sha256:
  version: v0.10.1

Consists of #69 and #70 , so to be merged after them

@sahil-lakhwani sahil-lakhwani added the hold do not merge the PR label May 17, 2021
@PrasadG193 PrasadG193 self-requested a review May 18, 2021 07:17
Signed-off-by: sahil-lakhwani <sahilakhwani@gmail.com>
@sahil-lakhwani sahil-lakhwani removed the hold do not merge the PR label May 18, 2021
Comment thread pkg/apps/raw/raw.go Outdated
Comment thread pkg/apps/raw/raw.go
Comment on lines +250 to +252
case string:
v = fmt.Sprintf("\"%s\"", v)
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add a default case? What is the expected behavior if v.Type is not string? Should we fail here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The yq library expects just the strings to be quoted.

Comment thread pkg/apps/raw/raw.go Outdated
Signed-off-by: sahil-lakhwani <sahilakhwani@gmail.com>
@PrasadG193 PrasadG193 changed the title Raw app args Support for raw app args May 21, 2021
@PrasadG193 PrasadG193 merged commit 01935e1 into main May 21, 2021
@PrasadG193 PrasadG193 deleted the raw_app_args branch May 21, 2021 11:27
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.

2 participants