Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MGMT-16521: Identify Operator-based Deployment Data #5906

Merged
merged 1 commit into from Jan 31, 2024

Conversation

CrystalChun
Copy link
Contributor

@CrystalChun CrystalChun commented Jan 23, 2024

https://issues.redhat.com/browse/MGMT-16521
Read the deployment data from the environment
variables when deploying with the operator.
Possible values include ACM, MCE, and operator
(indicates stand-alone operator).

The block querying for ACM and MCE deployments
are a temporary work-around until ACM/MCE
allows injecting environment variables into the
infrastructure operator deployment.

https://issues.redhat.com/browse/ACM-9362
Slack thread context https://redhat-internal.slack.com/archives/CUEMEHRA9/p1704996574257619

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Test steps:

  1. Built operator image with changes
  2. Deploy ACM in OCP 4.14 aws cluster (from cluster bot)
  3. Paused MCE and used operator image in infrastructure operator deployment
    $ oc annotate multiclusterengine multiclusterengine pause=true
    $ oc edit deploy infrastructure-operator -n multicluster-engine # change all the assisted-service images to custom image
    
  4. Created AgentServiceConfig
  5. Get the configmap in the multicluster engine namespace and verified correct values
    $ oc get -oyaml configmap assisted-service -n multicluster-engine | grep DEPLOYMENT
      DEPLOYMENT_TYPE: ACM
      DEPLOYMENT_VERSION: 2.9.2
    

Following the same steps, but deploying MCE stand-alone:

$ oc get -oyaml configmap assisted-service -n multicluster-engine | grep DEPLOYMENT
  DEPLOYMENT_TYPE: MCE
  DEPLOYMENT_VERSION: 2.3.4

Deploying the stand-alone operator:

  1. Edit CSV to point to image with these changes (here)
  2. Build operator bundle
  3. Create assisted-installer namespace and create quay pull secret in namespace
  4. Deploy using operator-sdk to openshift 4.14 cluster
    $ operator-sdk run bundle \                             
      --namespace assisted-installer \
      ${BUNDLE_IMAGE:-quay.io/edge-infrastructure/assisted-service-operator-bundle:latest} --kubeconfig kubeconfig --pull-secret-name pull-secret
    
  5. Create agentserviceconfig
  6. Verify the configmap contains the correct values
    $ oc get configmap assisted-service -oyaml | grep DEPLOY
      DEPLOY_TARGET: k8s
      DEPLOYMENT_TYPE: Operator
      DEPLOYMENT_VERSION: quay.io/cchun/assisted-service:test-new-env-var-2
    

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 23, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 23, 2024

@CrystalChun: This pull request references MGMT-16521 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.16.0" version, but no target version was set.

In response to this:

https://issues.redhat.com/browse/MGMT-16521
Read the deployment data from the environment
variables when deploying with the operator.
Possible values include ACM, MCE, and operator
(indicates stand-alone operator).

The block querying for ACM and MCE deployments
are a temporary work-around until ACM/MCE
allows injecting environment variables into the
infrastructure operator deployment.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Test steps:

  1. Built operator image with changes
  2. Deploy ACM in OCP 4.14 aws cluster (from cluster bot)
  3. Paused MCE and used operator image in infrastructure operator deployment
    $ oc annotate multiclusterengine multiclusterengine pause=true
    $ oc edit deploy infrastructure-operator -n multicluster-engine # change all the assisted-service images to custom image
    
  4. Created AgentServiceConfig
  5. Get the configmap in the multicluster engine namespace and verified correct values
    $ oc get -oyaml configmap assisted-service | grep DEPLOYMENT
      DEPLOYMENT_TYPE: ACM
      DEPLOYMENT_VERSION: 2.9.2
    

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 23, 2024
Copy link

openshift-ci bot commented Jan 23, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 23, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 24, 2024

@CrystalChun: This pull request references MGMT-16521 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.16.0" version, but no target version was set.

In response to this:

https://issues.redhat.com/browse/MGMT-16521
Read the deployment data from the environment
variables when deploying with the operator.
Possible values include ACM, MCE, and operator
(indicates stand-alone operator).

The block querying for ACM and MCE deployments
are a temporary work-around until ACM/MCE
allows injecting environment variables into the
infrastructure operator deployment.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Test steps:

  1. Built operator image with changes
  2. Deploy ACM in OCP 4.14 aws cluster (from cluster bot)
  3. Paused MCE and used operator image in infrastructure operator deployment
    $ oc annotate multiclusterengine multiclusterengine pause=true
    $ oc edit deploy infrastructure-operator -n multicluster-engine # change all the assisted-service images to custom image
    
  4. Created AgentServiceConfig
  5. Get the configmap in the multicluster engine namespace and verified correct values
    $ oc get -oyaml configmap assisted-service -n multicluster-engine | grep DEPLOYMENT
      DEPLOYMENT_TYPE: ACM
      DEPLOYMENT_VERSION: 2.9.2
    

Following the same steps, but deploying MCE stand-alone:

$ oc get -oyaml configmap assisted-service -n multicluster-engine | grep DEPLOYMENT
 DEPLOYMENT_TYPE: MCE
 DEPLOYMENT_VERSION: 2.3.4

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 24, 2024

@CrystalChun: This pull request references MGMT-16521 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.16.0" version, but no target version was set.

In response to this:

https://issues.redhat.com/browse/MGMT-16521
Read the deployment data from the environment
variables when deploying with the operator.
Possible values include ACM, MCE, and operator
(indicates stand-alone operator).

The block querying for ACM and MCE deployments
are a temporary work-around until ACM/MCE
allows injecting environment variables into the
infrastructure operator deployment.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Test steps:

  1. Built operator image with changes
  2. Deploy ACM in OCP 4.14 aws cluster (from cluster bot)
  3. Paused MCE and used operator image in infrastructure operator deployment
    $ oc annotate multiclusterengine multiclusterengine pause=true
    $ oc edit deploy infrastructure-operator -n multicluster-engine # change all the assisted-service images to custom image
    
  4. Created AgentServiceConfig
  5. Get the configmap in the multicluster engine namespace and verified correct values
    $ oc get -oyaml configmap assisted-service -n multicluster-engine | grep DEPLOYMENT
      DEPLOYMENT_TYPE: ACM
      DEPLOYMENT_VERSION: 2.9.2
    

Following the same steps, but deploying MCE stand-alone:

$ oc get -oyaml configmap assisted-service -n multicluster-engine | grep DEPLOYMENT
 DEPLOYMENT_TYPE: MCE
 DEPLOYMENT_VERSION: 2.3.4

Deploying the stand-alone operator:

  1. Edit CSV to point to image with these changes (here)
  2. Build operator bundle
  3. Create assisted-installer namespace and create quay pull secret in namespace
  4. Deploy using operator-sdk to openshift 4.14 cluster
    $ operator-sdk run bundle \                             
      --namespace assisted-installer \
      ${BUNDLE_IMAGE:-quay.io/edge-infrastructure/assisted-service-operator-bundle:latest} --kubeconfig kubeconfig --pull-secret-name pull-secret
    
  5. Create agentserviceconfig
  6. Verify the configmap contains the correct values
    $ oc get configmap assisted-service -oyaml | grep DEPLOY
      DEPLOY_TARGET: k8s
      DEPLOYMENT_TYPE: Operator
      DEPLOYMENT_VERSION: quay.io/cchun/assisted-service:test-new-env-var-2
    

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@CrystalChun CrystalChun marked this pull request as ready for review January 24, 2024 22:25
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 24, 2024
Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (58ad0d7) 68.10% compared to head (7e16fea) 68.59%.
Report is 16 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5906      +/-   ##
==========================================
+ Coverage   68.10%   68.59%   +0.48%     
==========================================
  Files         235      236       +1     
  Lines       34642    35382     +740     
==========================================
+ Hits        23594    24271     +677     
- Misses       8986     9020      +34     
- Partials     2062     2091      +29     
Files Coverage Δ
...oller/controllers/agentserviceconfig_controller.go 87.23% <100.00%> (+2.21%) ⬆️

... and 11 files with indirect coverage changes

https://issues.redhat.com/browse/MGMT-16521
Read the deployment data from the environment
variables when deploying with the operator.
Possible values include ACM, MCE, and operator
(indicates stand-alone operator).

The block querying for ACM and MCE deployments
are a temporary work-around until ACM/MCE
allows injecting environment variables into the
infrastructure operator deployment.
@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 29, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 29, 2024

@CrystalChun: This pull request references MGMT-16521 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.16.0" version, but no target version was set.

In response to this:

https://issues.redhat.com/browse/MGMT-16521
Read the deployment data from the environment
variables when deploying with the operator.
Possible values include ACM, MCE, and operator
(indicates stand-alone operator).

The block querying for ACM and MCE deployments
are a temporary work-around until ACM/MCE
allows injecting environment variables into the
infrastructure operator deployment.

https://issues.redhat.com/browse/ACM-9362
Slack thread context https://redhat-internal.slack.com/archives/CUEMEHRA9/p1704996574257619

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Test steps:

  1. Built operator image with changes
  2. Deploy ACM in OCP 4.14 aws cluster (from cluster bot)
  3. Paused MCE and used operator image in infrastructure operator deployment
    $ oc annotate multiclusterengine multiclusterengine pause=true
    $ oc edit deploy infrastructure-operator -n multicluster-engine # change all the assisted-service images to custom image
    
  4. Created AgentServiceConfig
  5. Get the configmap in the multicluster engine namespace and verified correct values
    $ oc get -oyaml configmap assisted-service -n multicluster-engine | grep DEPLOYMENT
      DEPLOYMENT_TYPE: ACM
      DEPLOYMENT_VERSION: 2.9.2
    

Following the same steps, but deploying MCE stand-alone:

$ oc get -oyaml configmap assisted-service -n multicluster-engine | grep DEPLOYMENT
 DEPLOYMENT_TYPE: MCE
 DEPLOYMENT_VERSION: 2.3.4

Deploying the stand-alone operator:

  1. Edit CSV to point to image with these changes (here)
  2. Build operator bundle
  3. Create assisted-installer namespace and create quay pull secret in namespace
  4. Deploy using operator-sdk to openshift 4.14 cluster
    $ operator-sdk run bundle \                             
      --namespace assisted-installer \
      ${BUNDLE_IMAGE:-quay.io/edge-infrastructure/assisted-service-operator-bundle:latest} --kubeconfig kubeconfig --pull-secret-name pull-secret
    
  5. Create agentserviceconfig
  6. Verify the configmap contains the correct values
    $ oc get configmap assisted-service -oyaml | grep DEPLOY
      DEPLOY_TARGET: k8s
      DEPLOYMENT_TYPE: Operator
      DEPLOYMENT_VERSION: quay.io/cchun/assisted-service:test-new-env-var-2
    

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@rccrdpccl
Copy link
Contributor

/lgtm

@rccrdpccl
Copy link
Contributor

/hold
probably needs to be merged after #5874

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 30, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 30, 2024
Copy link

openshift-ci bot commented Jan 30, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CrystalChun, rccrdpccl

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CrystalChun,rccrdpccl]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@CrystalChun
Copy link
Contributor Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 31, 2024
Copy link

openshift-ci bot commented Jan 31, 2024

@CrystalChun: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 89f0a6b into openshift:master Jan 31, 2024
16 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-agent-installer-api-server-container-v4.16.0-202401311150.p0.g89f0a6b.assembly.stream for distgit ose-agent-installer-api-server.
All builds following this will include this PR.

CrystalChun added a commit to CrystalChun/assisted-service that referenced this pull request Jan 31, 2024
https://issues.redhat.com/browse/MGMT-16521
Read the deployment data from the environment
variables when deploying with the operator.
Possible values include ACM, MCE, and operator
(indicates stand-alone operator).

The block querying for ACM and MCE deployments
are a temporary work-around until ACM/MCE
allows injecting environment variables into the
infrastructure operator deployment.
@CrystalChun
Copy link
Contributor Author

/cherry-pick release-ocm-2.9

@openshift-cherrypick-robot

@CrystalChun: new pull request created: #5989

In response to this:

/cherry-pick release-ocm-2.9

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants